ScummVM API documentation
journal.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 QUEEN_JOURNAL_H
23#define QUEEN_JOURNAL_H
24
25#include "common/util.h"
26
27class OSystem;
28
29namespace Queen {
30
31class QueenEngine;
32
33class Journal {
34public:
35
37 void use();
38
39 enum {
40 JOURNAL_BANK = 8,
41 JOURNAL_FRAMES = 40
42 };
43
44 enum {
45 ZN_REVIEW_ENTRY = 1,
46 ZN_MAKE_ENTRY = 2,
47 ZN_YES = ZN_MAKE_ENTRY,
48 ZN_CLOSE = 3,
49 ZN_NO = ZN_CLOSE,
50 ZN_GIVEUP = 4,
51 ZN_TEXT_SPEED = 5,
52 ZN_SFX_TOGGLE = 6,
53 ZN_MUSIC_VOLUME = 7,
54 ZN_DESC_1 = 8,
55 ZN_DESC_2 = 9,
56 ZN_DESC_3 = 10,
57 ZN_DESC_4 = 11,
58 ZN_DESC_5 = 12,
59 ZN_DESC_6 = 13,
60 ZN_DESC_7 = 14,
61 ZN_DESC_8 = 15,
62 ZN_DESC_9 = 16,
63 ZN_DESC_10 = 17,
64 ZN_PAGE_A = 18,
65 ZN_PAGE_B = 19,
66 ZN_PAGE_C = 20,
67 ZN_PAGE_D = 21,
68 ZN_PAGE_E = 22,
69 ZN_PAGE_F = 23,
70 ZN_PAGE_G = 24,
71 ZN_PAGE_H = 25,
72 ZN_PAGE_I = 26,
73 ZN_PAGE_J = 27,
74 ZN_INFO_BOX = 28,
75 ZN_MUSIC_TOGGLE = 29,
76 ZN_VOICE_TOGGLE = 30,
77 ZN_TEXT_TOGGLE = 31
78 };
79
80 enum {
81 BOB_LEFT_RECT_1 = 1,
82 BOB_LEFT_RECT_2 = 2,
83 BOB_LEFT_RECT_3 = 3,
84 BOB_LEFT_RECT_4 = 4,
85 BOB_TALK_SPEED = 5,
86 BOB_SFX_TOGGLE = 6,
87 BOB_MUSIC_VOLUME = 7,
88 BOB_SAVE_DESC = 8,
89 BOB_SAVE_PAGE = 9,
90 BOB_SPEECH_TOGGLE = 10,
91 BOB_TEXT_TOGGLE = 11,
92 BOB_MUSIC_TOGGLE = 12,
93 BOB_INFO_BOX = 13
94 };
95
96 enum {
97 FRAME_BLUE_1 = 1,
98 FRAME_BLUE_2 = 2,
99 FRAME_ORANGE = 3,
100 FRAME_GREY = 5,
101 FRAME_CHECK_BOX = 16,
102 FRAME_BLUE_PIN = 18,
103 FRAME_GREEN_PIN = 19,
104 FRAME_INFO_BOX = 20
105 };
106
107 enum {
108 TXT_CLOSE = 30,
109 TXT_GIVE_UP = 31,
110 TXT_MAKE_ENTRY = 32,
111 TXT_REVIEW_ENTRY = 33,
112 TXT_YES = 34,
113 TXT_NO = 35
114 };
115
116 enum {
117 NUM_SAVES_PER_PAGE = 10,
118 MAX_PANEL_TEXTS = 8,
119 MAX_ZONES = 31
120 };
121
122 enum PanelMode {
123 PM_NORMAL,
124 PM_INFO_BOX,
125 PM_YES_NO
126 };
127
128 enum QuitMode {
129 QM_LOOP,
130 QM_RESTORE,
131 QM_CONTINUE
132 };
133
134
135private:
136
137 void continueGame();
138
139 void setup();
140 void redraw();
141 void update();
142
143 void showBob(int bobNum, int16 x, int16 y, int frameNum);
144 void hideBob(int bobNum);
145
146 void drawSaveDescriptions();
147 void drawSaveSlot();
148
149 void enterYesNoPanelMode(int16 prevZoneNum, int titleNum);
150 void exitYesNoPanelMode();
151 void enterInfoPanelMode();
152 void exitInfoPanelMode();
153
154 void handleMouseWheel(int inc);
155 void handleMouseDown(int x, int y);
156 void handleKeyDown(uint16 ascii, int keycode);
157 void handleAction(Common::CustomEventType action);
158
159 void drawPanelText(int y, const char *text);
160 void drawCheckBox(bool active, int bobNum, int16 x, int16 y, int frameNum);
161 void drawSlideBar(int value, int maxValue, int bobNum, int16 y, int frameNum);
162 void drawPanel(const int *frames, const int *titles, int n);
163 void drawNormalPanel();
164 void drawYesNoPanel(int titleNum);
165 void drawConfigPanel();
166 void drawInfoPanel();
167
168 void initTextField(const char *desc);
169 void updateTextField(uint16 ascii, int keycode);
170 void closeTextField();
171
172 struct TextField {
173 bool enabled;
174 int posCursor;
175 uint textCharsCount;
176 char text[32];
177 int x, y;
178 int w, h;
179 };
180
181 struct Zone {
182 int num;
183 int16 x1, y1, x2, y2;
184 };
185
186 PanelMode _panelMode;
187 QuitMode _quitMode;
188
189 int _currentSavePage;
190 int _currentSaveSlot;
191
192 int _prevJoeX, _prevJoeY;
193
194 int _panelTextCount;
195 int _panelTextY[MAX_PANEL_TEXTS];
196 TextField _textField;
197 uint16 _prevZoneNum;
198 char _saveDescriptions[100][32];
199
200 OSystem *_system;
201 QueenEngine *_vm;
202
203 static const Zone _zones[MAX_ZONES];
204};
205
206} // End of namespace Queen
207
208#endif
Definition: system.h:166
Definition: journal.h:33
Definition: queen.h:87
uint32 CustomEventType
Definition: events.h:212
Definition: bankman.h:28