ScummVM API documentation
gui_eob.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#if defined(ENABLE_EOB) || defined(ENABLE_LOL)
23
24#ifndef KYRA_GUI_EOB_H
25#define KYRA_GUI_EOB_H
26
27#include "kyra/gui/gui.h"
28
29#ifdef ENABLE_EOB
30
31namespace Kyra {
32
33struct EoBRect16 {
34 int16 x1;
35 int16 y1;
36 uint16 x2;
37 uint16 y2;
38};
39
40class DarkMoonEngine;
41class Screen_EoB;
42
43class GUI_EoB : public GUI {
44 friend class EoBCoreEngine;
45 friend class CharacterGenerator;
46public:
47 GUI_EoB(EoBCoreEngine *vm);
48 ~GUI_EoB() override;
49
50 void initStaticData() {}
51
52 // button specific
53 void processButton(Button *button) override;
54 int processButtonList(Button *buttonList, uint16 inputFlags, int8 mouseWheel) override;
55
56 // Non button based menu handling (main menu, character generation)
57 void simpleMenu_setup(int sd, int maxItem, const char *const *strings, int32 menuItemsMask, int itemOffset, int lineSpacing, int textColor, int highlightColor, int shadowColor);
58 int simpleMenu_process(int sd, const char *const *strings, void *b, int32 menuItemsMask, int itemOffset);
59 void simpleMenu_unselect(int sd, const char *const *strings, void *b, int32 menuItemsMask, int itemOffset);
60
61 // Button based menus (camp menu, load menu)
62 virtual void runCampMenu();
63 virtual bool runLoadMenu(int x, int y, bool fromMainMenu = false);
64
65 bool confirmDialogue2(int dim, int id, int deflt);
66 void messageDialog(int dim, int id, int buttonTextCol);
67 void messageDialog2(int dim, int id, int buttonTextCol);
68
69 void updateBoxFrameHighLight(int box);
70
71 int getTextInput(char *dest, int x, int y, int destMaxLen, int textColor1, int textColor2, int cursorColor);
72
73 // Transfer party
74 void transferWaitBox();
75 Common::String transferTargetMenu(Common::Array<Common::String> &targets);
76 bool transferFileMenu(Common::String &targetName, Common::String &selection);
77
78 // utilities for thumbnail creation
79 void createScreenThumbnail(Graphics::Surface &dst) override;
80
81protected:
82 const char *getMenuString(int id);
83 Button *initMenu(int id);
84 void releaseButtons(Button *list);
85 virtual int mapPointToEntry(const Common::Point &p) const;
86
87 int8 *_numAssignedSpellsOfType;
88 char** _saveSlotStringsTemp;
89 int16 _saveSlotX;
90 int16 _saveSlotY;
91 int _menuCur;
92
93 int _clickableCharactersPage;
94 char _csjis[3];
95
96 Screen_EoB *_screen;
97
98private:
99 int simpleMenu_getMenuItem(int index, int32 menuItemsMask, int itemOffset);
100 void simpleMenu_flashSelection(const char *str, int x, int y, int color1, int color2, int color3);
101 void simpleMenu_initMenuItemsMask(int menuId, int maxItem, int32 menuItemsMask, int unk);
102 void simpleMenu_printButton(int sd, int num, const char *title, bool isHighlight, bool isInitial);
103 Common::Point simpleMenu_getTextPoint(int num, int *col = nullptr);
104 int simpleMenu_getMouseItem(int sd);
105
106 bool runSaveMenu(int x, int y);
107 int selectSaveSlotDialog(int x, int y, int id);
108 virtual void drawSaveSlotDialog(int x, int y, int id);
109 void runMemorizePrayMenu(int charIndex, int spellType);
110 void scribeScrollDialogue();
111 bool restParty();
112
113 virtual void drawCampMenu() {}
114 virtual void initMemorizePrayMenu(int) {}
115 virtual void initScribeScrollMenu() {}
116 virtual void printScribeScrollSpellString(const int16 *menuItems, int id, bool highlight);
117 virtual bool confirmDialogue(int id);
118 int selectCharacterDialogue(int id);
119 virtual void displayTextBox(int id, int textColor = 0xFF, bool wait = true);
120
121 virtual void drawMenuButton(Button *b, bool clicked, bool highlight, bool noFill);
122 void drawMenuButtonBox(int x, int y, int w, int h, bool clicked, bool noFill);
123 void drawTextBox(int dim, int id);
124 virtual void drawSaveSlotButton(int slot, int redrawBox, bool highlight);
125 virtual void memorizePrayMenuPrintString(int spellId, int bookPageIndex, int spellType, bool noFill, bool highLight);
126 virtual void updateOptionsStrings();
127
128 Button *linkButton(Button *list, Button *newbt);
129
130 void setupSaveMenuSlots();
131 virtual int getHighlightSlot();
132 void sortSaveSlots() override;
133
134 virtual void restParty_updateRestTime(int hours, bool init);
135
136 char **_menuStringsPrefsTemp;
137 int16 *_saveSlotIdTemp;
138 int _savegameOffset;
139 const int _numSlotsVisible;
140
141 EoBCoreEngine *_vm;
142
143 Button *_specialProcessButton;
144 Button *_backupButtonList;
145 uint16 _flagsMouseLeft;
146 uint16 _flagsMouseRight;
147 uint16 _flagsModifier;
148 uint16 _progress;
149 uint16 _prcButtonUnk3;
150 uint16 _cflag;
151
152 int _menuLineSpacing;
153 int _menuLastInFlags;
154 int _menuTextColor;
155 int _menuHighlightColor;
156 int _menuShadowColor;
157 int _menuLines[2];
158 int _menuColumnWidth[2];
159 int _menuColumnOffset[2];
160 bool _menuOverflow[20];
161 int _menuColumns;
162 Common::Point _menuPoint;
163
164 uint8 _numPages;
165 uint8 _numVisPages;
166 uint32 _clericSpellAvltyFlags;
167 uint32 _paladinSpellAvltyFlags;
168 bool _needRest;
169
170 int _menuNumItems;
171 bool _charSelectRedraw;
172
173 int _updateBoxIndex;
174 int _updateBoxColorIndex;
175 const uint8 *_highLightColorTable;
176 uint32 _highLightBoxTimer;
177
178 const bool _textInputForceUppercase;
179 const int _textInputHeight;
180 const int _textInputShadowOffset;
181
182 const Screen::FontId _menuFont;
183 const Screen::FontId _menuFont2;
184 const int _dlgButtonHeight1;
185 const int _dlgButtonHeight2;
186 const int _dlgButtonLabelYOffs;
187
188 const EoBRect16 *_highlightFrames;
189 static const EoBRect16 _highlightFramesDefault[20];
190 static const EoBRect16 _highlightFramesTransferZH[6];
191 static const uint8 _highlightColorTableVGA[];
192 static const uint8 _highlightColorTableEGA[];
193 static const uint8 _highlightColorTableAmiga[];
194 static const uint8 _highlightColorTablePC98[];
195 static const uint8 _highlightColorTableSegaCD[];
196
197 // FM-Towns / SegaCD specific
198 virtual uint16 checkClickableCharactersSelection();
199 virtual void printClickableCharacters(int page);
200};
201
202} // End of namespace Kyra
203
204#endif // ENABLE_EOB
205
206#endif
207
208#endif // ENABLE_EOB || ENABLE_LOL
Definition: input.h:69
Definition: str.h:59
Definition: detection.h:27
Definition: rect.h:144
Definition: surface.h:67