git repos / blockattack-game

blame: source/code/menudef.cpp

normal view · raw

593aeae4 sago007 2011-06-25 22:42 1
/*
af35c39d sago007 2013-11-16 16:37 2
===========================================================================
af35c39d sago007 2013-11-16 16:37 3
blockattack - Block Attack - Rise of the Blocks
af35c39d sago007 2013-11-16 16:37 4
Copyright (C) 2005-2013 Poul Sander
af35c39d sago007 2013-11-16 16:37 5
af35c39d sago007 2013-11-16 16:37 6
This program is free software: you can redistribute it and/or modify
af35c39d sago007 2013-11-16 16:37 7
it under the terms of the GNU General Public License as published by
af35c39d sago007 2013-11-16 16:37 8
the Free Software Foundation, either version 2 of the License, or
af35c39d sago007 2013-11-16 16:37 9
(at your option) any later version.
af35c39d sago007 2013-11-16 16:37 10
af35c39d sago007 2013-11-16 16:37 11
This program is distributed in the hope that it will be useful,
af35c39d sago007 2013-11-16 16:37 12
but WITHOUT ANY WARRANTY; without even the implied warranty of
af35c39d sago007 2013-11-16 16:37 13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
af35c39d sago007 2013-11-16 16:37 14
GNU General Public License for more details.
af35c39d sago007 2013-11-16 16:37 15
af35c39d sago007 2013-11-16 16:37 16
You should have received a copy of the GNU General Public License
af35c39d sago007 2013-11-16 16:37 17
along with this program.  If not, see http://www.gnu.org/licenses/
af35c39d sago007 2013-11-16 16:37 18
af35c39d sago007 2013-11-16 16:37 19
Source information and contacts persons can be found at
021de090 sago007 2015-12-30 18:56 20
http://blockattack.net
af35c39d sago007 2013-11-16 16:37 21
===========================================================================
593aeae4 sago007 2011-06-25 22:42 22
*/
26ddb424 sago007 2011-06-09 20:06 23
#include "global.hpp"
26ddb424 sago007 2011-06-09 20:06 24
#include <iostream>
26ddb424 sago007 2011-06-09 20:06 25
#include <stdlib.h>
26ddb424 sago007 2011-06-09 20:06 26
#include "MenuSystem.h"
c9dd376f sago007 2012-01-20 17:13 27
#include "common.h"
d8fe60bd sago007 2018-04-02 16:15 28
#include "HelpHowtoState.hpp"
54d2d583 sago007 2018-04-05 17:52 29
#include "HelpGamepadState.hpp"
26ddb424 sago007 2011-06-09 20:06 30
96eb7a16 sago007 2016-04-29 17:01 31
using std::string;
96eb7a16 sago007 2016-04-29 17:01 32
using std::cerr;
3478201d sago007 2016-06-04 14:44 33
using std::cout;
96eb7a16 sago007 2016-04-29 17:01 34
using std::vector;
26ddb424 sago007 2011-06-09 20:06 35
3838c95c sago007 2016-01-23 10:47 36
#if 0
26ddb424 sago007 2011-06-09 20:06 37
//Menu
ecef5838 sago007 2015-11-24 20:01 38
static void PrintHi(Button* b) {
161a010c sago007 2016-05-06 14:00 39
	cout << "Hi" <<"\n";
26ddb424 sago007 2011-06-09 20:06 40
}
3838c95c sago007 2016-01-23 10:47 41
#endif
26ddb424 sago007 2011-06-09 20:06 42
593aeae4 sago007 2011-06-25 22:42 43
//Stores the controls
ecef5838 sago007 2015-11-24 20:01 44
struct control {
1d2e2129 sago007 2015-12-23 15:41 45
	SDL_Keycode up;
1d2e2129 sago007 2015-12-23 15:41 46
	SDL_Keycode down;
1d2e2129 sago007 2015-12-23 15:41 47
	SDL_Keycode left;
1d2e2129 sago007 2015-12-23 15:41 48
	SDL_Keycode right;
1d2e2129 sago007 2015-12-23 15:41 49
	SDL_Keycode change;
1d2e2129 sago007 2015-12-23 15:41 50
	SDL_Keycode push;
593aeae4 sago007 2011-06-25 22:42 51
};
593aeae4 sago007 2011-06-25 22:42 52
26ddb424 sago007 2011-06-09 20:06 53
void OpenScoresDisplay();
593aeae4 sago007 2011-06-25 22:42 54
extern control keySettings[3];
593aeae4 sago007 2011-06-25 22:42 55
593aeae4 sago007 2011-06-25 22:42 56
//Function to return the name of a key, to be displayed...
1d2e2129 sago007 2015-12-23 15:41 57
static string getKeyName(SDL_Keycode key) {
c53e6443 sago007 2012-04-17 11:04 58
	string keyname(SDL_GetKeyName(key));
72383a9e sago007 2016-10-30 11:56 59
	if (globalData.verboseLevel) {
161a010c sago007 2016-05-06 14:00 60
		cout << key << " translated to " << keyname << "\n";
acd79baf sago007 2015-11-22 19:37 61
	}
c53e6443 sago007 2012-04-17 11:04 62
	return keyname;
593aeae4 sago007 2011-06-25 22:42 63
}
593aeae4 sago007 2011-06-25 22:42 64
ecef5838 sago007 2015-11-24 20:01 65
class Button_changekey : public Button {
593aeae4 sago007 2011-06-25 22:42 66
private:
1d2e2129 sago007 2015-12-23 15:41 67
	SDL_Keycode* m_key2change;
c53e6443 sago007 2012-04-17 11:04 68
	string m_keyname;
593aeae4 sago007 2011-06-25 22:42 69
public:
1d2e2129 sago007 2015-12-23 15:41 70
	Button_changekey(SDL_Keycode* key, string keyname);
c53e6443 sago007 2012-04-17 11:04 71
	void doAction();
593aeae4 sago007 2011-06-25 22:42 72
};
593aeae4 sago007 2011-06-25 22:42 73
6710d462 sago007 2012-05-12 17:23 74
1d2e2129 sago007 2015-12-23 15:41 75
Button_changekey::Button_changekey(SDL_Keycode* key, string keyname) {
c53e6443 sago007 2012-04-17 11:04 76
	m_key2change = key;
c53e6443 sago007 2012-04-17 11:04 77
	m_keyname = keyname;
c53e6443 sago007 2012-04-17 11:04 78
	setLabel(m_keyname+" : "+getKeyName(*m_key2change));
593aeae4 sago007 2011-06-25 22:42 79
}
593aeae4 sago007 2011-06-25 22:42 80
ecef5838 sago007 2015-11-24 20:01 81
void Button_changekey::doAction() {
c53e6443 sago007 2012-04-17 11:04 82
	SDL_Event event;
c53e6443 sago007 2012-04-17 11:04 83
c53e6443 sago007 2012-04-17 11:04 84
	bool finnish = false;
ecef5838 sago007 2015-11-24 20:01 85
	while (!finnish) {
c53e6443 sago007 2012-04-17 11:04 86
		SDL_Delay(10);
ecef5838 sago007 2015-11-24 20:01 87
		while ( SDL_PollEvent(&event) ) {
ecef5838 sago007 2015-11-24 20:01 88
			if (event.type == SDL_KEYDOWN) {
acd79baf sago007 2015-11-22 19:37 89
				if (event.key.keysym.sym != SDLK_ESCAPE) {
c53e6443 sago007 2012-04-17 11:04 90
					*m_key2change = event.key.keysym.sym;
acd79baf sago007 2015-11-22 19:37 91
				}
c53e6443 sago007 2012-04-17 11:04 92
				finnish = true;
c53e6443 sago007 2012-04-17 11:04 93
			}
c53e6443 sago007 2012-04-17 11:04 94
		}
c53e6443 sago007 2012-04-17 11:04 95
	}
c53e6443 sago007 2012-04-17 11:04 96
	setLabel(m_keyname+" : "+getKeyName(*m_key2change));
593aeae4 sago007 2011-06-25 22:42 97
}
26ddb424 sago007 2011-06-09 20:06 98
ecef5838 sago007 2015-11-24 20:01 99
void InitMenues() {
094b2dfe sago007 2016-06-12 10:50 100
	standardButton.setSurfaces();
26ddb424 sago007 2011-06-09 20:06 101
}
26ddb424 sago007 2011-06-09 20:06 102
29edda2d sago007 2016-10-08 18:06 103
static void runSinglePlayerEndless() {
de81e07d sago007 2016-07-10 20:22 104
	runGame(Gametype::SinglePlayerEndless, 0);
26ddb424 sago007 2011-06-09 20:06 105
}
26ddb424 sago007 2011-06-09 20:06 106
29edda2d sago007 2016-10-08 18:06 107
static void runSinglePlayerTimeTrial() {
de81e07d sago007 2016-07-10 20:22 108
	runGame(Gametype::SinglePlayerTimeTrial, 0);
26ddb424 sago007 2011-06-09 20:06 109
}
26ddb424 sago007 2011-06-09 20:06 110
29edda2d sago007 2016-10-08 18:06 111
static void runStageClear() {
de81e07d sago007 2016-07-10 20:22 112
	runGame(Gametype::StageClear, 0);
aede0664 sago007 2012-04-19 19:45 113
}
aede0664 sago007 2012-04-19 19:45 114
29edda2d sago007 2016-10-08 18:06 115
static void runSinglePlayerPuzzle() {
de81e07d sago007 2016-07-10 20:22 116
	runGame(Gametype::Puzzle, 0);
26ddb424 sago007 2011-06-09 20:06 117
}
26ddb424 sago007 2011-06-09 20:06 118
29edda2d sago007 2016-10-08 18:06 119
class RunSinglePlayerVsButton : public Button {
29edda2d sago007 2016-10-08 18:06 120
	virtual void doAction() override {
29edda2d sago007 2016-10-08 18:06 121
		runGame(Gametype::SinglePlayerVs, iGeneric1);
29edda2d sago007 2016-10-08 18:06 122
	}
29edda2d sago007 2016-10-08 18:06 123
};
26ddb424 sago007 2011-06-09 20:06 124
29edda2d sago007 2016-10-08 18:06 125
static void runTwoPlayerTimeTrial() {
de81e07d sago007 2016-07-10 20:22 126
	runGame(Gametype::TwoPlayerTimeTrial, 0);
b0222eff sago007 2012-04-22 15:06 127
}
b0222eff sago007 2012-04-22 15:06 128
29edda2d sago007 2016-10-08 18:06 129
static void runTwoPlayerVs() {
de81e07d sago007 2016-07-10 20:22 130
	runGame(Gametype::TwoPlayerVs, 0);
b0222eff sago007 2012-04-22 15:06 131
}
b0222eff sago007 2012-04-22 15:06 132
29edda2d sago007 2016-10-08 18:06 133
class MusicButton : public Button {
29edda2d sago007 2016-10-08 18:06 134
	virtual void doAction() override {
72383a9e sago007 2016-10-30 11:56 135
		globalData.MusicEnabled = !globalData.MusicEnabled;
72383a9e sago007 2016-10-30 11:56 136
		setLabel(globalData.MusicEnabled? _("Music: On") : _("Music: Off"));
29edda2d sago007 2016-10-08 18:06 137
	}
26ddb424 sago007 2011-06-09 20:06 138
29edda2d sago007 2016-10-08 18:06 139
};
26ddb424 sago007 2011-06-09 20:06 140
29edda2d sago007 2016-10-08 18:06 141
class SoundButton : public Button {
29edda2d sago007 2016-10-08 18:06 142
	virtual void doAction() override {
72383a9e sago007 2016-10-30 11:56 143
		globalData.SoundEnabled = !globalData.SoundEnabled;
72383a9e sago007 2016-10-30 11:56 144
		setLabel(globalData.SoundEnabled? _("Sound: On") : _("Sound: Off") );
29edda2d sago007 2016-10-08 18:06 145
	}
29edda2d sago007 2016-10-08 18:06 146
};
29edda2d sago007 2016-10-08 18:06 147
29edda2d sago007 2016-10-08 18:06 148
class FullscreenButton : public Button {
29edda2d sago007 2016-10-08 18:06 149
	virtual void doAction() override {
72383a9e sago007 2016-10-30 11:56 150
		globalData.bFullscreen = !globalData.bFullscreen;
72383a9e sago007 2016-10-30 11:56 151
		setLabel(globalData.bFullscreen? _("Fullscreen: On") : _("Fullscreen: Off") );
29edda2d sago007 2016-10-08 18:06 152
		ResetFullscreen();
29edda2d sago007 2016-10-08 18:06 153
	}
29edda2d sago007 2016-10-08 18:06 154
};
26ddb424 sago007 2011-06-09 20:06 155
29edda2d sago007 2016-10-08 18:06 156
static void buttonActionPlayer1Name() {
72383a9e sago007 2016-10-30 11:56 157
	if ( OpenDialogbox(200, 100, globalData.player1name, _("Enter player 1 name:")) ) {
acd79baf sago007 2015-11-22 19:37 158
		return;    //must save if true
acd79baf sago007 2015-11-22 19:37 159
	}
26ddb424 sago007 2011-06-09 20:06 160
}
26ddb424 sago007 2011-06-09 20:06 161
29edda2d sago007 2016-10-08 18:06 162
static void buttonActionPlayer2Name() {
72383a9e sago007 2016-10-30 11:56 163
	if ( OpenDialogbox(200, 100, globalData.player2name, _("Enter player 2 name:")) ) {
acd79baf sago007 2015-11-22 19:37 164
		return;    //must save if true
acd79baf sago007 2015-11-22 19:37 165
	}
26ddb424 sago007 2011-06-09 20:06 166
}
26ddb424 sago007 2011-06-09 20:06 167
29edda2d sago007 2016-10-08 18:06 168
static void buttonActionHighscores() {
c53e6443 sago007 2012-04-17 11:04 169
	OpenScoresDisplay();
26ddb424 sago007 2011-06-09 20:06 170
}
26ddb424 sago007 2011-06-09 20:06 171
ecef5838 sago007 2015-11-24 20:01 172
static void ChangeKeysMenu(long playernumber) {
72383a9e sago007 2016-10-30 11:56 173
	Menu km(globalData.screen,_("Change key bindings"),true);
c53e6443 sago007 2012-04-17 11:04 174
	Button_changekey bLeft(&keySettings[playernumber].left,_("Left") );
c53e6443 sago007 2012-04-17 11:04 175
	Button_changekey bRight(&keySettings[playernumber].right,_("Right") );
c53e6443 sago007 2012-04-17 11:04 176
	Button_changekey bUp(&keySettings[playernumber].up,_("Up") );
c53e6443 sago007 2012-04-17 11:04 177
	Button_changekey bDown(&keySettings[playernumber].down,_("Down") );
c53e6443 sago007 2012-04-17 11:04 178
	Button_changekey bPush(&keySettings[playernumber].push,_("Push") );
c53e6443 sago007 2012-04-17 11:04 179
	Button_changekey bSwitch(&keySettings[playernumber].change,_("Change") );
c53e6443 sago007 2012-04-17 11:04 180
	km.addButton(&bLeft);
c53e6443 sago007 2012-04-17 11:04 181
	km.addButton(&bRight);
c53e6443 sago007 2012-04-17 11:04 182
	km.addButton(&bUp);
c53e6443 sago007 2012-04-17 11:04 183
	km.addButton(&bDown);
c53e6443 sago007 2012-04-17 11:04 184
	km.addButton(&bPush);
c53e6443 sago007 2012-04-17 11:04 185
	km.addButton(&bSwitch);
20d77c6e sago007 2016-11-12 16:28 186
	RunGameState(km);
c53e6443 sago007 2012-04-17 11:04 187
}
c53e6443 sago007 2012-04-17 11:04 188
29edda2d sago007 2016-10-08 18:06 189
static void ChangeKeysMenu1() {
c53e6443 sago007 2012-04-17 11:04 190
	ChangeKeysMenu(0);
593aeae4 sago007 2011-06-25 22:42 191
}
593aeae4 sago007 2011-06-25 22:42 192
29edda2d sago007 2016-10-08 18:06 193
static void ChangeKeysMenu2() {
c53e6443 sago007 2012-04-17 11:04 194
	ChangeKeysMenu(2);
593aeae4 sago007 2011-06-25 22:42 195
}
fc8e3d6a sago007 2011-06-25 16:31 196
29edda2d sago007 2016-10-08 18:06 197
static void ConfigureMenu() {
72383a9e sago007 2016-10-30 11:56 198
	Menu cm(globalData.screen,_("Configuration"),true);
29edda2d sago007 2016-10-08 18:06 199
	Button bPlayer1Name,bPlayer2Name;
c53e6443 sago007 2012-04-17 11:04 200
	Button bPlayer1Keys, bPlayer2Keys;
29edda2d sago007 2016-10-08 18:06 201
	MusicButton bMusic;
29edda2d sago007 2016-10-08 18:06 202
	SoundButton bSound;
29edda2d sago007 2016-10-08 18:06 203
	FullscreenButton buttonFullscreen;
72383a9e sago007 2016-10-30 11:56 204
	bMusic.setLabel(globalData.MusicEnabled? _("Music: On") : _("Music: Off") );
72383a9e sago007 2016-10-30 11:56 205
	bSound.setLabel(globalData.SoundEnabled? _("Sound: On") : _("Sound: Off") );
72383a9e sago007 2016-10-30 11:56 206
	buttonFullscreen.setLabel(globalData.bFullscreen? _("Fullscreen: On") : _("Fullscreen: Off") );
c53e6443 sago007 2012-04-17 11:04 207
	bPlayer1Name.setAction(buttonActionPlayer1Name);
c53e6443 sago007 2012-04-17 11:04 208
	bPlayer1Name.setLabel(_("Change player 1's name") );
c53e6443 sago007 2012-04-17 11:04 209
	bPlayer2Name.setAction(buttonActionPlayer2Name);
c53e6443 sago007 2012-04-17 11:04 210
	bPlayer2Name.setLabel(_("Change player 2's name") );
c53e6443 sago007 2012-04-17 11:04 211
	bPlayer1Keys.setAction(ChangeKeysMenu1);
c53e6443 sago007 2012-04-17 11:04 212
	bPlayer1Keys.setLabel(_("Change player 1's keys") );
c53e6443 sago007 2012-04-17 11:04 213
	bPlayer2Keys.setAction(ChangeKeysMenu2);
c53e6443 sago007 2012-04-17 11:04 214
	bPlayer2Keys.setLabel(_("Change player 2's keys") );
c53e6443 sago007 2012-04-17 11:04 215
	cm.addButton(&bMusic);
c53e6443 sago007 2012-04-17 11:04 216
	cm.addButton(&bSound);
c53e6443 sago007 2012-04-17 11:04 217
	cm.addButton(&buttonFullscreen);
c53e6443 sago007 2012-04-17 11:04 218
	cm.addButton(&bPlayer1Name);
c53e6443 sago007 2012-04-17 11:04 219
	cm.addButton(&bPlayer2Name);
c53e6443 sago007 2012-04-17 11:04 220
	cm.addButton(&bPlayer1Keys);
c53e6443 sago007 2012-04-17 11:04 221
	cm.addButton(&bPlayer2Keys);
20d77c6e sago007 2016-11-12 16:28 222
	RunGameState(cm);
26ddb424 sago007 2011-06-09 20:06 223
}
26ddb424 sago007 2011-06-09 20:06 224
29edda2d sago007 2016-10-08 18:06 225
static void SinglePlayerVsMenu() {
72383a9e sago007 2016-10-30 11:56 226
	Menu spvs(globalData.screen,_("Single player VS"),true);
29edda2d sago007 2016-10-08 18:06 227
	RunSinglePlayerVsButton d1,d2,d3,d4,d5,d6,d7;
67a32395 sago007 2012-04-19 18:40 228
	d1.setPopOnRun(true);
67a32395 sago007 2012-04-19 18:40 229
	d2.setPopOnRun(true);
67a32395 sago007 2012-04-19 18:40 230
	d3.setPopOnRun(true);
67a32395 sago007 2012-04-19 18:40 231
	d4.setPopOnRun(true);
67a32395 sago007 2012-04-19 18:40 232
	d5.setPopOnRun(true);
67a32395 sago007 2012-04-19 18:40 233
	d6.setPopOnRun(true);
67a32395 sago007 2012-04-19 18:40 234
	d7.setPopOnRun(true);
e68d08eb sago007 2013-11-15 22:33 235
	d1.iGeneric1 = 0;
e68d08eb sago007 2013-11-15 22:33 236
	d2.iGeneric1 = 1;
e68d08eb sago007 2013-11-15 22:33 237
	d3.iGeneric1 = 2;
e68d08eb sago007 2013-11-15 22:33 238
	d4.iGeneric1 = 3;
e68d08eb sago007 2013-11-15 22:33 239
	d5.iGeneric1 = 4;
e68d08eb sago007 2013-11-15 22:33 240
	d6.iGeneric1 = 5;
e68d08eb sago007 2013-11-15 22:33 241
	d7.iGeneric1 = 6;
67a32395 sago007 2012-04-19 18:40 242
	d1.setLabel(_("Very easy"));
67a32395 sago007 2012-04-19 18:40 243
	d2.setLabel(_("Easy"));
67a32395 sago007 2012-04-19 18:40 244
	d3.setLabel(_("Below normal"));
67a32395 sago007 2012-04-19 18:40 245
	d4.setLabel(_("Normal"));
67a32395 sago007 2012-04-19 18:40 246
	d5.setLabel(_("Above normal"));
67a32395 sago007 2012-04-19 18:40 247
	d6.setLabel(_("Hard"));
67a32395 sago007 2012-04-19 18:40 248
	d7.setLabel(_("Hardest"));
67a32395 sago007 2012-04-19 18:40 249
	spvs.addButton(&d1);
67a32395 sago007 2012-04-19 18:40 250
	spvs.addButton(&d2);
67a32395 sago007 2012-04-19 18:40 251
	spvs.addButton(&d3);
67a32395 sago007 2012-04-19 18:40 252
	spvs.addButton(&d4);
67a32395 sago007 2012-04-19 18:40 253
	spvs.addButton(&d5);
67a32395 sago007 2012-04-19 18:40 254
	spvs.addButton(&d6);
67a32395 sago007 2012-04-19 18:40 255
	spvs.addButton(&d7);
20d77c6e sago007 2016-11-12 16:28 256
	RunGameState(spvs);
67a32395 sago007 2012-04-19 18:40 257
}
67a32395 sago007 2012-04-19 18:40 258
29edda2d sago007 2016-10-08 18:06 259
static void MultiplayerMenu() {
72383a9e sago007 2016-10-30 11:56 260
	Menu mm(globalData.screen,_("Multiplayer"),true);
de81e07d sago007 2016-07-10 20:22 261
	Button bTT, bVs;
b0222eff sago007 2012-04-22 15:06 262
	bTT.setLabel(_("Two player - time trial"));
b0222eff sago007 2012-04-22 15:06 263
	bTT.setAction(runTwoPlayerTimeTrial);
b0222eff sago007 2012-04-22 15:06 264
	bVs.setLabel(_("Two player - vs"));
b0222eff sago007 2012-04-22 15:06 265
	bVs.setAction(runTwoPlayerVs);
b0222eff sago007 2012-04-22 15:06 266
	mm.addButton(&bTT);
b0222eff sago007 2012-04-22 15:06 267
	mm.addButton(&bVs);
20d77c6e sago007 2016-11-12 16:28 268
	RunGameState(mm);
b0222eff sago007 2012-04-22 15:06 269
}
b0222eff sago007 2012-04-22 15:06 270
d8fe60bd sago007 2018-04-02 16:15 271
static void runHowto() {
d8fe60bd sago007 2018-04-02 16:15 272
	HelpHowtoState howto;
d8fe60bd sago007 2018-04-02 16:15 273
	RunGameState(howto);
d8fe60bd sago007 2018-04-02 16:15 274
}
d8fe60bd sago007 2018-04-02 16:15 275
54d2d583 sago007 2018-04-05 17:52 276
static void runHelpGamepad() {
54d2d583 sago007 2018-04-05 17:52 277
	HelpGamepadState helpGamepad;
54d2d583 sago007 2018-04-05 17:52 278
	RunGameState(helpGamepad);
54d2d583 sago007 2018-04-05 17:52 279
}
54d2d583 sago007 2018-04-05 17:52 280
d8fe60bd sago007 2018-04-02 16:15 281
static void HelpMenu() {
d8fe60bd sago007 2018-04-02 16:15 282
	Menu m(globalData.screen, _("Help"), true);
d8fe60bd sago007 2018-04-02 16:15 283
	Button bHowto;
d8fe60bd sago007 2018-04-02 16:15 284
	bHowto.setLabel(_("How to"));
d8fe60bd sago007 2018-04-02 16:15 285
	bHowto.setAction(runHowto);
d8fe60bd sago007 2018-04-02 16:15 286
	m.addButton(&bHowto);
54d2d583 sago007 2018-04-05 17:52 287
	Button bGamepad;
54d2d583 sago007 2018-04-05 17:52 288
	bGamepad.setLabel(_("Gamepad"));
54d2d583 sago007 2018-04-05 17:52 289
	bGamepad.setAction(runHelpGamepad);
54d2d583 sago007 2018-04-05 17:52 290
	m.addButton(&bGamepad);
d8fe60bd sago007 2018-04-02 16:15 291
	RunGameState(m);
d8fe60bd sago007 2018-04-02 16:15 292
}
d8fe60bd sago007 2018-04-02 16:15 293
2f331f0c sago007 2017-08-19 16:17 294
static void SinglePlayerMenu() {
2f331f0c sago007 2017-08-19 16:17 295
	Menu m(globalData.screen, _("Single player"), true);
2f331f0c sago007 2017-08-19 16:17 296
	Button bHi,bTimetrial1, bStageClear, bPuzzle, bVs1;
c53e6443 sago007 2012-04-17 11:04 297
	bHi.setLabel(_("Single player - endless") );
c53e6443 sago007 2012-04-17 11:04 298
	bHi.setAction(runSinglePlayerEndless);
c53e6443 sago007 2012-04-17 11:04 299
	bTimetrial1.setLabel(_("Single player - time trial") );
c53e6443 sago007 2012-04-17 11:04 300
	bTimetrial1.setAction(runSinglePlayerTimeTrial);
aede0664 sago007 2012-04-19 19:45 301
	bStageClear.setLabel(_("Single player - stage clear") );
aede0664 sago007 2012-04-19 19:45 302
	bStageClear.setAction(runStageClear);
c53e6443 sago007 2012-04-17 11:04 303
	bPuzzle.setLabel(_("Single player - puzzle mode") );
c53e6443 sago007 2012-04-17 11:04 304
	bPuzzle.setAction(runSinglePlayerPuzzle);
c53e6443 sago007 2012-04-17 11:04 305
	bVs1.setLabel(_("Single player - vs") );
67a32395 sago007 2012-04-19 18:40 306
	bVs1.setAction(SinglePlayerVsMenu);
2f331f0c sago007 2017-08-19 16:17 307
	m.addButton(&bHi);
2f331f0c sago007 2017-08-19 16:17 308
	m.addButton(&bTimetrial1);
2f331f0c sago007 2017-08-19 16:17 309
	m.addButton(&bStageClear);
2f331f0c sago007 2017-08-19 16:17 310
	m.addButton(&bPuzzle);
2f331f0c sago007 2017-08-19 16:17 311
	m.addButton(&bVs1);
2f331f0c sago007 2017-08-19 16:17 312
	RunGameState(m);
2f331f0c sago007 2017-08-19 16:17 313
}
2f331f0c sago007 2017-08-19 16:17 314
2f331f0c sago007 2017-08-19 16:17 315
void MainMenu() {
2f331f0c sago007 2017-08-19 16:17 316
	InitMenues();
2f331f0c sago007 2017-08-19 16:17 317
	Menu m(globalData.screen,_("Block Attack - Rise of the blocks"),false);
d8fe60bd sago007 2018-04-02 16:15 318
	Button bHi, bMulti, bConfigure, bHighscore, bHelp;
2f331f0c sago007 2017-08-19 16:17 319
	bHi.setLabel(_("Single player") );
2f331f0c sago007 2017-08-19 16:17 320
	bHi.setAction(SinglePlayerMenu);
b0222eff sago007 2012-04-22 15:06 321
	bMulti.setLabel(_("Multi player") );
b0222eff sago007 2012-04-22 15:06 322
	bMulti.setAction(MultiplayerMenu);
c53e6443 sago007 2012-04-17 11:04 323
	bConfigure.setLabel(_("Configure") );
c53e6443 sago007 2012-04-17 11:04 324
	bConfigure.setAction(ConfigureMenu);
c53e6443 sago007 2012-04-17 11:04 325
	bHighscore.setLabel(_("Highscores") );
c53e6443 sago007 2012-04-17 11:04 326
	bHighscore.setAction(buttonActionHighscores);
d8fe60bd sago007 2018-04-02 16:15 327
	bHelp.setLabel(_("Help"));
d8fe60bd sago007 2018-04-02 16:15 328
	bHelp.setAction(HelpMenu);
c53e6443 sago007 2012-04-17 11:04 329
	m.addButton(&bHi);
b0222eff sago007 2012-04-22 15:06 330
	m.addButton(&bMulti);
c53e6443 sago007 2012-04-17 11:04 331
	m.addButton(&bConfigure);
c53e6443 sago007 2012-04-17 11:04 332
	m.addButton(&bHighscore);
d8fe60bd sago007 2018-04-02 16:15 333
	m.addButton(&bHelp);
95ab6b0d sago007 2016-11-12 16:11 334
	RunGameState(m);
593aeae4 sago007 2011-06-25 22:42 335
}
1970-01-01 00:00 336