Ticket #8238: help.cpp

File help.cpp, 8.2 KB (added by SF/itsr0y, 18 years ago)

scumm/help.cpp

Line 
1/* ScummVM - Scumm Interpreter
2 * Copyright (C) 2002-2003 The ScummVM project
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 *
18 */
19
20#include "stdafx.h"
21#include "help.h"
22#include "scumm.h"
23#include "common/str.h"
24
25int ScummHelp::numPages(byte gameId) {
26 switch (gameId) {
27 case GID_MANIAC:
28 case GID_ZAK:
29 case GID_ZAK256:
30 return 4;
31 break;
32 case GID_INDY3:
33 case GID_INDY3_256:
34 return 6;
35 break;
36 case GID_LOOM:
37 case GID_LOOM256:
38 case GID_MONKEY_EGA:
39 case GID_MONKEY_VGA:
40 case GID_MONKEY:
41 case GID_MONKEY2:
42 case GID_INDY4:
43 case GID_TENTACLE:
44 case GID_SAMNMAX:
45 case GID_DIG:
46 case GID_FT:
47 case GID_CMI:
48 return 3;
49 break;
50/* FIXME - I don't know the controls for these games
51 case GID_PUTTDEMO:
52*/
53 default:
54 return 2;
55 }
56}
57
58#define ADD_BIND(k,d) key[i] = k; dsc[i] = d; i++;
59#define ADD_TEXT(d) ADD_BIND("",d)
60#define ADD_LINE ADD_BIND("","")
61
62void ScummHelp::updateStrings(byte gameId, int page, String &title,
63 String *&key, String *&dsc) {
64 key = new String[HELP_NUM_LINES];
65 dsc = new String[HELP_NUM_LINES];
66 int i = 0;
67 switch (page) {
68 case 1:
69 title = "Common keyboard commands:";
70 ADD_BIND("F5", "Save / Load dialog");
71 ADD_BIND(".", "Skip line of text");
72 ADD_BIND("Esc", "Skip cutscene");
73 ADD_BIND("Space", "Pause game");
74 ADD_BIND("Ctrl 0-9", "Load game state 1-10");
75 ADD_BIND("Alt 0-9", "Save game state 1-10");
76 ADD_BIND("Alt x", "Quit");
77 ADD_BIND("Ctrl q", "Quit");
78 ADD_BIND("Alt Enter", "Toggle fullscreen");
79 ADD_BIND("[, ]", "Music volume up / down");
80 ADD_BIND("-, +", "Text Speed slower / faster");
81 ADD_BIND("Enter", "Simulate left mouse button");
82 ADD_BIND("Tab", "Simulate right mouse button");
83 ADD_BIND("Arrow Keys", "Simulate mouse movement");
84 break;
85 case 2:
86 title = "Special keyboard commands:";
87 ADD_BIND("Tilde", "Show / Hide console");
88 // FIXME '~' does not print
89 ADD_BIND("Ctrl d", "Start the debugger");
90 ADD_BIND("Ctrl s", "Show memory consumption");
91 ADD_BIND("Ctrl f", "Run in fast mode *");
92 ADD_BIND("Ctrl g", "Run in really fast mode *");
93 ADD_BIND("Ctrl Alt #", "Set graphics filter");
94 ADD_LINE;
95 ADD_LINE;
96 ADD_LINE;
97 ADD_LINE;
98 ADD_LINE;
99 ADD_TEXT("* Note that using ctrl-f and");
100 ADD_TEXT("ctrl-g are not recommended");
101 ADD_TEXT("since it may cause crashes.");
102 break;
103 case 3:
104 switch (gameId) {
105 case GID_ZAK:
106 case GID_ZAK256:
107 case GID_MANIAC:
108 title = "Main game controls:";
109 ADD_BIND("q", "Push");
110 ADD_BIND("a", "Pull");
111 ADD_BIND("z", "Give");
112 ADD_BIND("w", "Open");
113 ADD_BIND("s", "Close");
114 ADD_BIND("x", "Read");
115 ADD_BIND("e", "Walk to");
116 ADD_BIND("d", "Pick up");
117 ADD_BIND("c", "What is");
118 if (gameId == GID_ZAK || gameId == GID_ZAK256) {
119 ADD_BIND("r", "Put on");
120 ADD_BIND("f", "Take off");
121 } else {
122 ADD_BIND("r", "New kid");
123 ADD_BIND("f", "Unlock");
124 }
125 ADD_BIND("v", "Use");
126 ADD_BIND("t", "Turn on");
127 ADD_BIND("g", "Turn off");
128 break;
129 case GID_INDY3:
130 case GID_INDY3_256:
131 title = "Main game controls:";
132 ADD_BIND("q", "Push");
133 ADD_BIND("a", "Pull");
134 ADD_BIND("z", "Give");
135 ADD_BIND("w", "Open");
136 ADD_BIND("s", "Close");
137 ADD_BIND("x", "Look");
138 ADD_BIND("e", "Walk to");
139 ADD_BIND("d", "Pick up");
140 ADD_BIND("c", "What is");
141 ADD_BIND("r", "Use");
142 ADD_BIND("f", "Turn on");
143 ADD_BIND("v", "Turn off");
144 ADD_BIND("t", "Talk");
145 ADD_BIND("g", "Travel");
146 break;
147 case GID_LOOM:
148 case GID_LOOM256:
149 title = "Spinning drafts on the keyboard:";
150 ADD_BIND("q, c", "a C key on a piano");
151 ADD_BIND("w, d", "a D key on a piano");
152 ADD_BIND("e, e", "a E key on a piano");
153 ADD_BIND("r, f", "a F key on a piano");
154 ADD_BIND("t, g", "a G key on a piano");
155 ADD_BIND("y, a", "a A key on a piano");
156 ADD_BIND("u, b", "a B key on a piano");
157 ADD_BIND("i, C", "a C note with stem down");
158 break;
159 case GID_MONKEY_EGA:
160 case GID_MONKEY_VGA:
161 title = "Main game controls:";
162 ADD_BIND("o", "Open");
163 ADD_BIND("c", "Close");
164 ADD_BIND("s", "puSh");
165 ADD_BIND("y", "pull (Yank)");
166 ADD_BIND("w", "Walk to");
167 ADD_BIND("p", "Pick up");
168 ADD_BIND("t", "Talk to");
169 ADD_BIND("g", "Give");
170 ADD_BIND("u", "Use");
171 ADD_BIND("l", "Look at");
172 ADD_BIND("n", "turn oN");
173 ADD_BIND("f", "turn oFf");
174 break;
175 case GID_MONKEY:
176 case GID_MONKEY2:
177 case GID_INDY4:
178 case GID_TENTACLE:
179 title = "Main game controls:";
180 ADD_BIND("g", "Give");
181 ADD_BIND("o", "Open");
182 ADD_BIND("c", "Close");
183 ADD_BIND("p", "Pick up");
184 ADD_BIND("l", "Look at");
185 ADD_BIND("t", "Talk to");
186 ADD_BIND("u", "Use");
187 ADD_BIND("s", "puSh");
188 ADD_BIND("y", "pull (Yank)");
189 break;
190 case GID_SAMNMAX:
191 title = "Main game controls:";
192 ADD_BIND("w", "Walk");
193 ADD_BIND("t", "Talk");
194 ADD_BIND("u", "Use");
195 ADD_BIND("i", "Inventory");
196 ADD_BIND("o", "Object");
197 ADD_BIND("p", "Pick up");
198 ADD_BIND("l", "Look");
199 ADD_BIND("b", "Black and White / Color");
200 break;
201 case GID_DIG:
202 title = "Main game controls:";
203 ADD_BIND("e", "Examine");
204 ADD_BIND("t", "Regular cursor");
205 ADD_BIND("i", "Inventory");
206 ADD_BIND("c", "Comm");
207 break;
208 case GID_FT:
209 title = "Main game controls:";
210 ADD_BIND("e", "Eyes");
211 ADD_BIND("t", "Tongue");
212 ADD_BIND("i", "Inventory");
213 ADD_BIND("p", "Punch");
214 ADD_BIND("k", "Kick");
215 break;
216 case GID_CMI:
217 title = "Main game controls:";
218 ADD_BIND("e", "Examine");
219 ADD_BIND("t", "Talk to");
220 ADD_BIND("i", "Inventory");
221 ADD_BIND("u", "Use");
222 break;
223 }
224 break;
225 case 4:
226 switch (gameId) {
227 case GID_MANIAC:
228 case GID_ZAK:
229 case GID_ZAK256:
230 title = "Main game controls:";
231 if (gameId == GID_ZAK || gameId == GID_ZAK256) {
232 ADD_BIND("b", "Switch");
233 } else {
234 ADD_BIND("b", "Fix");
235 }
236 ADD_LINE;
237 ADD_TEXT("Inventory Controls (not implemented):");
238 ADD_BIND("u", "Scroll list up");
239 ADD_BIND("j", "Scroll list down");
240 ADD_BIND("i", "Upper left item");
241 ADD_BIND("k", "Lower left item");
242 ADD_BIND("o", "Upper right item");
243 ADD_BIND("l", "Lower right item");
244 break;
245 case GID_INDY3:
246 case GID_INDY3_256:
247 title = "Main game controls:";
248 ADD_BIND("b", "To Henry / To Indy");
249 ADD_LINE;
250 ADD_TEXT("Inventory Controls:");
251 ADD_BIND("y", "Upper left item");
252 ADD_BIND("h", "Middle left item");
253 ADD_BIND("n", "Lower left item");
254 ADD_BIND("u", "Upper right item");
255 ADD_BIND("j", "Middle right item");
256 ADD_BIND("m", "Lower right item");
257 ADD_BIND("o", "Scroll list up");
258 ADD_BIND("l", "Scroll list down");
259 break;
260 }
261 break;
262 case 5:
263 switch (gameId) {
264 case GID_INDY3:
265 case GID_INDY3_256:
266 title = "Fighting controls (numpad):";
267 ADD_BIND("7", "Step back");
268 ADD_BIND("4", "Step back");
269 ADD_BIND("1", "Step back");
270 ADD_BIND("8", "Block high");
271 ADD_BIND("5", "Block middle");
272 ADD_BIND("2", "Block low");
273 ADD_BIND("9", "Punch high");
274 ADD_BIND("6", "Punch middle");
275 ADD_BIND("3", "Punch low");
276 ADD_LINE;
277 ADD_TEXT("These are for Indy on left.");
278 ADD_TEXT("When Indy is on the right,");
279 ADD_TEXT("7, 4, and 1 are switched with");
280 ADD_TEXT("9, 6, and 3, respectively.");
281 break;
282 }
283 break;
284 case 6:
285 switch (gameId) {
286 case GID_INDY3:
287 case GID_INDY3_256:
288 title = "Biplane controls (numpad):";
289 ADD_BIND("7", "Fly to upper left");
290 ADD_BIND("4", "Fly to left");
291 ADD_BIND("1", "Fly to lower left");
292 ADD_BIND("8", "Fly upwards");
293 ADD_BIND("5", "Fly straight");
294 ADD_BIND("2", "Fly down");
295 ADD_BIND("9", "Fly to upper right");
296 ADD_BIND("6", "Fly to right");
297 ADD_BIND("3", "Fly to lower right");
298 break;
299 }
300 break;
301 }
302 while (i < HELP_NUM_LINES) {
303 ADD_LINE;
304 }
305}
306
307#undef ADD_BIND
308#undef ADD_TEXT
309#undef ADD_LINE
310