ScummVM API documentation
dialogs_nebular.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef MADS_DIALOGS_NEBULAR_H
23 #define MADS_DIALOGS_NEBULAR_H
24 
25 #include "common/scummsys.h"
26 #include "mads/game.h"
27 #include "mads/dialogs.h"
28 
29 namespace MADS {
30 
31 namespace Nebular {
32 
33 enum CapitalizationMode { kUppercase = 0, kLowercase = 1, kUpperAndLower = 2 };
34 
35 class DialogsNebular : public Dialogs {
36  friend class Dialogs;
37 private:
38  int _dialogWidth;
39  CapitalizationMode _capitalizationMode;
40 
41  DialogsNebular(MADSEngine *vm): Dialogs(vm), _capitalizationMode(kUppercase), _dialogWidth(0) {}
42 
43  Common::String getVocab(int vocabId) override;
44 
45  bool textNoun(Common::String &dest, int nounId, const Common::String &source);
46 
47  bool commandCheck(const char *idStr, Common::String &valStr, const Common::String &command);
48 
49  void showScummVMSaveDialog();
50  void showScummVMRestoreDialog();
51 
52 public:
53  void showDialog() override;
54 
55  void showItem(int objectId, int messageId, int speech = -1) override;
56 
57  bool show(int messageId, int objectId = -1) override;
58 };
59 
60 struct HOGANUS {
61  int _bookId;
62  int _pageNum;
63  int _lineNum;
64  int _wordNum;
65  Common::String _word;
66 };
67 
69 private:
70  HOGANUS _hogEntry;
71  Common::String _textInput;
72 
76  bool getHogAnusEntry(HOGANUS &entry);
77 public:
81  CopyProtectionDialog(MADSEngine *vm, bool priorAnswerWrong);
82 
86  void show() override;
87 
88  bool isCorrectAnswer();
89 };
90 
91 class PictureDialog : public TextDialog {
92 private:
93  int _objectId;
94  bool _cyclingActive;
95  byte _palette[PALETTE_SIZE];
96  uint32 _palFlags[PALETTE_COUNT];
97  RGBList _rgbList;
98 protected:
99  void save() override;
100 
101  void restore() override;
102 public:
103  PictureDialog(MADSEngine *vm, const Common::Point &pos, int maxChars, int objectId);
104 
105  ~PictureDialog() override;
106 };
107 
108 enum DialogTextAlign { ALIGN_NONE = 0, ALIGN_CENTER = -1, ALIGN_AT_CENTER = -2, ALIGN_RIGHT = -3 };
109 
110 enum DialogState { DLGSTATE_UNSELECTED = 0, DLGSTATE_SELECTED = 1, DLGSTATE_FOCUSED = 2 };
111 
113  struct DialogLine {
114  bool _active;
115  DialogState _state;
116  Common::Point _pos;
117  int _textDisplayIndex;
118  Common::String _msg;
119  Font *_font;
120  int _widthAdjust;
121 
122  DialogLine();
123  DialogLine(const Common::String &s);
124  };
125 protected:
127  int _tempLine;
128  bool _movedFlag;
129  bool _redrawFlag;
130  int _selectedLine;
131  bool _dirFlag;
132  int _menuSpritesIndex;
133  int _lineIndex;
134  int _textLineCount;
135 
139  void display() override;
140 
144  void clearLines();
145 
149  void setClickableLines();
150 
154  void addQuote(int id1, int id2, DialogTextAlign align, const Common::Point &pt, Font *font = nullptr);
155 
159  void addLine(const Common::String &msg, DialogTextAlign align, const Common::Point &pt, Font *font = nullptr);
160 
164  void initVars();
165 
169  void setFrame(int frameNumber, int depth);
170 
174  void chooseBackground();
175 
179  void handleEvents();
180 
184  void refreshText();
185 public:
189  GameDialog(MADSEngine *vm);
190 
194  ~GameDialog() override;
195 
199  virtual void show();
200 };
201 
202 class DifficultyDialog : public GameDialog {
203 private:
207  void setLines();
208 public:
210 
214  void display() override;
215 
219  void show() override;
220 };
221 
222 class GameMenuDialog : public GameDialog {
223 private:
227  void setLines();
228 public:
230 
234  void display() override;
235 
239  void show() override;
240 };
241 
242 class OptionsDialog : public GameDialog {
243 private:
247  void setLines();
248 
252  int getOptionQuote(int option);
253 public:
255 
259  void display() override;
260 
264  void show() override;
265 };
266 
267 } // End of namespace Nebular
268 
269 } // End of namespace MADS
270 
271 #endif /* MADS_DIALOGS_NEBULAR_H */
Definition: dialogs_nebular.h:242
Definition: dialogs.h:101
Definition: str.h:59
Definition: dialogs_nebular.h:35
Definition: dialogs.h:236
Definition: dialogs_nebular.h:222
Definition: dialogs_nebular.h:202
Definition: palette.h:143
Definition: dialogs_nebular.h:112
Definition: dialogs_nebular.h:60
Definition: dialogs_nebular.h:68
Definition: rect.h:45
Definition: mads.h:87
Definition: font.h:47
Definition: action.h:28
Definition: dialogs_nebular.h:91
Definition: dialogs.h:261