ScummVM API documentation
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_UI_H
23 #define SHERLOCK_UI_H
24 
25 #include "common/scummsys.h"
26 #include "common/events.h"
27 #include "sherlock/surface.h"
28 #include "sherlock/objects.h"
29 #include "sherlock/resources.h"
30 #include "sherlock/fixed_text.h"
31 
32 namespace Sherlock {
33 
34 #define CONTROLS_Y 138
35 #define CONTROLS_Y1 151
36 
37 enum MenuMode {
38  STD_MODE = 0,
39  LOOK_MODE = 1,
40  MOVE_MODE = 2,
41  TALK_MODE = 3,
42  PICKUP_MODE = 4,
43  OPEN_MODE = 5,
44  CLOSE_MODE = 6,
45  INV_MODE = 7,
46  USE_MODE = 8,
47  GIVE_MODE = 9,
48  JOURNAL_MODE = 10,
49  FILES_MODE = 11,
50  SETUP_MODE = 12,
51 
52  // Rose Tattoo specific
53  LAB_MODE = 20,
54  MESSAGE_MODE = 21,
55  VERB_MODE = 22,
56  OPTION_MODE = 23,
57  QUIT_MODE = 24,
58  FOOLSCAP_MODE = 25,
59  PASSWORD_MODE = 26
60 };
61 
63 protected:
64  SherlockEngine *_vm;
65 
67 public:
68  MenuMode _menuMode;
69  int _menuCounter;
70  bool _infoFlag;
71  bool _windowOpen;
72  bool _endKeyActive;
73  int _invLookFlag;
74  bool _slideWindows;
75  bool _helpStyle;
76  Common::Rect _windowBounds;
77  bool _lookScriptFlag;
78  int _bgFound, _oldBgFound;
79  int _exitZone;
80 
81  // TODO: Not so sure these should be in the base class. May want to refactor them to SherlockEngine, or refactor
82  // various Scalpel dialogs to keep their own private state of key/selections
83  signed char _key, _oldKey;
84  int _selector, _oldSelector;
85  int _temp, _oldTemp;
86  int _temp1;
87  int _lookHelp;
88 public:
89  static UserInterface *init(SherlockEngine *vm);
90  virtual ~UserInterface() {}
91 
95  void checkAction(ActionType &action, int objNum, FixedTextActionId fixedTextActionId = kFixedTextAction_Invalid);
96 public:
100  virtual void reset();
101 
105  virtual void drawInterface(int bufferNum = 3) {}
106 
110  virtual void handleInput() {}
111 
115  virtual void summonWindow(const Surface &bgSurface, bool slideUp = true) {}
116 
120  virtual void summonWindow(bool slideUp = true, int height = CONTROLS_Y) {}
121 
126  virtual void banishWindow(bool slideUp = true) {}
127 
131  virtual void clearInfo() {}
132 
136  virtual void clearWindow() {}
137 };
138 
139 } // End of namespace Sherlock
140 
141 #endif
virtual void summonWindow(const Surface &bgSurface, bool slideUp=true)
Definition: user_interface.h:115
Definition: surface.h:118
virtual void drawInterface(int bufferNum=3)
Definition: user_interface.h:105
virtual void handleInput()
Definition: user_interface.h:110
Definition: animation.h:29
Definition: rect.h:144
virtual void banishWindow(bool slideUp=true)
Definition: user_interface.h:126
Definition: objects.h:154
Definition: sherlock.h:76
virtual void summonWindow(bool slideUp=true, int height=138)
Definition: user_interface.h:120
virtual void reset()
virtual void clearWindow()
Definition: user_interface.h:136
void checkAction(ActionType &action, int objNum, FixedTextActionId fixedTextActionId=kFixedTextAction_Invalid)
Definition: user_interface.h:62
virtual void clearInfo()
Definition: user_interface.h:131