Ticket #8238: help.3.cpp

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

Revised scumm/help.cpp 2003-06-02

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, Ctrl q", "Quit");
77 ADD_BIND("Alt Enter", "Toggle fullscreen");
78 ADD_BIND("[, ]", "Music volume up / down");
79 ADD_BIND("-, +", "Text speed slower / faster");
80 ADD_BIND("Enter", "Simulate left mouse button");
81 ADD_BIND("Tab", "Simulate right mouse button");
82 ADD_BIND("Arrow Keys", "Simulate mouse movement");
83 break;
84 case 2:
85 title = "Special keyboard commands:";
86 ADD_BIND("~", "Show / Hide console");
87 ADD_BIND("Ctrl d", "Start the debugger");
88 ADD_BIND("Ctrl s", "Show memory consumption");
89 ADD_BIND("Ctrl f", "Run in fast mode *");
90 ADD_BIND("Ctrl g", "Run in really fast mode *");
91 ADD_BIND("Ctrl Alt 0-9", "Set graphics filter");
92 ADD_LINE;
93 ADD_LINE;
94 ADD_LINE;
95 ADD_LINE;
96 ADD_LINE;
97 ADD_TEXT("* Note that using ctrl-f and");
98 ADD_TEXT("ctrl-g are not recommended");
99 ADD_TEXT("since they may cause crashes.");
100 break;
101 case 3:
102 switch (gameId) {
103 case GID_ZAK:
104 case GID_ZAK256:
105 case GID_MANIAC:
106 title = "Main game controls:";
107 ADD_BIND("q", "Push");
108 ADD_BIND("a", "Pull");
109 ADD_BIND("z", "Give");
110 ADD_BIND("w", "Open");
111 ADD_BIND("s", "Close");
112 ADD_BIND("x", "Read");
113 ADD_BIND("e", "Walk to");
114 ADD_BIND("d", "Pick up");
115 ADD_BIND("c", "What is");
116 if (gameId == GID_ZAK || gameId == GID_ZAK256) {
117 ADD_BIND("r", "Put on");
118 ADD_BIND("f", "Take off");
119 } else {
120 ADD_BIND("r", "New kid");
121 ADD_BIND("f", "Unlock");
122 }
123 ADD_BIND("v", "Use");
124 ADD_BIND("t", "Turn on");
125 ADD_BIND("g", "Turn off");
126 break;
127 case GID_INDY3:
128 case GID_INDY3_256:
129 title = "Main game controls:";
130 ADD_BIND("q", "Push");
131 ADD_BIND("a", "Pull");
132 ADD_BIND("z", "Give");
133 ADD_BIND("w", "Open");
134 ADD_BIND("s", "Close");
135 ADD_BIND("x", "Look");
136 ADD_BIND("e", "Walk to");
137 ADD_BIND("d", "Pick up");
138 ADD_BIND("c", "What is");
139 ADD_BIND("r", "Use");
140 ADD_BIND("f", "Turn on");
141 ADD_BIND("v", "Turn off");
142 ADD_BIND("t", "Talk");
143 ADD_BIND("g", "Travel");
144 break;
145 case GID_LOOM:
146 case GID_LOOM256:
147 title = "Spinning drafts on the keyboard:";
148 ADD_BIND("q, c", "a C key on a piano");
149 ADD_BIND("w, d", "a D key on a piano");
150 ADD_BIND("e, e", "a E key on a piano");
151 ADD_BIND("r, f", "a F key on a piano");
152 ADD_BIND("t, g", "a G key on a piano");
153 ADD_BIND("y, a", "a A key on a piano");
154 ADD_BIND("u, b", "a B key on a piano");
155 ADD_BIND("i, C", "a C note with stem down");
156 break;
157 case GID_MONKEY_EGA:
158 case GID_MONKEY_VGA:
159 title = "Main game controls:";
160 ADD_BIND("o", "Open");
161 ADD_BIND("c", "Close");
162 ADD_BIND("s", "puSh");
163 ADD_BIND("y", "pull (Yank)");
164 ADD_BIND("w", "Walk to");
165 ADD_BIND("p", "Pick up");
166 ADD_BIND("t", "Talk to");
167 ADD_BIND("g", "Give");
168 ADD_BIND("u", "Use");
169 ADD_BIND("l", "Look at");
170 ADD_BIND("n", "turn oN");
171 ADD_BIND("f", "turn oFf");
172 break;
173 case GID_MONKEY:
174 case GID_MONKEY2:
175 case GID_INDY4:
176 case GID_TENTACLE:
177 title = "Main game controls:";
178 ADD_BIND("g", "Give");
179 ADD_BIND("o", "Open");
180 ADD_BIND("c", "Close");
181 ADD_BIND("p", "Pick up");
182 ADD_BIND("l", "Look at");
183 ADD_BIND("t", "Talk to");
184 ADD_BIND("u", "Use");
185 ADD_BIND("s", "puSh");
186 ADD_BIND("y", "pull (Yank)");
187 break;
188 case GID_SAMNMAX:
189 title = "Main game controls:";
190 ADD_BIND("w", "Walk");
191 ADD_BIND("t", "Talk");
192 ADD_BIND("u", "Use");
193 ADD_BIND("i", "Inventory");
194 ADD_BIND("o", "Object");
195 ADD_BIND("p", "Pick up");
196 ADD_BIND("l", "Look");
197 ADD_BIND("b", "Black and White / Color");
198 break;
199 case GID_FT:
200 title = "Main game controls:";
201 ADD_BIND("e", "Eyes");
202 ADD_BIND("t", "Tongue");
203 ADD_BIND("i", "Inventory");
204 ADD_BIND("p", "Punch");
205 ADD_BIND("k", "Kick");
206 break;
207 case GID_DIG:
208 title = "Main game controls:";
209 ADD_BIND("e", "Examine");
210 ADD_BIND("t", "Regular cursor");
211 ADD_BIND("i", "Inventory");
212 ADD_BIND("c", "Comm");
213 break;
214 case GID_CMI:
215 title = "Main game controls:";
216 ADD_BIND("F1", "Save / Load / Options");
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