Ticket #8238: help.2.cpp

File help.2.cpp, 8.1 KB (added by SF/itsr0y, 21 years ago)

Revised scumm/help.cpp 2003-06-01

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/* TODO - 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("~", "Show / Hide console");
88 ADD_BIND("Ctrl d", "Start the debugger");
89 ADD_BIND("Ctrl s", "Show memory consumption");
90 ADD_BIND("Ctrl f", "Run in fast mode *");
91 ADD_BIND("Ctrl g", "Run in really fast mode *");
92 ADD_BIND("CtrlAlt 0-9", "Set graphics filter");
93 ADD_LINE;
94 ADD_LINE;
95 ADD_LINE;
96 ADD_LINE;
97 ADD_LINE;
98 ADD_TEXT("* Note that using ctrl-f and");
99 ADD_TEXT("ctrl-g are not recommended");
100 ADD_TEXT("since they may cause crashes.");
101 break;
102 case 3:
103 switch (gameId) {
104 case GID_ZAK:
105 case GID_ZAK256:
106 case GID_MANIAC:
107 title = "Main game controls:";
108 ADD_BIND("q", "Push");
109 ADD_BIND("a", "Pull");
110 ADD_BIND("z", "Give");
111 ADD_BIND("w", "Open");
112 ADD_BIND("s", "Close");
113 ADD_BIND("x", "Read");
114 ADD_BIND("e", "Walk to");
115 ADD_BIND("d", "Pick up");
116 ADD_BIND("c", "What is");
117 if (gameId == GID_ZAK || gameId == GID_ZAK256) {
118 ADD_BIND("r", "Put on");
119 ADD_BIND("f", "Take off");
120 } else {
121 ADD_BIND("r", "New kid");
122 ADD_BIND("f", "Unlock");
123 }
124 ADD_BIND("v", "Use");
125 ADD_BIND("t", "Turn on");
126 ADD_BIND("g", "Turn off");
127 break;
128 case GID_INDY3:
129 case GID_INDY3_256:
130 title = "Main game controls:";
131 ADD_BIND("q", "Push");
132 ADD_BIND("a", "Pull");
133 ADD_BIND("z", "Give");
134 ADD_BIND("w", "Open");
135 ADD_BIND("s", "Close");
136 ADD_BIND("x", "Look");
137 ADD_BIND("e", "Walk to");
138 ADD_BIND("d", "Pick up");
139 ADD_BIND("c", "What is");
140 ADD_BIND("r", "Use");
141 ADD_BIND("f", "Turn on");
142 ADD_BIND("v", "Turn off");
143 ADD_BIND("t", "Talk");
144 ADD_BIND("g", "Travel");
145 break;
146 case GID_LOOM:
147 case GID_LOOM256:
148 title = "Spinning drafts on the keyboard:";
149 ADD_BIND("q, c", "a C key on a piano");
150 ADD_BIND("w, d", "a D key on a piano");
151 ADD_BIND("e, e", "a E key on a piano");
152 ADD_BIND("r, f", "a F key on a piano");
153 ADD_BIND("t, g", "a G key on a piano");
154 ADD_BIND("y, a", "a A key on a piano");
155 ADD_BIND("u, b", "a B key on a piano");
156 ADD_BIND("i, C", "a C note with stem down");
157 break;
158 case GID_MONKEY_EGA:
159 case GID_MONKEY_VGA:
160 title = "Main game controls:";
161 ADD_BIND("o", "Open");
162 ADD_BIND("c", "Close");
163 ADD_BIND("s", "puSh");
164 ADD_BIND("y", "pull (Yank)");
165 ADD_BIND("w", "Walk to");
166 ADD_BIND("p", "Pick up");
167 ADD_BIND("t", "Talk to");
168 ADD_BIND("g", "Give");
169 ADD_BIND("u", "Use");
170 ADD_BIND("l", "Look at");
171 ADD_BIND("n", "turn oN");
172 ADD_BIND("f", "turn oFf");
173 break;
174 case GID_MONKEY:
175 case GID_MONKEY2:
176 case GID_INDY4:
177 case GID_TENTACLE:
178 title = "Main game controls:";
179 ADD_BIND("g", "Give");
180 ADD_BIND("o", "Open");
181 ADD_BIND("c", "Close");
182 ADD_BIND("p", "Pick up");
183 ADD_BIND("l", "Look at");
184 ADD_BIND("t", "Talk to");
185 ADD_BIND("u", "Use");
186 ADD_BIND("s", "puSh");
187 ADD_BIND("y", "pull (Yank)");
188 break;
189 case GID_SAMNMAX:
190 title = "Main game controls:";
191 ADD_BIND("w", "Walk");
192 ADD_BIND("t", "Talk");
193 ADD_BIND("u", "Use");
194 ADD_BIND("i", "Inventory");
195 ADD_BIND("o", "Object");
196 ADD_BIND("p", "Pick up");
197 ADD_BIND("l", "Look");
198 ADD_BIND("b", "Black and White / Color");
199 break;
200 case GID_DIG:
201 title = "Main game controls:";
202 ADD_BIND("e", "Examine");
203 ADD_BIND("t", "Regular cursor");
204 ADD_BIND("i", "Inventory");
205 ADD_BIND("c", "Comm");
206 break;
207 case GID_FT:
208 title = "Main game controls:";
209 ADD_BIND("e", "Eyes");
210 ADD_BIND("t", "Tongue");
211 ADD_BIND("i", "Inventory");
212 ADD_BIND("p", "Punch");
213 ADD_BIND("k", "Kick");
214 break;
215 case GID_CMI:
216 title = "Main game controls:";
217 ADD_BIND("e", "Examine");
218 ADD_BIND("t", "Talk to");
219 ADD_BIND("i", "Inventory");
220 ADD_BIND("u", "Use");
221 break;
222 }
223 break;
224 case 4:
225 switch (gameId) {
226 case GID_MANIAC:
227 case GID_ZAK:
228 case GID_ZAK256:
229 title = "Main game controls:";
230 if (gameId == GID_ZAK || gameId == GID_ZAK256) {
231 ADD_BIND("b", "Switch");
232 } else {
233 ADD_BIND("b", "Fix");
234 }
235 ADD_LINE;
236 ADD_TEXT("Inventory Controls (not implemented):");
237 ADD_BIND("u", "Scroll list up");
238 ADD_BIND("j", "Scroll list down");
239 ADD_BIND("i", "Upper left item");
240 ADD_BIND("k", "Lower left item");
241 ADD_BIND("o", "Upper right item");
242 ADD_BIND("l", "Lower right item");
243 break;
244 case GID_INDY3:
245 case GID_INDY3_256:
246 title = "Main game controls:";
247 ADD_BIND("b", "To Henry / To Indy");
248 ADD_LINE;
249 ADD_TEXT("Inventory Controls:");
250 ADD_BIND("y", "Upper left item");
251 ADD_BIND("h", "Middle left item");
252 ADD_BIND("n", "Lower left item");
253 ADD_BIND("u", "Upper right item");
254 ADD_BIND("j", "Middle right item");
255 ADD_BIND("m", "Lower right item");
256 ADD_BIND("o", "Scroll list up");
257 ADD_BIND("l", "Scroll list down");
258 break;
259 }
260 break;
261 case 5:
262 switch (gameId) {
263 case GID_INDY3:
264 case GID_INDY3_256:
265 title = "Fighting controls (numpad):";
266 ADD_BIND("7", "Step back");
267 ADD_BIND("4", "Step back");
268 ADD_BIND("1", "Step back");
269 ADD_BIND("8", "Block high");
270 ADD_BIND("5", "Block middle");
271 ADD_BIND("2", "Block low");
272 ADD_BIND("9", "Punch high");
273 ADD_BIND("6", "Punch middle");
274 ADD_BIND("3", "Punch low");
275 ADD_LINE;
276 ADD_TEXT("These are for Indy on left.");
277 ADD_TEXT("When Indy is on the right,");
278 ADD_TEXT("7, 4, and 1 are switched with");
279 ADD_TEXT("9, 6, and 3, respectively.");
280 break;
281 }
282 break;
283 case 6:
284 switch (gameId) {
285 case GID_INDY3:
286 case GID_INDY3_256:
287 title = "Biplane controls (numpad):";
288 ADD_BIND("7", "Fly to upper left");
289 ADD_BIND("4", "Fly to left");
290 ADD_BIND("1", "Fly to lower left");
291 ADD_BIND("8", "Fly upwards");
292 ADD_BIND("5", "Fly straight");
293 ADD_BIND("2", "Fly down");
294 ADD_BIND("9", "Fly to upper right");
295 ADD_BIND("6", "Fly to right");
296 ADD_BIND("3", "Fly to lower right");
297 break;
298 }
299 break;
300 }
301 while (i < HELP_NUM_LINES) {
302 ADD_LINE;
303 }
304}
305
306#undef ADD_BIND
307#undef ADD_TEXT
308#undef ADD_LINE
309