ScummVM API documentation
tattoo_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_TATTOO_UI_H
23#define SHERLOCK_TATTOO_UI_H
24
25#include "common/scummsys.h"
26#include "common/list.h"
27#include "sherlock/saveload.h"
28#include "sherlock/screen.h"
29#include "sherlock/user_interface.h"
30#include "sherlock/tattoo/widget_credits.h"
31#include "sherlock/tattoo/widget_files.h"
32#include "sherlock/tattoo/widget_inventory.h"
33#include "sherlock/tattoo/widget_options.h"
34#include "sherlock/tattoo/widget_quit.h"
35#include "sherlock/tattoo/widget_text.h"
36#include "sherlock/tattoo/widget_tooltip.h"
37#include "sherlock/tattoo/widget_verbs.h"
38
39namespace Sherlock {
40
41namespace Tattoo {
42
43// Button width/height
44#define BUTTON_SIZE 15
45// How long to play the intro before it can be skipped
46#define STARTUP_KEYS_DISABLED_DELAY 200
47
48class WidgetBase;
49
50enum ScrollHighlight { SH_NONE = 0, SH_SCROLL_UP = 1, SH_PAGE_UP = 2, SH_THUMBNAIL = 3, SH_PAGE_DOWN = 4, SH_SCROLL_DOWN = 5 };
51
52class WidgetList : public Common::List <WidgetBase *> {
53public:
54 bool contains(const WidgetBase *item) const;
55};
56
58 friend class WidgetBase;
59private:
60 int _scriptZone;
61 int _cAnimFramePause;
62 WidgetInventory _inventoryWidget;
63 WidgetMessage _messageWidget;
64 WidgetQuit _quitWidget;
65 WidgetList _fixedWidgets;
66 WidgetList _widgets;
67 byte _lookupTable[Graphics::PALETTE_COUNT];
68 byte _lookupTable1[Graphics::PALETTE_COUNT];
69private:
73 void doStandardControl();
74
78 void doLookControl();
79
83 void doFileControl();
84
88 void doVerbControl();
89
93 void freeMenu();
94public:
95 Common::Point _targetScroll;
96 int _scrollSize, _scrollSpeed;
97 bool _drawMenu;
98 int _arrowZone, _oldArrowZone;
99 Object *_bgShape;
100 bool _personFound;
101 int _activeObj;
102 Common::KeyState _keyState;
104 Common::Point _lookPos;
105 ScrollHighlight _scrollHighlight;
106 Common::SeekableReadStream *_mask, *_mask1;
107 Common::Point _maskOffset;
108 int _maskCounter;
109 int _lockoutTimer;
110 ImageFile *_interfaceImages;
111 WidgetCredits _creditsWidget;
112 WidgetOptions _optionsWidget;
113 WidgetText _textWidget;
114 WidgetSceneTooltip _tooltipWidget;
115 WidgetVerbs _verbsWidget;
116 WidgetList _postRenderWidgets;
117public:
119 ~TattooUserInterface() override;
120
125
129 void doScroll();
130
135
140
146 void printObjectDesc(const Common::String &str, bool firstTime);
147
151 void doJournal();
152
156 void doInventory(int mode);
157
162
167
171 void pickUpObject(int objNum);
172
176 void putMessage(MSVC_PRINTF const char *formatStr, ...) GCC_PRINTF(2, 3);
177
181 void setupBGArea(const byte cMap[Graphics::PALETTE_SIZE]);
182
187
191 void drawMaskArea(bool mode);
192
198 void maskArea(Common::SeekableReadStream &mask, const Common::Point &pt);
199
203 void makeBGArea(const Common::Rect &r);
204
208 void drawDialogRect(Surface &s, const Common::Rect &r, bool raised);
209
215
219 void loadGame();
220
224 void saveGame();
225
231public:
235 void reset() override;
236
240 void handleInput() override;
241
245 void drawInterface(int bufferNum = 3) override;
246
250 void clearWindow() override;
251
257 void banishWindow(bool slideUp = true) override;
258};
259
260} // End of namespace Tattoo
261
262} // End of namespace Sherlock
263
264#endif
Definition: list.h:44
Definition: stream.h:745
Definition: str.h:59
Definition: image_file.h:78
Definition: objects.h:363
Definition: sherlock.h:206
Definition: surface.h:130
Definition: tattoo_user_interface.h:57
void drawInterface(int bufferNum=3) override
void putMessage(MSVC_PRINTF const char *formatStr,...) GCC_PRINTF(2
void printObjectDesc(const Common::String &str, bool firstTime)
void banishWindow(bool slideUp=true) override
void drawDialogRect(Surface &s, const Common::Rect &r, bool raised)
void maskArea(Common::SeekableReadStream &mask, const Common::Point &pt)
void addFixedWidget(WidgetBase *widget)
void makeBGArea(const Common::Rect &r)
void void setupBGArea(const byte cMap[Graphics::PALETTE_SIZE])
Definition: widget_base.h:37
Definition: widget_credits.h:45
Definition: widget_inventory.h:82
Definition: tattoo_user_interface.h:52
Definition: widget_text.h:57
Definition: widget_options.h:39
Definition: widget_quit.h:34
Definition: widget_tooltip.h:71
Definition: widget_text.h:34
Definition: widget_verbs.h:36
Definition: user_interface.h:62
uint32 CustomEventType
Definition: events.h:212
int FORCEINLINE GCC_PRINTF(2, 0) int vsprintf_s(T(&dst)[N]
Definition: algorithm.h:29
Definition: formatinfo.h:28
constexpr int PALETTE_COUNT
Definition: palette.h:42
Definition: keyboard.h:294
Definition: rect.h:144
Definition: display_client.h:58