aboutsummaryrefslogtreecommitdiff
path: root/engines/pink/gui.cpp
blob: 5267cbb5401713aa8c1b65c2760aab4cec46e306 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
/* ScummVM - Graphic Adventure Engine
 *
 * ScummVM is the legal property of its developers, whose names
 * are too numerous to list here. Please refer to the COPYRIGHT
 * file distributed with this source distribution.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 */

#include "graphics/macgui/macwindowmanager.h"
#include "graphics/macgui/macmenu.h"

#include "pink/pink.h"
#include "pink/director.h"
#include "pink/objects/actors/lead_actor.h"

namespace Pink {

enum {
	kNewGameAction			= 57600,
	kLoadSave				= 57601,
	kSaveAction				= 57603,
	kSaveAsAction			= 57604,
	kSongsAction			= 32865,
	kSoundSettingsAction	= 32772,
	kLastSavesAction		= 57616,
	kPauseAction			= 32854,
	kExitAction				= 57665
};

enum {
	kShowContent	= 32771,
	kShowGreece		= 32866,
	kShowIndonesia  = 32867,
	kShowIsrael		= 32868,
	kShowKenya		= 32869,
	kShowRussia		= 32870
};

enum {
	kShowPDAAction			= 32793,

	kShowAustraliaArt		= 32796,
	kShowAustraliaCloth		= 32797,
	kShowAustraliaFood		= 32798,
	kShowAustraliaHistory	= 32799,
	kShowAustraliaNature	= 32800,
	kShowAustraliaPeople	= 32801,
	kShowAustraliaPlaces	= 32802,
	kShowAustraliaReligion	= 32803,

	kShowBhutanArt			= 32804,
	kShowBhutanCloth		= 32805,
	kShowBhutanFood			= 32806,
	kShowBhutanHistory		= 32807,
	kShowBhutanNature		= 32808,
	kShowBhutanPeople		= 32809,
	kShowBhutanPlaces		= 32810,
	kShowBhutanReligion		= 32811,

	kShowChinaArt 			= 32812,
	kShowChinaCloth			= 32813,
	kShowChinaFood			= 32814,
	kShowChinaHistory		= 32815,
	kShowChinaNature		= 32816,
	kShowChinaPeople		= 32817,
	kShowChinaPlaces		= 32818,
	kShowChinaReligion		= 32819,

	kShowEnglandArt			= 32820,
	kShowEnglandCloth		= 32821,
	kShowEnglandFood		= 32822,
	kShowEnglandHistory		= 32823,
	kShowEnglandNature		= 32824,
	kShowEnglandPeople		= 32825,
	kShowEnglandPlaces		= 32826,
	kShowEnglandReligion	= 32827,

	kShowEgyptArt			= 32828,
	kShowEgyptCloth			= 32829,
	kShowEgyptFood			= 32830,
	kShowEgyptHistory		= 32831,
	kShowEgyptNature		= 32832,
	kShowEgyptPeople		= 32833,
	kShowEgyptPlaces		= 32834,
	kShowEgyptReligion		= 32835,

	kShowIndiaArt			= 32836,
	kShowIndiaCloth			= 32837,
	kShowIndiaFood			= 32838,
	kShowIndiaHistory		= 32839,
	kShowIndiaNature		= 32840,
	kShowIndiaPeople		= 32841,
	kShowIndiaPlaces		= 32842,
	kShowIndiaReligion		= 32843
};

enum {
	kShowGameWebPage			= 32844,
	kShowTechSupport			= 32778,
	kShowOnlineHints			= 32777,
	kShowWanderLustWebPage		= 32775,
	kShowHelp					= 32846,
	kShowHints					= 32847,

	kShowWinnnerPage			= 32779,
	kShowWanderlustInteractive	= 32849,
	kShowMGM					= 32848,
	kShowDiagnostics			= 32850,
	kShowAbout					= 57664
};

static void menuCommandsCallback(int action, Common::U32String &, void *data) {
	PinkEngine *engine = (PinkEngine *)data;

	engine->executeMenuCommand(action);
}

void PinkEngine::initMenu(Common::PEResources &exeResources) {
	_director->getWndManager().setEnginePauseCallback(this, &pauseEngine);

	_menu = Graphics::MacMenu::createMenuFromPEexe(exeResources, &_director->getWndManager());
	_menu->calcDimensions();
	_menu->setCommandsCallback(&menuCommandsCallback, this);
}

void PinkEngine::executeMenuCommand(uint id) {
	switch (id) {
	case kNewGameAction: {
		const Common::String moduleName = _modules[0]->getName();
		initModule(moduleName, "", nullptr);
		break;
	}
	case kLoadSave:
	case kSaveAction:
	case kSaveAsAction:
	case kSoundSettingsAction:
	case kLastSavesAction:
	case kPauseAction:
	case kExitAction:
		openMainMenuDialog();
		break;
	case kSongsAction:
		initModule("Muzik", "", nullptr);
		break;

	case kShowPDAAction:
		_actor->loadPDA(kNavigatePage);
		break;

	case kShowAustraliaArt:
		_actor->loadPDA("AUSART");
		break;
	case kShowAustraliaCloth:
		_actor->loadPDA("AUSCLO");
		break;
	case kShowAustraliaFood:
		_actor->loadPDA("AUSFOO");
		break;
	case kShowAustraliaHistory:
		_actor->loadPDA("AUSHIS");
		break;
	case kShowAustraliaNature:
		_actor->loadPDA("AUSNAT");
		break;
	case kShowAustraliaPeople:
		_actor->loadPDA("AUSPEO");
		break;
	case kShowAustraliaPlaces:
		_actor->loadPDA("AUSPLA");
		break;
	case kShowAustraliaReligion:
		_actor->loadPDA("AUSREL");
		break;

	case kShowBhutanArt:
		_actor->loadPDA("BHUART");
		break;
	case kShowBhutanCloth:
		_actor->loadPDA("BHUCLO");
		break;
	case kShowBhutanFood:
		_actor->loadPDA("BHUFOO");
		break;
	case kShowBhutanHistory:
		_actor->loadPDA("BHUHIS");
		break;
	case kShowBhutanNature:
		_actor->loadPDA("BHUNAT");
		break;
	case kShowBhutanPeople:
		_actor->loadPDA("BHUPEO");
		break;
	case kShowBhutanPlaces:
		_actor->loadPDA("BHUPLA");
		break;
	case kShowBhutanReligion:
		_actor->loadPDA("BHUREL");
		break;

	case kShowChinaArt:
		_actor->loadPDA("CHIART");
		break;
	case kShowChinaCloth:
		_actor->loadPDA("CHICLO");
		break;
	case kShowChinaFood:
		_actor->loadPDA("CHIFOO");
		break;
	case kShowChinaHistory:
		_actor->loadPDA("CHIHIS");
		break;
	case kShowChinaNature:
		_actor->loadPDA("CHINAT");
		break;
	case kShowChinaPeople:
		_actor->loadPDA("CHIPEO");
		break;
	case kShowChinaPlaces:
		_actor->loadPDA("CHIPLA");
		break;
	case kShowChinaReligion:
		_actor->loadPDA("CHIREL");
		break;

	case kShowEnglandArt:
		_actor->loadPDA("BRIART");
		break;
	case kShowEnglandCloth:
		_actor->loadPDA("BRICLO");
		break;
	case kShowEnglandFood:
		_actor->loadPDA("BRIFOO");
		break;
	case kShowEnglandHistory:
		_actor->loadPDA("BRIHIS");
		break;
	case kShowEnglandNature:
		_actor->loadPDA("BRINAT");
		break;
	case kShowEnglandPeople:
		_actor->loadPDA("BRIPEO");
		break;
	case kShowEnglandPlaces:
		_actor->loadPDA("BRIPLA");
		break;
	case kShowEnglandReligion:
		_actor->loadPDA("BRIREL");
		break;

	case kShowEgyptArt:
		_actor->loadPDA("BRIART");
		break;
	case kShowEgyptCloth:
		_actor->loadPDA("BRICLO");
		break;
	case kShowEgyptFood:
		_actor->loadPDA("BRIFOO");
		break;
	case kShowEgyptHistory:
		_actor->loadPDA("BRIHIS");
		break;
	case kShowEgyptNature:
		_actor->loadPDA("BRINAT");
		break;
	case kShowEgyptPeople:
		_actor->loadPDA("BRIPEO");
		break;
	case kShowEgyptPlaces:
		_actor->loadPDA("BRIPLA");
		break;
	case kShowEgyptReligion:
		_actor->loadPDA("BRIREL");
		break;

	case kShowIndiaArt:
		_actor->loadPDA("INDART");
		break;
	case kShowIndiaCloth:
		_actor->loadPDA("INDCLO");
		break;
	case kShowIndiaFood:
		_actor->loadPDA("INDFOO");
		break;
	case kShowIndiaHistory:
		_actor->loadPDA("INDHIS");
		break;
	case kShowIndiaNature:
		_actor->loadPDA("INDNAT");
		break;
	case kShowIndiaPeople:
		_actor->loadPDA("INDPEO");
		break;
	case kShowIndiaPlaces:
		_actor->loadPDA("INDPLA");
		break;
	case kShowIndiaReligion:
		_actor->loadPDA("INDREL");
		break;

	case kShowContent:
		_actor->loadPDA("TOC");
		break;
	case kShowGreece:
		_actor->loadPDA("GREOVER");
		break;
	case kShowIndonesia:
		_actor->loadPDA("INDOVER");
		break;
	case kShowIsrael:
		_actor->loadPDA("ISROVER");
		break;
	case kShowKenya:
		_actor->loadPDA("KENOVER");
		break;
	case kShowRussia:
		_actor->loadPDA("SIBOVER");
		break;

	default:
		warning("Unprocessed command id %d", id);
		break;
	}
}

} // End of namespace Pink