ScummVM API documentation
scalpel_user_interface.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 SHERLOCK_SCALPEL_UI_H
23 #define SHERLOCK_SCALPEL_UI_H
24 
25 #include "common/scummsys.h"
26 #include "sherlock/user_interface.h"
27 
28 namespace Sherlock {
29 
30 class Inventory;
31 class Talk;
32 
33 namespace Scalpel {
34 
35 extern const int MENU_POINTS[12][4];
36 
37 extern const int INVENTORY_POINTS[8][3];
38 
39 enum {
40  MAINBUTTON_LOOK = 0,
41  MAINBUTTON_MOVE,
42  MAINBUTTON_TALK,
43  MAINBUTTON_PICKUP,
44  MAINBUTTON_OPEN,
45  MAINBUTTON_CLOSE,
46  MAINBUTTON_INVENTORY,
47  MAINBUTTON_USE,
48  MAINBUTTON_GIVE,
49  MAINBUTTON_JOURNAL,
50  MAINBUTTON_FILES,
51  MAINBUTTON_SETUP,
52  MAINBUTTON_LOADGAME,
53  MAINBUTTON_SAVEGAME
54 };
55 
56 class Settings;
57 
59  friend class Settings;
60  friend class Sherlock::Talk;
61 private:
62  char _keyPress;
63  int _lookHelp;
64  int _help, _oldHelp;
65  int _key, _oldKey;
66  int _temp, _oldTemp; // button number (0-11)
67  int _oldLook;
68  bool _keyboardInput;
69  bool _pause;
70  int _cNum;
71  Common::String _cAnimStr;
72  Common::String _descStr;
73  int _find;
74 private:
78  void depressButton(int num);
79 
84  void pushButton(int num);
85 
91  void toggleButton(uint16 num);
92 
96  void lookScreen(const Common::Point &pt);
97 
101  void lookInv();
102 
106  void doEnvControl();
107 
111  void doInvControl();
112 
116  void doLookControl();
117 
121  void doMainControl();
122 
126  void doMiscControl(int allowed);
127 
131  void doPickControl();
132 
137  void doTalkControl();
138 
145  void journalControl();
146 
150  void checkUseAction(const UseType *use, const Common::String &invName, FixedTextActionId fixedTextActionId,
151  int objNum, bool giveMode);
152 
156  void printObjectDesc(const Common::String &str, bool firstTime);
157 public:
158  ImageFile *_controlPanel;
159  ImageFile *_controls;
160  int _oldUse;
161 
162  byte _hotkeyLook;
163  byte _hotkeyMove;
164  byte _hotkeyTalk;
165  byte _hotkeyPickUp;
166  byte _hotkeyOpen;
167  byte _hotkeyClose;
168  byte _hotkeyInventory;
169  byte _hotkeyUse;
170  byte _hotkeyGive;
171  byte _hotkeyJournal; // not used for 3DO
172  byte _hotkeyFiles; // not used for 3DO
173  byte _hotkeySetUp; // SetUp-button is in the spot of Journal for 3DO
174  byte _hotkeyLoadGame; // 3DO
175  byte _hotkeySaveGame; // 3DO
176 
177  byte _hotkeysIndexed[14];
178 
179 public:
181  ~ScalpelUserInterface() override;
182 
186  void whileMenuCounter();
187 
192  void restoreButton(int num);
193 
198  void examine();
199 
200  Common::Point getTopLeftButtonPoint(int num) const;
201  Common::Rect getButtonRect(int buttonNr) const;
202  int infoLineHeight() const;
203  int infoLineYOffset() const;
204 
205 public:
209  void reset() override;
210 
214  void handleInput() override;
215 
219  void drawInterface(int bufferNum = 3) override;
220 
224  void summonWindow(const Surface &bgSurface, bool slideUp = true) override;
225 
229  void summonWindow(bool slideUp = true, int height = CONTROLS_Y) override;
230 
235  void banishWindow(bool slideUp = true) override;
236 
240  void clearInfo() override;
241 
245  void clearWindow() override;
246 
250  virtual void printObjectDesc();
251 };
252 
253 } // End of namespace Scalpel
254 
255 } // End of namespace Sherlock
256 
257 #endif
Definition: surface.h:118
Definition: str.h:59
Definition: scalpel_user_interface.h:58
void banishWindow(bool slideUp=true) override
Definition: talk.h:164
Definition: animation.h:29
Definition: rect.h:144
Definition: sherlock.h:76
Definition: settings.h:33
Definition: rect.h:45
Definition: image_file.h:78
void drawInterface(int bufferNum=3) override
Definition: objects.h:168
Definition: user_interface.h:62
void summonWindow(const Surface &bgSurface, bool slideUp=true) override