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 
27 class OSystem;
28 
29 namespace Queen {
30 
31 class QueenEngine;
32 
33 class Journal {
34 public:
35 
36  Journal(QueenEngine *vm);
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 
135 private:
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 
158  void drawPanelText(int y, const char *text);
159  void drawCheckBox(bool active, int bobNum, int16 x, int16 y, int frameNum);
160  void drawSlideBar(int value, int maxValue, int bobNum, int16 y, int frameNum);
161  void drawPanel(const int *frames, const int *titles, int n);
162  void drawNormalPanel();
163  void drawYesNoPanel(int titleNum);
164  void drawConfigPanel();
165  void drawInfoPanel();
166 
167  void initTextField(const char *desc);
168  void updateTextField(uint16 ascii, int keycode);
169  void closeTextField();
170 
171  struct TextField {
172  bool enabled;
173  int posCursor;
174  uint textCharsCount;
175  char text[32];
176  int x, y;
177  int w, h;
178  };
179 
180  struct Zone {
181  int num;
182  int16 x1, y1, x2, y2;
183  };
184 
185  PanelMode _panelMode;
186  QuitMode _quitMode;
187 
188  int _currentSavePage;
189  int _currentSaveSlot;
190 
191  int _prevJoeX, _prevJoeY;
192 
193  int _panelTextCount;
194  int _panelTextY[MAX_PANEL_TEXTS];
195  TextField _textField;
196  uint16 _prevZoneNum;
197  char _saveDescriptions[100][32];
198 
199  OSystem *_system;
200  QueenEngine *_vm;
201 
202  static const Zone _zones[MAX_ZONES];
203 };
204 
205 } // End of namespace Queen
206 
207 #endif
Definition: queen.h:62
Definition: journal.h:33
Definition: bankman.h:28
Definition: system.h:161