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 #include "common/events.h"
29 
30 namespace Sherlock {
31 
32 class Inventory;
33 class Talk;
34 
35 namespace Scalpel {
36 
37 extern const int MENU_POINTS[12][4];
38 
39 extern const int INVENTORY_POINTS[8][3];
40 
41 enum {
42  MAINBUTTON_LOOK = 0,
43  MAINBUTTON_MOVE,
44  MAINBUTTON_TALK,
45  MAINBUTTON_PICKUP,
46  MAINBUTTON_OPEN,
47  MAINBUTTON_CLOSE,
48  MAINBUTTON_INVENTORY,
49  MAINBUTTON_USE,
50  MAINBUTTON_GIVE,
51  MAINBUTTON_JOURNAL,
52  MAINBUTTON_FILES,
53  MAINBUTTON_SETUP,
54  MAINBUTTON_LOADGAME,
55  MAINBUTTON_SAVEGAME
56 };
57 
58 class Settings;
59 
61  friend class Settings;
62  friend class Sherlock::Talk;
63 private:
64  char _keyPress;
65  Common::CustomEventType _actionPress;
66  int _lookHelp;
67  int _help, _oldHelp;
68  int _key;
69  Common::CustomEventType _action, _oldAction;
70  int _temp, _oldTemp; // button number (0-11)
71  int _oldLook;
72  bool _keyboardInput;
73  bool _actionInput;
74  bool _pause;
75  int _cNum;
76  Common::String _cAnimStr;
77  Common::String _descStr;
78  int _find;
79 private:
83  void depressButton(int num);
84 
89  void pushButton(int num);
90 
96  void toggleButton(uint16 num);
97 
101  void lookScreen(const Common::Point &pt);
102 
106  void lookInv();
107 
111  void doEnvControl();
112 
116  void doInvControl();
117 
121  void doLookControl();
122 
126  void doMainControl();
127 
131  void doMiscControl(int allowed);
132 
136  void doPickControl();
137 
142  void doTalkControl();
143 
150  void journalControl();
151 
155  void checkUseAction(const UseType *use, const Common::String &invName, FixedTextActionId fixedTextActionId,
156  int objNum, bool giveMode);
157 
161  void printObjectDesc(const Common::String &str, bool firstTime);
162 public:
163  ImageFile *_controlPanel;
164  ImageFile *_controls;
165  int _oldUse;
166 
167  Common::CustomEventType _actionsIndexed[14];
168 
169 public:
171  ~ScalpelUserInterface() override;
172 
176  void whileMenuCounter();
177 
182  void restoreButton(int num);
183 
188  void examine();
189 
190  Common::Point getTopLeftButtonPoint(int num) const;
191  Common::Rect getButtonRect(int buttonNr) const;
192  int infoLineHeight() const;
193  int infoLineYOffset() const;
194 
195 public:
199  void reset() override;
200 
204  void handleInput() override;
205 
209  void drawInterface(int bufferNum = 3) override;
210 
214  void summonWindow(const Surface &bgSurface, bool slideUp = true) override;
215 
219  void summonWindow(bool slideUp = true, int height = CONTROLS_Y) override;
220 
225  void banishWindow(bool slideUp = true) override;
226 
230  void clearInfo() override;
231 
235  void clearWindow() override;
236 
240  virtual void printObjectDesc();
241 };
242 
243 } // End of namespace Scalpel
244 
245 } // End of namespace Sherlock
246 
247 #endif
Definition: surface.h:130
Definition: str.h:59
Definition: scalpel_user_interface.h:60
void banishWindow(bool slideUp=true) override
Definition: talk.h:164
Definition: animation.h:29
Definition: rect.h:524
uint32 CustomEventType
Definition: events.h:204
Definition: sherlock.h:206
Definition: settings.h:36
Definition: rect.h:144
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