ScummVM API documentation
dialogs_phantom.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_PHANTOM_H
23 #define MADS_DIALOGS_PHANTOM_H
24 
25 #include "common/scummsys.h"
26 #include "mads/game.h"
27 #include "mads/dialogs.h"
28 
29 namespace MADS {
30 namespace Phantom {
31 
32 enum CapitalizationMode { kUppercase = 0, kLowercase = 1, kUpperAndLower = 2 };
33 
34 class DialogsPhantom : public Dialogs {
35  friend class Dialogs;
36 private:
37  int _dialogWidth;
38  CapitalizationMode _capitalizationMode;
39 
40  DialogsPhantom(MADSEngine *vm): Dialogs(vm), _capitalizationMode(kUppercase), _dialogWidth(0) {}
41 
42  Common::String getVocab(int vocabId) override;
43 
44  bool textNoun(Common::String &dest, int nounId, const Common::String &source);
45 
46  bool commandCheck(const char *idStr, Common::String &valStr, const Common::String &command);
47 
48  void showScummVMSaveDialog();
49  void showScummVMRestoreDialog();
50 
51 public:
52  void showDialog() override;
53 
54  void showItem(int objectId, int messageId, int speech = -1) override;
55 
56  bool show(int messageId, int objectId = -1) override;
57 };
58 
59 struct HOGANUS {
60  int _bookId;
61  int _pageNum;
62  int _lineNum;
63  int _wordNum;
64  Common::String _word;
65 };
66 
68 private:
69  HOGANUS _hogEntry;
70  Common::String _textInput;
71 
75  bool getHogAnusEntry(HOGANUS &entry);
76 public:
80  CopyProtectionDialog(MADSEngine *vm, bool priorAnswerWrong);
81 
85  void show() override;
86 
87  bool isCorrectAnswer();
88 };
89 
90 class PictureDialog : public TextDialog {
91 private:
92  int _objectId;
93  bool _cyclingActive;
94  byte _palette[PALETTE_SIZE];
95  uint32 _palFlags[PALETTE_COUNT];
96  RGBList _rgbList;
97 protected:
98  void save() override;
99 
100  void restore() override;
101 public:
102  PictureDialog(MADSEngine *vm, const Common::Point &pos, int maxChars, int objectId);
103 
104  ~PictureDialog() override;
105 };
106 
107 enum DialogTextAlign { ALIGN_NONE = 0, ALIGN_CENTER = -1, ALIGN_AT_CENTER = -2, ALIGN_RIGHT = -3 };
108 
109 enum DialogState { DLGSTATE_UNSELECTED = 0, DLGSTATE_SELECTED = 1, DLGSTATE_FOCUSED = 2 };
110 
112  struct DialogLine {
113  bool _active;
114  DialogState _state;
115  Common::Point _pos;
116  int _textDisplayIndex;
117  Common::String _msg;
118  Font *_font;
119  int _widthAdjust;
120 
121  DialogLine();
122  DialogLine(const Common::String &s);
123  };
124 protected:
126  int _tempLine;
127  bool _movedFlag;
128  bool _redrawFlag;
129  int _selectedLine;
130  bool _dirFlag;
131  int _menuSpritesIndex;
132  int _lineIndex;
133  int _textLineCount;
134 
138  void display() override;
139 
143  void clearLines();
144 
148  void setClickableLines();
149 
153  void addQuote(int id1, int id2, DialogTextAlign align, const Common::Point &pt, Font *font = nullptr);
154 
158  void addLine(const Common::String &msg, DialogTextAlign align, const Common::Point &pt, Font *font = nullptr);
159 
163  void initVars();
164 
168  void setFrame(int frameNumber, int depth);
169 
173  void chooseBackground();
174 
178  void handleEvents();
179 
183  void refreshText();
184 public:
188  GameDialog(MADSEngine *vm);
189 
193  ~GameDialog() override;
194 
198  virtual void show();
199 };
200 
201 class DifficultyDialog : public GameDialog {
202 private:
206  void setLines();
207 public:
209 
213  void display() override;
214 
218  void show() override;
219 };
220 
221 class GameMenuDialog : public GameDialog {
222 private:
226  void setLines();
227 public:
229 
233  void display() override;
234 
238  void show() override;
239 };
240 
241 class OptionsDialog : public GameDialog {
242 private:
246  void setLines();
247 
251  int getOptionQuote(int option);
252 public:
254 
258  void display() override;
259 
263  void show() override;
264 };
265 
266 } // namespace Phantom
267 } // namespace MADS
268 
269 #endif
Definition: dialogs.h:101
Definition: str.h:59
Definition: dialogs_phantom.h:34
Definition: dialogs_phantom.h:67
Definition: dialogs.h:236
Definition: dialogs_phantom.h:221
Definition: dialogs_phantom.h:111
Definition: palette.h:143
Definition: dialogs_phantom.h:201
Definition: rect.h:144
Definition: dialogs_phantom.h:90
Definition: mads.h:79
Definition: font.h:47
Definition: action.h:28
Definition: dialogs_phantom.h:59
Definition: dialogs_phantom.h:241
Definition: dialogs.h:261