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
32namespace Sherlock {
33
34#define CONTROLS_Y 138
35#define CONTROLS_Y1 151
36
37enum 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
63protected:
64 SherlockEngine *_vm;
65
67public:
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;
84 Common::CustomEventType _action, _oldAction;
85 int _selector, _oldSelector;
86 int _temp, _oldTemp;
87 int _temp1;
88 int _lookHelp;
89public:
90 static UserInterface *init(SherlockEngine *vm);
91 virtual ~UserInterface() {}
92
96 void checkAction(ActionType &action, int objNum, FixedTextActionId fixedTextActionId = kFixedTextAction_Invalid);
97public:
101 virtual void reset();
102
106 virtual void drawInterface(int bufferNum = 3) {}
107
111 virtual void handleInput() {}
112
116 virtual void summonWindow(const Surface &bgSurface, bool slideUp = true) {}
117
121 virtual void summonWindow(bool slideUp = true, int height = CONTROLS_Y) {}
122
127 virtual void banishWindow(bool slideUp = true) {}
128
132 virtual void clearInfo() {}
133
137 virtual void clearWindow() {}
138};
139
140} // End of namespace Sherlock
141
142#endif
Definition: sherlock.h:206
Definition: surface.h:130
Definition: user_interface.h:62
virtual void reset()
virtual void handleInput()
Definition: user_interface.h:111
virtual void banishWindow(bool slideUp=true)
Definition: user_interface.h:127
virtual void summonWindow(bool slideUp=true, int height=138)
Definition: user_interface.h:121
void checkAction(ActionType &action, int objNum, FixedTextActionId fixedTextActionId=kFixedTextAction_Invalid)
virtual void clearWindow()
Definition: user_interface.h:137
virtual void drawInterface(int bufferNum=3)
Definition: user_interface.h:106
virtual void clearInfo()
Definition: user_interface.h:132
virtual void summonWindow(const Surface &bgSurface, bool slideUp=true)
Definition: user_interface.h:116
uint32 CustomEventType
Definition: events.h:212
Definition: rect.h:536
Definition: objects.h:154