ScummVM API documentation
dialogs_spells.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 XEEN_DIALOGS_SPELLS_H
23 #define XEEN_DIALOGS_SPELLS_H
24 
25 #include "common/array.h"
26 #include "mm/xeen/dialogs/dialogs.h"
27 #include "mm/xeen/party.h"
28 
29 namespace MM {
30 namespace Xeen {
31 
32 enum SpellDialogMode {
33  SPELLS_DIALOG_BUY = 0, SPELLS_DIALOG_SELECT = 1, SPELLS_DIALOG_INFO = 0x80
34 };
35 
36 struct SpellEntry {
37  Common::String _name;
38  int _spellIndex;
39  int _spellId;
40  int _color;
41 
42  SpellEntry(const Common::String &name, int spellIndex, int spellId) :
43  _name(name), _spellIndex(spellIndex), _spellId(spellId), _color(9) {}
44 };
45 
50 class SpellsDialog : public ButtonContainer {
51 private:
52  SpriteResource _iconSprites;
53  SpriteResource _scrollSprites;
55 
60 
64  Character *execute(ButtonContainer *priorDialog, Character *c, int mode);
65 
69  void loadButtons();
70 
74  const char *setSpellText(Character *c, int isCasting);
75 
76 #ifdef USE_TTS
77 
82  void speakText(const Common::String &text, int mode);
83 
90  Common::String resetButtonTexts(const Common::String &text, int mode);
91 #endif
92 public:
96  static Character *show(XeenEngine *vm, ButtonContainer *priorDialog,
97  Character *c, SpellDialogMode mode);
98 };
99 
100 class CastSpell : public ButtonContainer {
101 private:
102  SpriteResource _iconSprites;
103  int _oldMode;
104 private:
105  CastSpell(XeenEngine *vm);
106  ~CastSpell() override;
107 
108  int execute(Character *&c);
109 
110  void loadButtons();
111 
112 #ifdef USE_TTS
113  void speakText(const Common::String &text);
114 #endif
115 public:
116  static int show(XeenEngine *vm);
117 };
118 
119 class SpellOnWho : public ButtonContainer {
120 private:
122 
123  int execute(int spellId);
124 public:
125  static Character *show(XeenEngine *vm, int spellId);
126 };
127 
129 private:
130  SpriteResource _iconSprites;
131 
133 
134  int execute(int spellId);
135 
136  void loadButtons();
137 
138 #ifdef USE_TTS
139  void speakText(const Common::String &text);
140 #endif
141 public:
142  static int show(XeenEngine *vm, int spellId);
143 };
144 
146 private:
148 
149  void execute(int spellId);
150 public:
151  static void show(XeenEngine *vm, int spellId);
152 };
153 
155 private:
156  SpriteResource _iconSprites;
157 
159 
160  bool execute();
161 
162  void loadButtons();
163 
164 #ifdef USE_TTS
165  void speakText(const Common::String &text);
166 #endif
167 public:
168  static bool show(XeenEngine *vm);
169 };
170 
171 class Teleport : public ButtonContainer {
172 private:
173  SpriteResource _iconSprites;
174 
175  Teleport(XeenEngine *vm) : ButtonContainer(vm) {}
176 
177  int execute();
178 public:
179  static int show(XeenEngine *vm);
180 };
181 
182 class TownPortal : public ButtonContainer {
183 private:
185 
186  int execute();
187 public:
188  static int show(XeenEngine *vm);
189 };
190 
192 private:
194 
195  void execute();
196 
197 #ifdef USE_TTS
198  void speakText(const Common::String &text) const;
199 #endif
200 public:
201  static void show(XeenEngine *vm);
202 };
203 
205 private:
207 
208  void execute();
209 public:
210  static void show(XeenEngine *vm);
211 };
212 
213 } // End of namespace Xeen
214 } // End of namespace MM
215 
216 #endif
Definition: str.h:59
Definition: dialogs_spells.h:100
Definition: dialogs_spells.h:204
Definition: dialogs_spells.h:171
Definition: dialogs_spells.h:145
Definition: array.h:52
Definition: sprites.h:52
Definition: dialogs_spells.h:50
Definition: xeen.h:107
Definition: dialogs_spells.h:191
Definition: character.h:106
Definition: detection.h:27
Definition: dialogs_spells.h:128
Definition: dialogs.h:88
Definition: dialogs_spells.h:36
Definition: dialogs_spells.h:119
Definition: dialogs_spells.h:154
Definition: dialogs_spells.h:182