| 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 |
| af35c39d |
sago007 |
2013-11-16 16:37 |
20 |
http://blockattack.sf.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 "menu/MenuItem.hpp" |
| 26ddb424 |
sago007 |
2011-06-09 20:06 |
27 |
#include "MenuSystem.h" |
| c9dd376f |
sago007 |
2012-01-20 17:13 |
28 |
#include "common.h" |
| 26ddb424 |
sago007 |
2011-06-09 20:06 |
29 |
|
| 26ddb424 |
sago007 |
2011-06-09 20:06 |
30 |
using namespace std; |
| 26ddb424 |
sago007 |
2011-06-09 20:06 |
31 |
|
| 26ddb424 |
sago007 |
2011-06-09 20:06 |
32 |
//Menu |
| ecef5838 |
sago007 |
2015-11-24 20:01 |
33 |
static void PrintHi(Button* b) { |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
34 |
cout << "Hi" <<endl; |
| 26ddb424 |
sago007 |
2011-06-09 20:06 |
35 |
} |
| 26ddb424 |
sago007 |
2011-06-09 20:06 |
36 |
|
| 593aeae4 |
sago007 |
2011-06-25 22:42 |
37 |
//Stores the controls |
| ecef5838 |
sago007 |
2015-11-24 20:01 |
38 |
struct control { |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
39 |
SDLKey up; |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
40 |
SDLKey down; |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
41 |
SDLKey left; |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
42 |
SDLKey right; |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
43 |
SDLKey change; |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
44 |
SDLKey push; |
| 593aeae4 |
sago007 |
2011-06-25 22:42 |
45 |
}; |
| 593aeae4 |
sago007 |
2011-06-25 22:42 |
46 |
|
| f6707482 |
sago007 |
2015-12-04 22:55 |
47 |
bool OpenDialogbox(int x, int y, std::string& name); |
| 26ddb424 |
sago007 |
2011-06-09 20:06 |
48 |
void OpenScoresDisplay(); |
| 593aeae4 |
sago007 |
2011-06-25 22:42 |
49 |
extern control keySettings[3]; |
| 593aeae4 |
sago007 |
2011-06-25 22:42 |
50 |
|
| 593aeae4 |
sago007 |
2011-06-25 22:42 |
51 |
//Function to return the name of a key, to be displayed... |
| ecef5838 |
sago007 |
2015-11-24 20:01 |
52 |
static string getKeyName(SDLKey key) { |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
53 |
string keyname(SDL_GetKeyName(key)); |
| ecef5838 |
sago007 |
2015-11-24 20:01 |
54 |
if (verboseLevel) { |
| 56241205 |
sago007 |
2012-08-05 11:15 |
55 |
cout << key << " translated to " << keyname << endl; |
| acd79baf |
sago007 |
2015-11-22 19:37 |
56 |
} |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
57 |
return keyname; |
| 593aeae4 |
sago007 |
2011-06-25 22:42 |
58 |
} |
| 593aeae4 |
sago007 |
2011-06-25 22:42 |
59 |
|
| ecef5838 |
sago007 |
2015-11-24 20:01 |
60 |
class Button_changekey : public Button { |
| 593aeae4 |
sago007 |
2011-06-25 22:42 |
61 |
private: |
| ecef5838 |
sago007 |
2015-11-24 20:01 |
62 |
SDLKey* m_key2change; |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
63 |
string m_keyname; |
| 593aeae4 |
sago007 |
2011-06-25 22:42 |
64 |
public: |
| ecef5838 |
sago007 |
2015-11-24 20:01 |
65 |
Button_changekey(SDLKey* key, string keyname); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
66 |
void doAction(); |
| 593aeae4 |
sago007 |
2011-06-25 22:42 |
67 |
}; |
| 593aeae4 |
sago007 |
2011-06-25 22:42 |
68 |
|
| 6710d462 |
sago007 |
2012-05-12 17:23 |
69 |
|
| ecef5838 |
sago007 |
2015-11-24 20:01 |
70 |
Button_changekey::Button_changekey(SDLKey* key, string keyname) { |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
71 |
m_key2change = key; |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
72 |
m_keyname = keyname; |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
73 |
setLabel(m_keyname+" : "+getKeyName(*m_key2change)); |
| 593aeae4 |
sago007 |
2011-06-25 22:42 |
74 |
} |
| 593aeae4 |
sago007 |
2011-06-25 22:42 |
75 |
|
| ecef5838 |
sago007 |
2015-11-24 20:01 |
76 |
void Button_changekey::doAction() { |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
77 |
SDL_Event event; |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
78 |
|
| c53e6443 |
sago007 |
2012-04-17 11:04 |
79 |
bool finnish = false; |
| ecef5838 |
sago007 |
2015-11-24 20:01 |
80 |
while (!finnish) { |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
81 |
SDL_Delay(10); |
| ecef5838 |
sago007 |
2015-11-24 20:01 |
82 |
while ( SDL_PollEvent(&event) ) { |
| ecef5838 |
sago007 |
2015-11-24 20:01 |
83 |
if (event.type == SDL_KEYDOWN) { |
| acd79baf |
sago007 |
2015-11-22 19:37 |
84 |
if (event.key.keysym.sym != SDLK_ESCAPE) { |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
85 |
*m_key2change = event.key.keysym.sym; |
| acd79baf |
sago007 |
2015-11-22 19:37 |
86 |
} |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
87 |
finnish = true; |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
88 |
} |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
89 |
} |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
90 |
} |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
91 |
setLabel(m_keyname+" : "+getKeyName(*m_key2change)); |
| 593aeae4 |
sago007 |
2011-06-25 22:42 |
92 |
} |
| 26ddb424 |
sago007 |
2011-06-09 20:06 |
93 |
|
| ecef5838 |
sago007 |
2015-11-24 20:01 |
94 |
void InitMenues() { |
| b283e0f7 |
sago007 |
2012-07-29 14:01 |
95 |
standardButton.setSurfaces(menuMarked,menuUnmarked); |
| b283e0f7 |
sago007 |
2012-07-29 14:01 |
96 |
standardButton.thefont = nf_scoreboard_font; |
| 26ddb424 |
sago007 |
2011-06-09 20:06 |
97 |
} |
| 26ddb424 |
sago007 |
2011-06-09 20:06 |
98 |
|
| 67a32395 |
sago007 |
2012-04-19 18:40 |
99 |
void runGame(int gametype,int level); |
| 26ddb424 |
sago007 |
2011-06-09 20:06 |
100 |
|
| ecef5838 |
sago007 |
2015-11-24 20:01 |
101 |
static void runSinglePlayerEndless(Button* b) { |
| 67a32395 |
sago007 |
2012-04-19 18:40 |
102 |
runGame(0,0); |
| 26ddb424 |
sago007 |
2011-06-09 20:06 |
103 |
} |
| 26ddb424 |
sago007 |
2011-06-09 20:06 |
104 |
|
| ecef5838 |
sago007 |
2015-11-24 20:01 |
105 |
static void runSinglePlayerTimeTrial(Button* b) { |
| 67a32395 |
sago007 |
2012-04-19 18:40 |
106 |
runGame(1,0); |
| 26ddb424 |
sago007 |
2011-06-09 20:06 |
107 |
} |
| 26ddb424 |
sago007 |
2011-06-09 20:06 |
108 |
|
| ecef5838 |
sago007 |
2015-11-24 20:01 |
109 |
static void runStageClear(Button* b) { |
| aede0664 |
sago007 |
2012-04-19 19:45 |
110 |
runGame(2,0); |
| aede0664 |
sago007 |
2012-04-19 19:45 |
111 |
} |
| aede0664 |
sago007 |
2012-04-19 19:45 |
112 |
|
| ecef5838 |
sago007 |
2015-11-24 20:01 |
113 |
static void runSinglePlayerPuzzle(Button* b) { |
| 67a32395 |
sago007 |
2012-04-19 18:40 |
114 |
runGame(3,0); |
| 26ddb424 |
sago007 |
2011-06-09 20:06 |
115 |
} |
| 26ddb424 |
sago007 |
2011-06-09 20:06 |
116 |
|
| ecef5838 |
sago007 |
2015-11-24 20:01 |
117 |
static void runSinglePlayerVs(Button* b) { |
| 67a32395 |
sago007 |
2012-04-19 18:40 |
118 |
runGame(4,b->iGeneric1); |
| 26ddb424 |
sago007 |
2011-06-09 20:06 |
119 |
} |
| 26ddb424 |
sago007 |
2011-06-09 20:06 |
120 |
|
| ecef5838 |
sago007 |
2015-11-24 20:01 |
121 |
static void runTwoPlayerTimeTrial(Button* b) { |
| b0222eff |
sago007 |
2012-04-22 15:06 |
122 |
runGame(10,0); |
| b0222eff |
sago007 |
2012-04-22 15:06 |
123 |
} |
| b0222eff |
sago007 |
2012-04-22 15:06 |
124 |
|
| ecef5838 |
sago007 |
2015-11-24 20:01 |
125 |
static void runTwoPlayerVs(Button* b) { |
| b0222eff |
sago007 |
2012-04-22 15:06 |
126 |
runGame(11,0); |
| b0222eff |
sago007 |
2012-04-22 15:06 |
127 |
} |
| b0222eff |
sago007 |
2012-04-22 15:06 |
128 |
|
| ecef5838 |
sago007 |
2015-11-24 20:01 |
129 |
static void runHostGame(Button* b) { |
| 6710d462 |
sago007 |
2012-05-12 17:23 |
130 |
runGame(12,0); |
| 6710d462 |
sago007 |
2012-05-12 17:23 |
131 |
} |
| 6710d462 |
sago007 |
2012-05-12 17:23 |
132 |
|
| ecef5838 |
sago007 |
2015-11-24 20:01 |
133 |
static void runJoinGame(Button* b) { |
| 6710d462 |
sago007 |
2012-05-12 17:23 |
134 |
runGame(13,0); |
| 6710d462 |
sago007 |
2012-05-12 17:23 |
135 |
} |
| 6710d462 |
sago007 |
2012-05-12 17:23 |
136 |
|
| ecef5838 |
sago007 |
2015-11-24 20:01 |
137 |
static void buttonActionMusic(Button* b) { |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
138 |
MusicEnabled = !MusicEnabled; |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
139 |
b->setLabel(MusicEnabled? "Music: On" : "Music: Off"); |
| 26ddb424 |
sago007 |
2011-06-09 20:06 |
140 |
} |
| 26ddb424 |
sago007 |
2011-06-09 20:06 |
141 |
|
| ecef5838 |
sago007 |
2015-11-24 20:01 |
142 |
static void buttonActionSound(Button* b) { |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
143 |
SoundEnabled = !SoundEnabled; |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
144 |
b->setLabel(SoundEnabled? _("Sound: On") : _("Sound: Off") ); |
| 26ddb424 |
sago007 |
2011-06-09 20:06 |
145 |
} |
| 26ddb424 |
sago007 |
2011-06-09 20:06 |
146 |
|
| ecef5838 |
sago007 |
2015-11-24 20:01 |
147 |
static void buttonActionFullscreen(Button* b) { |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
148 |
bFullscreen = !bFullscreen; |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
149 |
b->setLabel(bFullscreen? _("Fullscreen: On") : _("Fullscreen: Off") ); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
150 |
ResetFullscreen(); |
| 26ddb424 |
sago007 |
2011-06-09 20:06 |
151 |
} |
| 26ddb424 |
sago007 |
2011-06-09 20:06 |
152 |
|
| ecef5838 |
sago007 |
2015-11-24 20:01 |
153 |
static void buttonActionPlayer1Name(Button* b) { |
| acd79baf |
sago007 |
2015-11-22 19:37 |
154 |
if (OpenDialogbox(200,100,player1name)) { |
| acd79baf |
sago007 |
2015-11-22 19:37 |
155 |
return; //must save if true |
| acd79baf |
sago007 |
2015-11-22 19:37 |
156 |
} |
| 26ddb424 |
sago007 |
2011-06-09 20:06 |
157 |
} |
| 26ddb424 |
sago007 |
2011-06-09 20:06 |
158 |
|
| ecef5838 |
sago007 |
2015-11-24 20:01 |
159 |
static void buttonActionPlayer2Name(Button* b) { |
| acd79baf |
sago007 |
2015-11-22 19:37 |
160 |
if (OpenDialogbox(200,100,player2name)) { |
| acd79baf |
sago007 |
2015-11-22 19:37 |
161 |
return; //must save if true |
| acd79baf |
sago007 |
2015-11-22 19:37 |
162 |
} |
| 26ddb424 |
sago007 |
2011-06-09 20:06 |
163 |
} |
| 26ddb424 |
sago007 |
2011-06-09 20:06 |
164 |
|
| ecef5838 |
sago007 |
2015-11-24 20:01 |
165 |
static void buttonActionPortChange(Button* b) { |
| f6707482 |
sago007 |
2015-12-04 22:55 |
166 |
string port = Config::getInstance()->getString("portv4"); |
| f6707482 |
sago007 |
2015-12-04 22:55 |
167 |
if (OpenDialogbox(200,100,port) && atoi(port.c_str())) { |
| f6707482 |
sago007 |
2015-12-04 22:55 |
168 |
Config::getInstance()->setInt("portv4",atoi(port.c_str())); |
| 53001fa2 |
sago007 |
2015-11-08 15:13 |
169 |
boost::format f(_("Port: %1%") ); |
| b45d8841 |
sago007 |
2012-04-23 19:30 |
170 |
f % port; |
| b45d8841 |
sago007 |
2012-04-23 19:30 |
171 |
b->setLabel(f.str()); |
| b45d8841 |
sago007 |
2012-04-23 19:30 |
172 |
} |
| b45d8841 |
sago007 |
2012-04-23 19:30 |
173 |
} |
| b45d8841 |
sago007 |
2012-04-23 19:30 |
174 |
|
| ecef5838 |
sago007 |
2015-11-24 20:01 |
175 |
static void buttonActionIpChange(Button* b) { |
| f6707482 |
sago007 |
2015-12-04 22:55 |
176 |
string ip = Config::getInstance()->getString("address0"); |
| ecef5838 |
sago007 |
2015-11-24 20:01 |
177 |
if (OpenDialogbox(200,100,ip)) { |
| b45d8841 |
sago007 |
2012-04-23 19:30 |
178 |
Config::getInstance()->setString("address0",ip); |
| 53001fa2 |
sago007 |
2015-11-08 15:13 |
179 |
boost::format f(_("Address: %1%") ); |
| b45d8841 |
sago007 |
2012-04-23 19:30 |
180 |
f % ip; |
| b45d8841 |
sago007 |
2012-04-23 19:30 |
181 |
b->setLabel(f.str()); |
| b45d8841 |
sago007 |
2012-04-23 19:30 |
182 |
} |
| b45d8841 |
sago007 |
2012-04-23 19:30 |
183 |
} |
| b45d8841 |
sago007 |
2012-04-23 19:30 |
184 |
|
| ecef5838 |
sago007 |
2015-11-24 20:01 |
185 |
static void buttonActionHighscores(Button* b) { |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
186 |
OpenScoresDisplay(); |
| 26ddb424 |
sago007 |
2011-06-09 20:06 |
187 |
} |
| 26ddb424 |
sago007 |
2011-06-09 20:06 |
188 |
|
| ecef5838 |
sago007 |
2015-11-24 20:01 |
189 |
static void ChangeKeysMenu(long playernumber) { |
| 0c1de203 |
sago007 |
2015-12-05 22:15 |
190 |
Menu km(screen,_("Change key bindings"),true); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
191 |
Button_changekey bLeft(&keySettings[playernumber].left,_("Left") ); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
192 |
Button_changekey bRight(&keySettings[playernumber].right,_("Right") ); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
193 |
Button_changekey bUp(&keySettings[playernumber].up,_("Up") ); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
194 |
Button_changekey bDown(&keySettings[playernumber].down,_("Down") ); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
195 |
Button_changekey bPush(&keySettings[playernumber].push,_("Push") ); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
196 |
Button_changekey bSwitch(&keySettings[playernumber].change,_("Change") ); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
197 |
km.addButton(&bLeft); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
198 |
km.addButton(&bRight); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
199 |
km.addButton(&bUp); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
200 |
km.addButton(&bDown); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
201 |
km.addButton(&bPush); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
202 |
km.addButton(&bSwitch); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
203 |
km.run(); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
204 |
} |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
205 |
|
| ecef5838 |
sago007 |
2015-11-24 20:01 |
206 |
static void ChangeKeysMenu1(Button* b) { |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
207 |
ChangeKeysMenu(0); |
| 593aeae4 |
sago007 |
2011-06-25 22:42 |
208 |
} |
| 593aeae4 |
sago007 |
2011-06-25 22:42 |
209 |
|
| ecef5838 |
sago007 |
2015-11-24 20:01 |
210 |
static void ChangeKeysMenu2(Button* b) { |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
211 |
ChangeKeysMenu(2); |
| 593aeae4 |
sago007 |
2011-06-25 22:42 |
212 |
} |
| fc8e3d6a |
sago007 |
2011-06-25 16:31 |
213 |
|
| ecef5838 |
sago007 |
2015-11-24 20:01 |
214 |
static void ConfigureMenu(Button* b) { |
| 0c1de203 |
sago007 |
2015-12-05 22:15 |
215 |
Menu cm(screen,_("Configuration"),true); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
216 |
Button bMusic,bSound,buttonFullscreen,bPlayer1Name,bPlayer2Name; |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
217 |
Button bPlayer1Keys, bPlayer2Keys; |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
218 |
bMusic.setLabel(MusicEnabled? _("Music: On") : _("Music: Off") ); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
219 |
bMusic.setAction(buttonActionMusic); |
| aceba8db |
sago007 |
2012-04-19 20:27 |
220 |
bSound.setLabel(SoundEnabled? _("Sound: On") : _("Sound: Off") ); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
221 |
bSound.setAction(buttonActionSound); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
222 |
buttonFullscreen.setLabel(bFullscreen? _("Fullscreen: On") : _("Fullscreen: Off") ); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
223 |
buttonFullscreen.setAction(buttonActionFullscreen); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
224 |
bPlayer1Name.setAction(buttonActionPlayer1Name); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
225 |
bPlayer1Name.setLabel(_("Change player 1's name") ); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
226 |
bPlayer2Name.setAction(buttonActionPlayer2Name); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
227 |
bPlayer2Name.setLabel(_("Change player 2's name") ); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
228 |
bPlayer1Keys.setAction(ChangeKeysMenu1); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
229 |
bPlayer1Keys.setLabel(_("Change player 1's keys") ); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
230 |
bPlayer2Keys.setAction(ChangeKeysMenu2); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
231 |
bPlayer2Keys.setLabel(_("Change player 2's keys") ); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
232 |
cm.addButton(&bMusic); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
233 |
cm.addButton(&bSound); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
234 |
cm.addButton(&buttonFullscreen); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
235 |
cm.addButton(&bPlayer1Name); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
236 |
cm.addButton(&bPlayer2Name); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
237 |
cm.addButton(&bPlayer1Keys); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
238 |
cm.addButton(&bPlayer2Keys); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
239 |
cm.run(); |
| 26ddb424 |
sago007 |
2011-06-09 20:06 |
240 |
} |
| 26ddb424 |
sago007 |
2011-06-09 20:06 |
241 |
|
| ecef5838 |
sago007 |
2015-11-24 20:01 |
242 |
static void SinglePlayerVsMenu(Button* b) { |
| 0c1de203 |
sago007 |
2015-12-05 22:15 |
243 |
Menu spvs(screen,_("Single player VS"),true); |
| 67a32395 |
sago007 |
2012-04-19 18:40 |
244 |
Button d1,d2,d3,d4,d5,d6,d7; |
| 67a32395 |
sago007 |
2012-04-19 18:40 |
245 |
d1.setAction(runSinglePlayerVs); |
| 67a32395 |
sago007 |
2012-04-19 18:40 |
246 |
d2.setAction(runSinglePlayerVs); |
| 67a32395 |
sago007 |
2012-04-19 18:40 |
247 |
d3.setAction(runSinglePlayerVs); |
| 67a32395 |
sago007 |
2012-04-19 18:40 |
248 |
d4.setAction(runSinglePlayerVs); |
| 67a32395 |
sago007 |
2012-04-19 18:40 |
249 |
d5.setAction(runSinglePlayerVs); |
| 67a32395 |
sago007 |
2012-04-19 18:40 |
250 |
d6.setAction(runSinglePlayerVs); |
| 67a32395 |
sago007 |
2012-04-19 18:40 |
251 |
d7.setAction(runSinglePlayerVs); |
| 67a32395 |
sago007 |
2012-04-19 18:40 |
252 |
d1.setPopOnRun(true); |
| 67a32395 |
sago007 |
2012-04-19 18:40 |
253 |
d2.setPopOnRun(true); |
| 67a32395 |
sago007 |
2012-04-19 18:40 |
254 |
d3.setPopOnRun(true); |
| 67a32395 |
sago007 |
2012-04-19 18:40 |
255 |
d4.setPopOnRun(true); |
| 67a32395 |
sago007 |
2012-04-19 18:40 |
256 |
d5.setPopOnRun(true); |
| 67a32395 |
sago007 |
2012-04-19 18:40 |
257 |
d6.setPopOnRun(true); |
| 67a32395 |
sago007 |
2012-04-19 18:40 |
258 |
d7.setPopOnRun(true); |
| e68d08eb |
sago007 |
2013-11-15 22:33 |
259 |
d1.iGeneric1 = 0; |
| e68d08eb |
sago007 |
2013-11-15 22:33 |
260 |
d2.iGeneric1 = 1; |
| e68d08eb |
sago007 |
2013-11-15 22:33 |
261 |
d3.iGeneric1 = 2; |
| e68d08eb |
sago007 |
2013-11-15 22:33 |
262 |
d4.iGeneric1 = 3; |
| e68d08eb |
sago007 |
2013-11-15 22:33 |
263 |
d5.iGeneric1 = 4; |
| e68d08eb |
sago007 |
2013-11-15 22:33 |
264 |
d6.iGeneric1 = 5; |
| e68d08eb |
sago007 |
2013-11-15 22:33 |
265 |
d7.iGeneric1 = 6; |
| 67a32395 |
sago007 |
2012-04-19 18:40 |
266 |
d1.setLabel(_("Very easy")); |
| 67a32395 |
sago007 |
2012-04-19 18:40 |
267 |
d2.setLabel(_("Easy")); |
| 67a32395 |
sago007 |
2012-04-19 18:40 |
268 |
d3.setLabel(_("Below normal")); |
| 67a32395 |
sago007 |
2012-04-19 18:40 |
269 |
d4.setLabel(_("Normal")); |
| 67a32395 |
sago007 |
2012-04-19 18:40 |
270 |
d5.setLabel(_("Above normal")); |
| 67a32395 |
sago007 |
2012-04-19 18:40 |
271 |
d6.setLabel(_("Hard")); |
| 67a32395 |
sago007 |
2012-04-19 18:40 |
272 |
d7.setLabel(_("Hardest")); |
| 67a32395 |
sago007 |
2012-04-19 18:40 |
273 |
spvs.addButton(&d1); |
| 67a32395 |
sago007 |
2012-04-19 18:40 |
274 |
spvs.addButton(&d2); |
| 67a32395 |
sago007 |
2012-04-19 18:40 |
275 |
spvs.addButton(&d3); |
| 67a32395 |
sago007 |
2012-04-19 18:40 |
276 |
spvs.addButton(&d4); |
| 67a32395 |
sago007 |
2012-04-19 18:40 |
277 |
spvs.addButton(&d5); |
| 67a32395 |
sago007 |
2012-04-19 18:40 |
278 |
spvs.addButton(&d6); |
| 67a32395 |
sago007 |
2012-04-19 18:40 |
279 |
spvs.addButton(&d7); |
| 67a32395 |
sago007 |
2012-04-19 18:40 |
280 |
spvs.run(); |
| 67a32395 |
sago007 |
2012-04-19 18:40 |
281 |
} |
| 67a32395 |
sago007 |
2012-04-19 18:40 |
282 |
|
| ecef5838 |
sago007 |
2015-11-24 20:01 |
283 |
static void MultiplayerMenu(Button* b) { |
| 0c1de203 |
sago007 |
2015-12-05 22:15 |
284 |
Menu mm(screen,_("Multiplayer"),true); |
| b0222eff |
sago007 |
2012-04-22 15:06 |
285 |
Button bTT, bVs, bNet; |
| b0222eff |
sago007 |
2012-04-22 15:06 |
286 |
bTT.setLabel(_("Two player - time trial")); |
| b0222eff |
sago007 |
2012-04-22 15:06 |
287 |
bTT.setAction(runTwoPlayerTimeTrial); |
| b0222eff |
sago007 |
2012-04-22 15:06 |
288 |
bVs.setLabel(_("Two player - vs")); |
| b0222eff |
sago007 |
2012-04-22 15:06 |
289 |
bVs.setAction(runTwoPlayerVs); |
| b0222eff |
sago007 |
2012-04-22 15:06 |
290 |
mm.addButton(&bTT); |
| b0222eff |
sago007 |
2012-04-22 15:06 |
291 |
mm.addButton(&bVs); |
| b0222eff |
sago007 |
2012-04-22 15:06 |
292 |
mm.run(); |
| b0222eff |
sago007 |
2012-04-22 15:06 |
293 |
} |
| b0222eff |
sago007 |
2012-04-22 15:06 |
294 |
|
| ecef5838 |
sago007 |
2015-11-24 20:01 |
295 |
void MainMenu() { |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
296 |
InitMenues(); |
| 0c1de203 |
sago007 |
2015-12-05 22:15 |
297 |
Menu m(screen,_("Block Attack - Rise of the blocks"),false); |
| b0222eff |
sago007 |
2012-04-22 15:06 |
298 |
Button bHi,bTimetrial1, bStageClear, bPuzzle, bVs1, bMulti, bConfigure,bHighscore; |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
299 |
bHi.setLabel(_("Single player - endless") ); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
300 |
bHi.setAction(runSinglePlayerEndless); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
301 |
bTimetrial1.setLabel(_("Single player - time trial") ); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
302 |
bTimetrial1.setAction(runSinglePlayerTimeTrial); |
| aede0664 |
sago007 |
2012-04-19 19:45 |
303 |
bStageClear.setLabel(_("Single player - stage clear") ); |
| aede0664 |
sago007 |
2012-04-19 19:45 |
304 |
bStageClear.setAction(runStageClear); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
305 |
bPuzzle.setLabel(_("Single player - puzzle mode") ); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
306 |
bPuzzle.setAction(runSinglePlayerPuzzle); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
307 |
bVs1.setLabel(_("Single player - vs") ); |
| 67a32395 |
sago007 |
2012-04-19 18:40 |
308 |
bVs1.setAction(SinglePlayerVsMenu); |
| b0222eff |
sago007 |
2012-04-22 15:06 |
309 |
bMulti.setLabel(_("Multi player") ); |
| b0222eff |
sago007 |
2012-04-22 15:06 |
310 |
bMulti.setAction(MultiplayerMenu); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
311 |
bConfigure.setLabel(_("Configure") ); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
312 |
bConfigure.setAction(ConfigureMenu); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
313 |
bHighscore.setLabel(_("Highscores") ); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
314 |
bHighscore.setAction(buttonActionHighscores); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
315 |
m.addButton(&bHi); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
316 |
m.addButton(&bTimetrial1); |
| aede0664 |
sago007 |
2012-04-19 19:45 |
317 |
m.addButton(&bStageClear); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
318 |
m.addButton(&bPuzzle); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
319 |
m.addButton(&bVs1); |
| b0222eff |
sago007 |
2012-04-22 15:06 |
320 |
m.addButton(&bMulti); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
321 |
m.addButton(&bConfigure); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
322 |
m.addButton(&bHighscore); |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
323 |
m.run(); |
| 593aeae4 |
sago007 |
2011-06-25 22:42 |
324 |
} |
|
|
1970-01-01 00:00 |
325 |
|