1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2025-01-03 15:39:46 +01:00

Convert menu names to be an enum instead of being stringly-typed

Stringly-typed things are bad, because if you make a typo when typing
out a string, it's not caught at compile-time. And in the case of this
menu system, you'd have to do an excessive amount of testing to uncover
any bugs caused by a typo. Why do that when you can just use an enum and
catch compile-time errors instead?

Also, you can't use switch-case statements on stringly-typed variables.

So every menu name is now in the enum Menu::MenuName, but you can simply
refer to a menu name by just prefixing it with Menu::.

Unfortunately, I've had to change the "continue" menu name to be
"continuemenu", because "continue" is a keyword in C and C++. Also, it
looks like "timetrialcomplete4" is an unused menu name, even though it
was referenced in Render.cpp.
This commit is contained in:
Misa 2020-04-15 21:53:36 -07:00 committed by Ethan Lee
parent 83ca75a831
commit e8a07f9c3d
7 changed files with 324 additions and 269 deletions

View file

@ -224,16 +224,14 @@ void Game::init(void)
currentmenuoption = 0; currentmenuoption = 0;
menuselection = "null"; menuselection = "null";
currentmenuname = "null";
current_credits_list_index = 0; current_credits_list_index = 0;
menuxoff = 0; menuxoff = 0;
menuyoff = 0; menuyoff = 0;
menucountdown = 0; menucountdown = 0;
menudest="null";
levelpage=0; levelpage=0;
playcustomlevel=0; playcustomlevel=0;
customleveltitle=""; customleveltitle="";
createmenu("mainmenu"); createmenu(Menu::mainmenu);
deathcounts = 0; deathcounts = 0;
gameoverdelay = 0; gameoverdelay = 0;
@ -1341,7 +1339,7 @@ void Game::updatestate()
graphics.backgrounddrawn = false; graphics.backgrounddrawn = false;
map.tdrawback = true; map.tdrawback = true;
graphics.flipmode = false; graphics.flipmode = false;
createmenu("mainmenu"); createmenu(Menu::mainmenu);
state = 0; state = 0;
break; break;
@ -1396,7 +1394,7 @@ void Game::updatestate()
graphics.fademode = 4; graphics.fademode = 4;
graphics.backgrounddrawn = true; graphics.backgrounddrawn = true;
map.tdrawback = true; map.tdrawback = true;
createmenu("timetrialcomplete"); createmenu(Menu::timetrialcomplete);
state = 0; state = 0;
break; break;
@ -2101,7 +2099,7 @@ void Game::updatestate()
} }
} }
#endif #endif
createmenu("levellist"); createmenu(Menu::levellist);
state = 0; state = 0;
break; break;
@ -3046,7 +3044,7 @@ void Game::updatestate()
graphics.fademode = 4; graphics.fademode = 4;
graphics.backgrounddrawn = true; graphics.backgrounddrawn = true;
map.tdrawback = true; map.tdrawback = true;
createmenu("play"); createmenu(Menu::play);
music.play(6); music.play(6);
state = 0; state = 0;
break; break;
@ -3373,7 +3371,7 @@ void Game::updatestate()
graphics.fademode = 4; graphics.fademode = 4;
graphics.backgrounddrawn = true; graphics.backgrounddrawn = true;
map.tdrawback = true; map.tdrawback = true;
createmenu("nodeathmodecomplete"); createmenu(Menu::nodeathmodecomplete);
state = 0; state = 0;
break; break;
@ -6545,7 +6543,7 @@ std::string Game::timetstring( int t )
return tempstring; return tempstring;
} }
void Game::createmenu( std::string t ) void Game::createmenu( enum Menu::MenuName t )
{ {
currentmenuoption = 0; currentmenuoption = 0;
menuselection = "null"; menuselection = "null";
@ -6553,10 +6551,9 @@ void Game::createmenu( std::string t )
menuxoff = 0; menuxoff = 0;
menuyoff = 0; menuyoff = 0;
menucountdown = 0; menucountdown = 0;
menudest="null";
menuoptions.clear(); menuoptions.clear();
if (t == "mainmenu") if (t == Menu::mainmenu)
{ {
#if !defined(MAKEANDPLAY) #if !defined(MAKEANDPLAY)
option("start game"); option("start game");
@ -6574,7 +6571,7 @@ void Game::createmenu( std::string t )
menuyoff = -10; menuyoff = -10;
} }
#if !defined(NO_CUSTOM_LEVELS) #if !defined(NO_CUSTOM_LEVELS)
else if (t == "playerworlds") else if (t == Menu::playerworlds)
{ {
option("play a level"); option("play a level");
#if !defined(NO_EDITOR) #if !defined(NO_EDITOR)
@ -6585,7 +6582,7 @@ void Game::createmenu( std::string t )
menuxoff = -30; menuxoff = -30;
menuyoff = -40; menuyoff = -40;
} }
else if (t == "levellist") else if (t == Menu::levellist)
{ {
if(ed.ListOfMetaData.size()==0) if(ed.ListOfMetaData.size()==0)
{ {
@ -6648,7 +6645,7 @@ void Game::createmenu( std::string t )
} }
} }
#endif #endif
else if (t == "quickloadlevel") else if (t == Menu::quickloadlevel)
{ {
option("continue from save"); option("continue from save");
option("start from beginning"); option("start from beginning");
@ -6656,20 +6653,20 @@ void Game::createmenu( std::string t )
menuxoff = -40; menuxoff = -40;
menuyoff = -30; menuyoff = -30;
} }
else if (t == "youwannaquit") else if (t == Menu::youwannaquit)
{ {
option("yes, quit"); option("yes, quit");
option("no, return"); option("no, return");
menuxoff = 0; menuxoff = 0;
menuyoff = -20; menuyoff = -20;
} }
else if (t == "errornostart") else if (t == Menu::errornostart)
{ {
option("ok"); option("ok");
menuxoff = 0; menuxoff = 0;
menuyoff = -20; menuyoff = -20;
} }
else if (t == "graphicoptions") else if (t == Menu::graphicoptions)
{ {
option("toggle fullscreen"); option("toggle fullscreen");
option("toggle letterbox"); option("toggle letterbox");
@ -6680,7 +6677,7 @@ void Game::createmenu( std::string t )
menuxoff = -50; menuxoff = -50;
menuyoff = 8; menuyoff = 8;
} }
else if (t == "ed_settings") else if (t == Menu::ed_settings)
{ {
option("change description"); option("change description");
option("edit scripts"); option("edit scripts");
@ -6692,7 +6689,7 @@ void Game::createmenu( std::string t )
menuxoff = -50; menuxoff = -50;
menuyoff = -20; menuyoff = -20;
} }
else if (t == "ed_desc") else if (t == Menu::ed_desc)
{ {
option("change name"); option("change name");
option("change author"); option("change author");
@ -6703,14 +6700,14 @@ void Game::createmenu( std::string t )
menuxoff = -40; menuxoff = -40;
menuyoff = 6; menuyoff = 6;
} }
else if (t == "ed_music") else if (t == Menu::ed_music)
{ {
option("next song"); option("next song");
option("back"); option("back");
menuxoff = -10; menuxoff = -10;
menuyoff = 16; menuyoff = 16;
} }
else if (t == "ed_quit") else if (t == Menu::ed_quit)
{ {
option("yes, save and quit"); option("yes, save and quit");
option("no, quit without saving"); option("no, quit without saving");
@ -6718,7 +6715,7 @@ void Game::createmenu( std::string t )
menuxoff = -50; menuxoff = -50;
menuyoff = 8; menuyoff = 8;
} }
else if (t == "options") else if (t == Menu::options)
{ {
option("accessibility options"); option("accessibility options");
#if !defined(MAKEANDPLAY) #if !defined(MAKEANDPLAY)
@ -6735,7 +6732,7 @@ void Game::createmenu( std::string t )
menuxoff = -40; menuxoff = -40;
menuyoff = 0; menuyoff = 0;
} }
else if (t == "accessibility") else if (t == Menu::accessibility)
{ {
option("animated backgrounds"); option("animated backgrounds");
option("screen effects"); option("screen effects");
@ -6748,7 +6745,7 @@ void Game::createmenu( std::string t )
menuxoff = -85; menuxoff = -85;
menuyoff = -10; menuyoff = -10;
} }
else if(t == "controller") else if(t == Menu::controller)
{ {
option("analog stick sensitivity"); option("analog stick sensitivity");
option("bind flip"); option("bind flip");
@ -6758,28 +6755,28 @@ void Game::createmenu( std::string t )
menuxoff = -40; menuxoff = -40;
menuyoff = 10; menuyoff = 10;
} }
else if (t == "cleardatamenu") else if (t == Menu::cleardatamenu)
{ {
option("no! don't delete"); option("no! don't delete");
option("yes, delete everything"); option("yes, delete everything");
menuxoff = -30; menuxoff = -30;
menuyoff = 64; menuyoff = 64;
} }
else if (t == "setinvincibility") else if (t == Menu::setinvincibility)
{ {
option("no, return to options"); option("no, return to options");
option("yes, enable"); option("yes, enable");
menuxoff = -30; menuxoff = -30;
menuyoff = 64; menuyoff = 64;
} }
else if (t == "setslowdown1") else if (t == Menu::setslowdown1)
{ {
option("no, return to options"); option("no, return to options");
option("yes, delete saves"); option("yes, delete saves");
menuxoff = -30; menuxoff = -30;
menuyoff = 64; menuyoff = 64;
} }
else if (t == "setslowdown2") else if (t == Menu::setslowdown2)
{ {
option("normal speed"); option("normal speed");
option("80% speed"); option("80% speed");
@ -6788,7 +6785,7 @@ void Game::createmenu( std::string t )
menuxoff = -40; menuxoff = -40;
menuyoff = 16; menuyoff = 16;
} }
else if (t == "unlockmenu") else if (t == Menu::unlockmenu)
{ {
option("unlock time trials"); option("unlock time trials");
option("unlock intermissions", !unlock[16]); option("unlock intermissions", !unlock[16]);
@ -6800,56 +6797,56 @@ void Game::createmenu( std::string t )
menuxoff = -70; menuxoff = -70;
menuyoff = -20; menuyoff = -20;
} }
else if (t == "credits") else if (t == Menu::credits)
{ {
option("next page"); option("next page");
option("return"); option("return");
menuxoff = 20; menuxoff = 20;
menuyoff = 64; menuyoff = 64;
} }
else if (t == "credits2") else if (t == Menu::credits2)
{ {
option("next page"); option("next page");
option("return"); option("return");
menuxoff = 20; menuxoff = 20;
menuyoff = 64; menuyoff = 64;
} }
else if (t == "credits25") else if (t == Menu::credits25)
{ {
option("next page"); option("next page");
option("return"); option("return");
menuxoff = 20; menuxoff = 20;
menuyoff = 64; menuyoff = 64;
} }
else if (t == "credits3") else if (t == Menu::credits3)
{ {
option("next page"); option("next page");
option("return"); option("return");
menuxoff = 20; menuxoff = 20;
menuyoff = 64; menuyoff = 64;
} }
else if (t == "credits4") else if (t == Menu::credits4)
{ {
option("next page"); option("next page");
option("return"); option("return");
menuxoff = 20; menuxoff = 20;
menuyoff = 64; menuyoff = 64;
} }
else if (t == "credits5") else if (t == Menu::credits5)
{ {
option("next page"); option("next page");
option("return"); option("return");
menuxoff = 20; menuxoff = 20;
menuyoff = 64; menuyoff = 64;
} }
else if (t == "credits6") else if (t == Menu::credits6)
{ {
option("first page"); option("first page");
option("return"); option("return");
menuxoff = 20; menuxoff = 20;
menuyoff = 64; menuyoff = 64;
} }
else if (t == "play") else if (t == Menu::play)
{ {
//Ok, here's where the unlock stuff comes into it: //Ok, here's where the unlock stuff comes into it:
//First up, time trials: //First up, time trials:
@ -6896,12 +6893,12 @@ void Game::createmenu( std::string t )
if (temp == 1) if (temp == 1)
{ {
createmenu("unlocktimetrial"); createmenu(Menu::unlocktimetrial);
savemystats = true; savemystats = true;
} }
else if (temp > 1) else if (temp > 1)
{ {
createmenu("unlocktimetrials"); createmenu(Menu::unlocktimetrials);
savemystats = true; savemystats = true;
} }
} }
@ -6920,7 +6917,7 @@ void Game::createmenu( std::string t )
//Unlock No Death Mode //Unlock No Death Mode
unlocknotify[17] = true; unlocknotify[17] = true;
unlock[17] = true; unlock[17] = true;
createmenu("unlocknodeathmode"); createmenu(Menu::unlocknodeathmode);
savemystats = true; savemystats = true;
} }
//Alright then! Flip mode? //Alright then! Flip mode?
@ -6928,7 +6925,7 @@ void Game::createmenu( std::string t )
{ {
unlock[18] = true; unlock[18] = true;
unlocknotify[18] = true; unlocknotify[18] = true;
createmenu("unlockflipmode"); createmenu(Menu::unlockflipmode);
savemystats = true; savemystats = true;
} }
//What about the intermission levels? //What about the intermission levels?
@ -6936,7 +6933,7 @@ void Game::createmenu( std::string t )
{ {
unlock[16] = true; unlock[16] = true;
unlocknotify[16] = true; unlocknotify[16] = true;
createmenu("unlockintermission"); createmenu(Menu::unlockintermission);
savemystats = true; savemystats = true;
} }
else else
@ -6963,24 +6960,24 @@ void Game::createmenu( std::string t )
} }
} }
} }
else if (t == "unlocktimetrial" else if (t == Menu::unlocktimetrial
|| t == "unlocktimetrials" || t == Menu::unlocktimetrials
|| t == "unlocknodeathmode" || t == Menu::unlocknodeathmode
|| t == "unlockintermission" || t == Menu::unlockintermission
|| t == "unlockflipmode") || t == Menu::unlockflipmode)
{ {
option("continue"); option("continue");
menuxoff = 20; menuxoff = 20;
menuyoff = 70; menuyoff = 70;
} }
else if (t == "newgamewarning") else if (t == Menu::newgamewarning)
{ {
option("start new game"); option("start new game");
option("return to menu"); option("return to menu");
menuxoff = -30; menuxoff = -30;
menuyoff = 64; menuyoff = 64;
} }
else if (t == "playmodes") else if (t == Menu::playmodes)
{ {
option("time trials", !map.invincibility && game.slowdown == 30); option("time trials", !map.invincibility && game.slowdown == 30);
option("intermissions", unlock[16]); option("intermissions", unlock[16]);
@ -6990,7 +6987,7 @@ void Game::createmenu( std::string t )
menuxoff = -70; menuxoff = -70;
menuyoff = 8; menuyoff = 8;
} }
else if (t == "intermissionmenu") else if (t == Menu::intermissionmenu)
{ {
option("play intermission 1"); option("play intermission 1");
option("play intermission 2"); option("play intermission 2");
@ -6998,7 +6995,7 @@ void Game::createmenu( std::string t )
menuxoff = -50; menuxoff = -50;
menuyoff = -35; menuyoff = -35;
} }
else if (t == "playint1") else if (t == Menu::playint1)
{ {
option("Vitellary"); option("Vitellary");
option("Vermilion"); option("Vermilion");
@ -7008,7 +7005,7 @@ void Game::createmenu( std::string t )
menuxoff = -60; menuxoff = -60;
menuyoff = 10; menuyoff = 10;
} }
else if (t == "playint2") else if (t == Menu::playint2)
{ {
option("Vitellary"); option("Vitellary");
option("Vermilion"); option("Vermilion");
@ -7018,7 +7015,7 @@ void Game::createmenu( std::string t )
menuxoff = -60; menuxoff = -60;
menuyoff = 10; menuyoff = 10;
} }
else if (t == "continue") else if (t == Menu::continuemenu)
{ {
option("continue from teleporter"); option("continue from teleporter");
option("continue from quicksave"); option("continue from quicksave");
@ -7026,7 +7023,7 @@ void Game::createmenu( std::string t )
menuxoff = -60; menuxoff = -60;
menuyoff = 20; menuyoff = 20;
} }
else if (t == "startnodeathmode") else if (t == Menu::startnodeathmode)
{ {
option("disable cutscenes"); option("disable cutscenes");
option("enable cutscenes"); option("enable cutscenes");
@ -7034,18 +7031,18 @@ void Game::createmenu( std::string t )
menuxoff = -60; menuxoff = -60;
menuyoff = 40; menuyoff = 40;
} }
else if (t == "gameover") else if (t == Menu::gameover)
{ {
menucountdown = 120; menucountdown = 120;
menudest="gameover2"; menudest=Menu::gameover2;
} }
else if (t == "gameover2") else if (t == Menu::gameover2)
{ {
option("return to play menu"); option("return to play menu");
menuxoff = -25; menuxoff = -25;
menuyoff = 80; menuyoff = 80;
} }
else if (t == "unlockmenutrials") else if (t == Menu::unlockmenutrials)
{ {
option("space station 1", !unlock[9]); option("space station 1", !unlock[9]);
option("the laboratory", !unlock[10]); option("the laboratory", !unlock[10]);
@ -7058,7 +7055,7 @@ void Game::createmenu( std::string t )
menuxoff = -80; menuxoff = -80;
menuyoff = 0; menuyoff = 0;
} }
else if (t == "timetrials") else if (t == Menu::timetrials)
{ {
option(unlock[9] ? "space station 1" : "???", unlock[9]); option(unlock[9] ? "space station 1" : "???", unlock[9]);
option(unlock[10] ? "the laboratory" : "???", unlock[10]); option(unlock[10] ? "the laboratory" : "???", unlock[10]);
@ -7071,35 +7068,35 @@ void Game::createmenu( std::string t )
menuxoff = -80; menuxoff = -80;
menuyoff = 0; menuyoff = 0;
} }
else if (t == "nodeathmodecomplete") else if (t == Menu::nodeathmodecomplete)
{ {
menucountdown = 90; menucountdown = 90;
menudest = "nodeathmodecomplete2"; menudest = Menu::nodeathmodecomplete2;
} }
else if (t == "nodeathmodecomplete2") else if (t == Menu::nodeathmodecomplete2)
{ {
option("return to play menu"); option("return to play menu");
menuxoff = -25; menuxoff = -25;
menuyoff = 70; menuyoff = 70;
} }
else if (t == "timetrialcomplete") else if (t == Menu::timetrialcomplete)
{ {
menucountdown = 90; menucountdown = 90;
menudest="timetrialcomplete2"; menudest=Menu::timetrialcomplete2;
} }
else if (t == "timetrialcomplete2") else if (t == Menu::timetrialcomplete2)
{ {
menucountdown = 60; menucountdown = 60;
menudest="timetrialcomplete3"; menudest=Menu::timetrialcomplete3;
} }
else if (t == "timetrialcomplete3") else if (t == Menu::timetrialcomplete3)
{ {
option("return to play menu"); option("return to play menu");
option("try again"); option("try again");
menuxoff = -25; menuxoff = -25;
menuyoff = 70; menuyoff = 70;
} }
else if (t == "gamecompletecontinue") else if (t == Menu::gamecompletecontinue)
{ {
option("return to play menu"); option("return to play menu");
menuxoff = -25; menuxoff = -25;

View file

@ -14,6 +14,63 @@ struct MenuOption
bool active; bool active;
}; };
//Menu IDs
namespace Menu
{
enum MenuName
{
mainmenu,
playerworlds,
levellist,
quickloadlevel,
youwannaquit,
errornostart,
graphicoptions,
ed_settings,
ed_desc,
ed_music,
ed_quit,
options,
accessibility,
controller,
cleardatamenu,
setinvincibility,
setslowdown1,
setslowdown2,
unlockmenu,
credits,
credits2,
credits25,
credits3,
credits4,
credits5,
credits6,
play,
unlocktimetrial,
unlocktimetrials,
unlocknodeathmode,
unlockintermission,
unlockflipmode,
newgamewarning,
playmodes,
intermissionmenu,
playint1,
playint2,
continuemenu,
startnodeathmode,
gameover,
gameover2,
unlockmenutrials,
timetrials,
nodeathmodecomplete,
nodeathmodecomplete2,
timetrialcomplete,
timetrialcomplete2,
timetrialcomplete3,
gamecompletecontinue,
};
};
class Game class Game
{ {
@ -53,7 +110,7 @@ public:
std::string timetstring(int t); std::string timetstring(int t);
void createmenu(std::string t); void createmenu(enum Menu::MenuName t);
void lifesequence(); void lifesequence();
@ -164,7 +221,8 @@ public:
//Main Menu Variables //Main Menu Variables
std::vector<MenuOption> menuoptions; std::vector<MenuOption> menuoptions;
int currentmenuoption ; int currentmenuoption ;
std::string menuselection, currentmenuname, previousmenuname; std::string menuselection;
enum Menu::MenuName currentmenuname, previousmenuname;
int current_credits_list_index; int current_credits_list_index;
int menuxoff, menuyoff; int menuxoff, menuyoff;
@ -177,7 +235,7 @@ public:
} }
int menucountdown; int menucountdown;
std::string menudest; enum Menu::MenuName menudest;
int creditposx, creditposy, creditposdelay; int creditposx, creditposy, creditposdelay;

View file

@ -112,7 +112,7 @@ void updatebuttonmappings(int bind)
void menuactionpress() void menuactionpress()
{ {
if (game.currentmenuname == "mainmenu") if (game.currentmenuname == Menu::mainmenu)
{ {
#if defined(MAKEANDPLAY) #if defined(MAKEANDPLAY)
#define MPOFFSET -1 #define MPOFFSET -1
@ -143,7 +143,7 @@ void menuactionpress()
{ {
//Bring you to the normal playmenu //Bring you to the normal playmenu
music.playef(11); music.playef(11);
game.createmenu("play"); game.createmenu(Menu::play);
map.nexttowercolour(); map.nexttowercolour();
} }
break; break;
@ -152,27 +152,27 @@ void menuactionpress()
case OFFSET+1: case OFFSET+1:
//Bring you to the normal playmenu //Bring you to the normal playmenu
music.playef(11); music.playef(11);
game.createmenu("playerworlds"); game.createmenu(Menu::playerworlds);
map.nexttowercolour(); map.nexttowercolour();
break; break;
#endif #endif
case OFFSET+2: case OFFSET+2:
//Options //Options
music.playef(11); music.playef(11);
game.createmenu("graphicoptions"); game.createmenu(Menu::graphicoptions);
map.nexttowercolour(); map.nexttowercolour();
break; break;
case OFFSET+3: case OFFSET+3:
//Options //Options
music.playef(11); music.playef(11);
game.createmenu("options"); game.createmenu(Menu::options);
map.nexttowercolour(); map.nexttowercolour();
break; break;
#if !defined(MAKEANDPLAY) #if !defined(MAKEANDPLAY)
case OFFSET+4: case OFFSET+4:
//Credits //Credits
music.playef(11); music.playef(11);
game.createmenu("credits"); game.createmenu(Menu::credits);
map.nexttowercolour(); map.nexttowercolour();
break; break;
#else #else
@ -191,12 +191,12 @@ void menuactionpress()
} }
} }
#if !defined(NO_CUSTOM_LEVELS) #if !defined(NO_CUSTOM_LEVELS)
else if(game.currentmenuname=="levellist") else if(game.currentmenuname==Menu::levellist)
{ {
if(game.currentmenuoption==(int)game.menuoptions.size()-1){ if(game.currentmenuoption==(int)game.menuoptions.size()-1){
//go back to menu //go back to menu
music.playef(11); music.playef(11);
game.createmenu("mainmenu"); game.createmenu(Menu::mainmenu);
map.nexttowercolour(); map.nexttowercolour();
}else if(game.currentmenuoption==(int)game.menuoptions.size()-2){ }else if(game.currentmenuoption==(int)game.menuoptions.size()-2){
//next page //next page
@ -206,7 +206,7 @@ void menuactionpress()
}else{ }else{
game.levelpage++; game.levelpage++;
} }
game.createmenu("levellist"); game.createmenu(Menu::levellist);
game.currentmenuoption=game.menuoptions.size()-2; game.currentmenuoption=game.menuoptions.size()-2;
map.nexttowercolour(); map.nexttowercolour();
}else{ }else{
@ -223,13 +223,13 @@ void menuactionpress()
game.mainmenu = 22; game.mainmenu = 22;
graphics.fademode = 2; graphics.fademode = 2;
}else{ }else{
game.createmenu("quickloadlevel"); game.createmenu(Menu::quickloadlevel);
map.nexttowercolour(); map.nexttowercolour();
} }
} }
} }
#endif #endif
else if(game.currentmenuname=="quickloadlevel") else if(game.currentmenuname==Menu::quickloadlevel)
{ {
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
@ -244,13 +244,13 @@ void menuactionpress()
case 2: case 2:
music.playef(11); music.playef(11);
game.levelpage=0; game.levelpage=0;
game.createmenu("levellist"); game.createmenu(Menu::levellist);
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} }
#if !defined(NO_CUSTOM_LEVELS) #if !defined(NO_CUSTOM_LEVELS)
else if(game.currentmenuname=="playerworlds") else if(game.currentmenuname==Menu::playerworlds)
{ {
#if defined(NO_EDITOR) #if defined(NO_EDITOR)
#define OFFSET -1 #define OFFSET -1
@ -265,7 +265,7 @@ void menuactionpress()
game.levelpage=0; game.levelpage=0;
ed.getDirectoryData(); ed.getDirectoryData();
game.loadcustomlevelstats(); //Should only load a file if it's needed game.loadcustomlevelstats(); //Should only load a file if it's needed
game.createmenu("levellist"); game.createmenu(Menu::levellist);
map.nexttowercolour(); map.nexttowercolour();
break; break;
#if !defined(NO_EDITOR) #if !defined(NO_EDITOR)
@ -290,19 +290,19 @@ void menuactionpress()
case OFFSET+2: case OFFSET+2:
//back //back
music.playef(11); music.playef(11);
game.createmenu("mainmenu"); game.createmenu(Menu::mainmenu);
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
#undef OFFSET #undef OFFSET
} }
#endif #endif
else if(game.currentmenuname=="errornostart"){ else if(game.currentmenuname==Menu::errornostart){
music.playef(11); music.playef(11);
game.createmenu("mainmenu"); game.createmenu(Menu::mainmenu);
map.nexttowercolour(); map.nexttowercolour();
} }
else if (game.currentmenuname == "graphicoptions") else if (game.currentmenuname == Menu::graphicoptions)
{ {
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
@ -311,7 +311,7 @@ void menuactionpress()
graphics.screenbuffer->toggleFullScreen(); graphics.screenbuffer->toggleFullScreen();
game.fullscreen = !game.fullscreen; game.fullscreen = !game.fullscreen;
game.savestats(); game.savestats();
game.createmenu("graphicoptions"); game.createmenu(Menu::graphicoptions);
game.currentmenuoption = 0; game.currentmenuoption = 0;
break; break;
case 1: case 1:
@ -319,7 +319,7 @@ void menuactionpress()
graphics.screenbuffer->toggleStretchMode(); graphics.screenbuffer->toggleStretchMode();
game.stretchMode = (game.stretchMode + 1) % 3; game.stretchMode = (game.stretchMode + 1) % 3;
game.savestats(); game.savestats();
game.createmenu("graphicoptions"); game.createmenu(Menu::graphicoptions);
game.currentmenuoption = 1; game.currentmenuoption = 1;
break; break;
case 2: case 2:
@ -327,7 +327,7 @@ void menuactionpress()
graphics.screenbuffer->toggleLinearFilter(); graphics.screenbuffer->toggleLinearFilter();
game.useLinearFilter = !game.useLinearFilter; game.useLinearFilter = !game.useLinearFilter;
game.savestats(); game.savestats();
game.createmenu("graphicoptions"); game.createmenu(Menu::graphicoptions);
game.currentmenuoption = 2; game.currentmenuoption = 2;
break; break;
case 3: case 3:
@ -337,7 +337,7 @@ void menuactionpress()
//Hook the analogue thing in here: ABCDEFG //Hook the analogue thing in here: ABCDEFG
graphics.screenbuffer->badSignalEffect= !graphics.screenbuffer->badSignalEffect; graphics.screenbuffer->badSignalEffect= !graphics.screenbuffer->badSignalEffect;
game.savestats(); game.savestats();
game.createmenu("graphicoptions"); game.createmenu(Menu::graphicoptions);
game.currentmenuoption = 3; game.currentmenuoption = 3;
break; break;
case 4: case 4:
@ -355,12 +355,12 @@ void menuactionpress()
default: default:
//back //back
music.playef(11); music.playef(11);
game.createmenu("mainmenu"); game.createmenu(Menu::mainmenu);
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} }
else if (game.currentmenuname == "youwannaquit") else if (game.currentmenuname == Menu::youwannaquit)
{ {
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
@ -376,14 +376,14 @@ void menuactionpress()
map.nexttowercolour(); map.nexttowercolour();
} }
} }
else if (game.currentmenuname == "setinvincibility") else if (game.currentmenuname == Menu::setinvincibility)
{ {
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
//back //back
music.playef(11); music.playef(11);
game.createmenu("accessibility"); game.createmenu(Menu::accessibility);
game.currentmenuoption = 3; game.currentmenuoption = 3;
map.nexttowercolour(); map.nexttowercolour();
break; break;
@ -391,20 +391,20 @@ void menuactionpress()
map.invincibility = !map.invincibility; map.invincibility = !map.invincibility;
game.savestats(); game.savestats();
music.playef(11); music.playef(11);
game.createmenu("accessibility"); game.createmenu(Menu::accessibility);
game.currentmenuoption = 3; game.currentmenuoption = 3;
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} }
else if (game.currentmenuname == "setslowdown1") else if (game.currentmenuname == Menu::setslowdown1)
{ {
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
//back //back
music.playef(11); music.playef(11);
game.createmenu("accessibility"); game.createmenu(Menu::accessibility);
game.currentmenuoption = 4; game.currentmenuoption = 4;
map.nexttowercolour(); map.nexttowercolour();
break; break;
@ -412,13 +412,13 @@ void menuactionpress()
//change game speed //change game speed
game.deletequick(); game.deletequick();
game.deletetele(); game.deletetele();
game.createmenu("setslowdown2"); game.createmenu(Menu::setslowdown2);
map.nexttowercolour(); map.nexttowercolour();
music.playef(11); music.playef(11);
break; break;
} }
} }
else if (game.currentmenuname == "setslowdown2") else if (game.currentmenuname == Menu::setslowdown2)
{ {
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
@ -428,7 +428,7 @@ void menuactionpress()
game.slowdown = 30; game.slowdown = 30;
game.savestats(); game.savestats();
music.playef(11); music.playef(11);
game.createmenu("accessibility"); game.createmenu(Menu::accessibility);
game.currentmenuoption = 4; game.currentmenuoption = 4;
map.nexttowercolour(); map.nexttowercolour();
break; break;
@ -437,7 +437,7 @@ void menuactionpress()
game.slowdown = 24; game.slowdown = 24;
game.savestats(); game.savestats();
music.playef(11); music.playef(11);
game.createmenu("accessibility"); game.createmenu(Menu::accessibility);
game.currentmenuoption = 4; game.currentmenuoption = 4;
map.nexttowercolour(); map.nexttowercolour();
break; break;
@ -446,7 +446,7 @@ void menuactionpress()
game.slowdown = 18; game.slowdown = 18;
game.savestats(); game.savestats();
music.playef(11); music.playef(11);
game.createmenu("accessibility"); game.createmenu(Menu::accessibility);
game.currentmenuoption = 4; game.currentmenuoption = 4;
map.nexttowercolour(); map.nexttowercolour();
break; break;
@ -455,13 +455,13 @@ void menuactionpress()
game.slowdown = 12; game.slowdown = 12;
game.savestats(); game.savestats();
music.playef(11); music.playef(11);
game.createmenu("accessibility"); game.createmenu(Menu::accessibility);
game.currentmenuoption = 4; game.currentmenuoption = 4;
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} }
else if (game.currentmenuname == "accessibility") else if (game.currentmenuname == Menu::accessibility)
{ {
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
@ -495,7 +495,7 @@ void menuactionpress()
//invincibility //invincibility
if (!map.invincibility) if (!map.invincibility)
{ {
game.createmenu("setinvincibility"); game.createmenu(Menu::setinvincibility);
map.nexttowercolour(); map.nexttowercolour();
} }
else else
@ -506,7 +506,7 @@ void menuactionpress()
break; break;
case 4: case 4:
//change game speed //change game speed
game.createmenu("setslowdown2"); game.createmenu(Menu::setslowdown2);
map.nexttowercolour(); map.nexttowercolour();
music.playef(11); music.playef(11);
break; break;
@ -523,7 +523,7 @@ void menuactionpress()
case 7: case 7:
//back //back
music.playef(11); music.playef(11);
game.createmenu("options"); game.createmenu(Menu::options);
map.nexttowercolour(); map.nexttowercolour();
break; break;
default: default:
@ -532,7 +532,7 @@ void menuactionpress()
break; break;
} }
} }
else if (game.currentmenuname == "options") else if (game.currentmenuname == Menu::options)
{ {
#if defined(MAKEANDPLAY) #if defined(MAKEANDPLAY)
#define OFFSET -1 #define OFFSET -1
@ -545,27 +545,27 @@ void menuactionpress()
case 0: case 0:
//accessibility options //accessibility options
music.playef(11); music.playef(11);
game.createmenu("accessibility"); game.createmenu(Menu::accessibility);
map.nexttowercolour(); map.nexttowercolour();
break; break;
#if !defined(MAKEANDPLAY) #if !defined(MAKEANDPLAY)
case 1: case 1:
//unlock play options //unlock play options
music.playef(11); music.playef(11);
game.createmenu("unlockmenu"); game.createmenu(Menu::unlockmenu);
map.nexttowercolour(); map.nexttowercolour();
break; break;
#endif #endif
case OFFSET+2: case OFFSET+2:
//clear data menu //clear data menu
music.playef(11); music.playef(11);
game.createmenu("controller"); game.createmenu(Menu::controller);
map.nexttowercolour(); map.nexttowercolour();
break; break;
case OFFSET+3: case OFFSET+3:
//clear data menu //clear data menu
music.playef(11); music.playef(11);
game.createmenu("cleardatamenu"); game.createmenu(Menu::cleardatamenu);
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
@ -588,12 +588,12 @@ void menuactionpress()
{ {
//back //back
music.playef(11); music.playef(11);
game.createmenu("mainmenu"); game.createmenu(Menu::mainmenu);
map.nexttowercolour(); map.nexttowercolour();
} }
#undef OFFSET #undef OFFSET
} }
else if (game.currentmenuname == "unlockmenutrials") else if (game.currentmenuname == Menu::unlockmenutrials)
{ {
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
@ -602,7 +602,7 @@ void menuactionpress()
game.unlocknotify[9] = true; game.unlocknotify[9] = true;
music.playef(11); music.playef(11);
game.savestats(); game.savestats();
game.createmenu("unlockmenutrials"); game.createmenu(Menu::unlockmenutrials);
game.currentmenuoption = 0; game.currentmenuoption = 0;
break; break;
case 1: //unlock 2 case 1: //unlock 2
@ -610,7 +610,7 @@ void menuactionpress()
game.unlocknotify[10] = true; game.unlocknotify[10] = true;
music.playef(11); music.playef(11);
game.savestats(); game.savestats();
game.createmenu("unlockmenutrials"); game.createmenu(Menu::unlockmenutrials);
game.currentmenuoption = 1; game.currentmenuoption = 1;
break; break;
case 2: //unlock 3 case 2: //unlock 3
@ -618,7 +618,7 @@ void menuactionpress()
game.unlocknotify[11] = true; game.unlocknotify[11] = true;
music.playef(11); music.playef(11);
game.savestats(); game.savestats();
game.createmenu("unlockmenutrials"); game.createmenu(Menu::unlockmenutrials);
game.currentmenuoption = 2; game.currentmenuoption = 2;
break; break;
case 3: //unlock 4 case 3: //unlock 4
@ -626,7 +626,7 @@ void menuactionpress()
game.unlocknotify[12] = true; game.unlocknotify[12] = true;
music.playef(11); music.playef(11);
game.savestats(); game.savestats();
game.createmenu("unlockmenutrials"); game.createmenu(Menu::unlockmenutrials);
game.currentmenuoption = 3; game.currentmenuoption = 3;
break; break;
case 4: //unlock 5 case 4: //unlock 5
@ -634,7 +634,7 @@ void menuactionpress()
game.unlocknotify[13] = true; game.unlocknotify[13] = true;
music.playef(11); music.playef(11);
game.savestats(); game.savestats();
game.createmenu("unlockmenutrials"); game.createmenu(Menu::unlockmenutrials);
game.currentmenuoption = 4; game.currentmenuoption = 4;
break; break;
case 5: //unlock 6 case 5: //unlock 6
@ -642,25 +642,25 @@ void menuactionpress()
game.unlocknotify[14] = true; game.unlocknotify[14] = true;
music.playef(11); music.playef(11);
game.savestats(); game.savestats();
game.createmenu("unlockmenutrials"); game.createmenu(Menu::unlockmenutrials);
game.currentmenuoption = 5; game.currentmenuoption = 5;
break; break;
case 6: //back case 6: //back
//back //back
music.playef(11); music.playef(11);
game.createmenu("unlockmenu"); game.createmenu(Menu::unlockmenu);
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} }
else if (game.currentmenuname == "unlockmenu") else if (game.currentmenuname == Menu::unlockmenu)
{ {
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
//unlock time trials separately... //unlock time trials separately...
music.playef(11); music.playef(11);
game.createmenu("unlockmenutrials"); game.createmenu(Menu::unlockmenutrials);
map.nexttowercolour(); map.nexttowercolour();
break; break;
case 1: case 1:
@ -671,7 +671,7 @@ void menuactionpress()
game.unlock[6] = true; game.unlock[6] = true;
game.unlock[7] = true; game.unlock[7] = true;
game.savestats(); game.savestats();
game.createmenu("unlockmenu"); game.createmenu(Menu::unlockmenu);
game.currentmenuoption = 1; game.currentmenuoption = 1;
break; break;
case 2: case 2:
@ -680,7 +680,7 @@ void menuactionpress()
game.unlock[17] = true; game.unlock[17] = true;
game.unlocknotify[17] = true; game.unlocknotify[17] = true;
game.savestats(); game.savestats();
game.createmenu("unlockmenu"); game.createmenu(Menu::unlockmenu);
game.currentmenuoption = 2; game.currentmenuoption = 2;
break; break;
case 3: case 3:
@ -689,7 +689,7 @@ void menuactionpress()
game.unlock[18] = true; game.unlock[18] = true;
game.unlocknotify[18] = true; game.unlocknotify[18] = true;
game.savestats(); game.savestats();
game.createmenu("unlockmenu"); game.createmenu(Menu::unlockmenu);
game.currentmenuoption = 3; game.currentmenuoption = 3;
break; break;
case 4: case 4:
@ -697,7 +697,7 @@ void menuactionpress()
music.playef(11); music.playef(11);
game.stat_trinkets = 20; game.stat_trinkets = 20;
game.savestats(); game.savestats();
game.createmenu("unlockmenu"); game.createmenu(Menu::unlockmenu);
game.currentmenuoption = 4; game.currentmenuoption = 4;
break; break;
case 5: case 5:
@ -706,72 +706,72 @@ void menuactionpress()
game.unlock[8] = true; game.unlock[8] = true;
game.unlocknotify[8] = true; game.unlocknotify[8] = true;
game.savestats(); game.savestats();
game.createmenu("unlockmenu"); game.createmenu(Menu::unlockmenu);
game.currentmenuoption = 5; game.currentmenuoption = 5;
break; break;
default: default:
//back //back
music.playef(11); music.playef(11);
game.createmenu("options"); game.createmenu(Menu::options);
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} }
else if (game.currentmenuname == "credits") else if (game.currentmenuname == Menu::credits)
{ {
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
//next page //next page
music.playef(11); music.playef(11);
game.createmenu("credits2"); game.createmenu(Menu::credits2);
map.nexttowercolour(); map.nexttowercolour();
break; break;
default: default:
//back //back
music.playef(11); music.playef(11);
game.createmenu("mainmenu"); game.createmenu(Menu::mainmenu);
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} }
else if (game.currentmenuname == "credits2") else if (game.currentmenuname == Menu::credits2)
{ {
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
//next page //next page
music.playef(11); music.playef(11);
game.createmenu("credits25"); game.createmenu(Menu::credits25);
map.nexttowercolour(); map.nexttowercolour();
break; break;
case 1: case 1:
//back //back
music.playef(11); music.playef(11);
game.createmenu("mainmenu"); game.createmenu(Menu::mainmenu);
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} }
else if (game.currentmenuname == "credits25") else if (game.currentmenuname == Menu::credits25)
{ {
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
//next page //next page
music.playef(11); music.playef(11);
game.createmenu("credits3"); game.createmenu(Menu::credits3);
map.nexttowercolour(); map.nexttowercolour();
break; break;
default: default:
//back //back
music.playef(11); music.playef(11);
game.createmenu("mainmenu"); game.createmenu(Menu::mainmenu);
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} }
else if (game.currentmenuname == "credits3") else if (game.currentmenuname == Menu::credits3)
{ {
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
@ -784,12 +784,12 @@ void menuactionpress()
{ {
// No more super patrons. Move to the next credits section // No more super patrons. Move to the next credits section
game.current_credits_list_index = 0; game.current_credits_list_index = 0;
game.createmenu("credits4"); game.createmenu(Menu::credits4);
} }
else else
{ {
// There are more super patrons. Refresh the menu with the next ones // There are more super patrons. Refresh the menu with the next ones
game.createmenu("credits3"); game.createmenu(Menu::credits3);
} }
map.nexttowercolour(); map.nexttowercolour();
@ -798,12 +798,12 @@ void menuactionpress()
//back //back
music.playef(11); music.playef(11);
game.current_credits_list_index = 0; game.current_credits_list_index = 0;
game.createmenu("mainmenu"); game.createmenu(Menu::mainmenu);
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} }
else if (game.currentmenuname == "credits4") else if (game.currentmenuname == Menu::credits4)
{ {
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
@ -816,12 +816,12 @@ void menuactionpress()
{ {
// No more patrons. Move to the next credits section // No more patrons. Move to the next credits section
game.current_credits_list_index = 0; game.current_credits_list_index = 0;
game.createmenu("credits5"); game.createmenu(Menu::credits5);
} }
else else
{ {
// There are more patrons. Refresh the menu with the next ones // There are more patrons. Refresh the menu with the next ones
game.createmenu("credits4"); game.createmenu(Menu::credits4);
} }
map.nexttowercolour(); map.nexttowercolour();
@ -830,12 +830,12 @@ void menuactionpress()
//back //back
music.playef(11); music.playef(11);
game.current_credits_list_index = 0; game.current_credits_list_index = 0;
game.createmenu("mainmenu"); game.createmenu(Menu::mainmenu);
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} }
else if (game.currentmenuname == "credits5") else if (game.currentmenuname == Menu::credits5)
{ {
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
@ -848,12 +848,12 @@ void menuactionpress()
{ {
// No more GitHub contributors. Move to the next credits section // No more GitHub contributors. Move to the next credits section
game.current_credits_list_index = 0; game.current_credits_list_index = 0;
game.createmenu("credits6"); game.createmenu(Menu::credits6);
} }
else else
{ {
// There are more GitHub contributors. Refresh the menu with the next ones // There are more GitHub contributors. Refresh the menu with the next ones
game.createmenu("credits5"); game.createmenu(Menu::credits5);
} }
map.nexttowercolour(); map.nexttowercolour();
@ -862,31 +862,31 @@ void menuactionpress()
//back //back
music.playef(11); music.playef(11);
game.current_credits_list_index = 0; game.current_credits_list_index = 0;
game.createmenu("mainmenu"); game.createmenu(Menu::mainmenu);
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} }
else if (game.currentmenuname == "credits6") else if (game.currentmenuname == Menu::credits6)
{ {
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
//first page //first page
music.playef(11); music.playef(11);
game.createmenu("credits"); game.createmenu(Menu::credits);
map.nexttowercolour(); map.nexttowercolour();
break; break;
default: default:
//back //back
music.playef(11); music.playef(11);
game.createmenu("mainmenu"); game.createmenu(Menu::mainmenu);
map.nexttowercolour(); map.nexttowercolour();
music.niceplay(6); music.niceplay(6);
break; break;
} }
} }
else if (game.currentmenuname == "play") else if (game.currentmenuname == Menu::play)
{ {
//Do we have the Secret Lab option? //Do we have the Secret Lab option?
int offset = game.unlock[8] ? 0 : -1; int offset = game.unlock[8] ? 0 : -1;
@ -911,7 +911,7 @@ void menuactionpress()
//go to a menu! //go to a menu!
music.playef(11); music.playef(11);
game.loadsummary(); //Prepare save slots to display game.loadsummary(); //Prepare save slots to display
game.createmenu("continue"); game.createmenu(Menu::continuemenu);
map.settowercolour(3); map.settowercolour(3);
} }
} }
@ -929,25 +929,25 @@ void menuactionpress()
{ {
//play modes //play modes
music.playef(11); music.playef(11);
game.createmenu("playmodes"); game.createmenu(Menu::playmodes);
map.nexttowercolour(); map.nexttowercolour();
} }
else if (game.currentmenuoption == offset+3) else if (game.currentmenuoption == offset+3)
{ {
//newgame //newgame
music.playef(11); music.playef(11);
game.createmenu("newgamewarning"); game.createmenu(Menu::newgamewarning);
map.nexttowercolour(); map.nexttowercolour();
} }
else if (game.currentmenuoption == offset+4) else if (game.currentmenuoption == offset+4)
{ {
//back //back
music.playef(11); music.playef(11);
game.createmenu("mainmenu"); game.createmenu(Menu::mainmenu);
map.nexttowercolour(); map.nexttowercolour();
} }
} }
else if (game.currentmenuname == "newgamewarning") else if (game.currentmenuname == Menu::newgamewarning)
{ {
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
@ -961,13 +961,13 @@ void menuactionpress()
default: default:
//back //back
music.playef(11); music.playef(11);
game.createmenu("play"); game.createmenu(Menu::play);
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} }
else if (game.currentmenuname == "controller") else if (game.currentmenuname == Menu::controller)
{ {
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
@ -982,18 +982,18 @@ void menuactionpress()
case 4: case 4:
music.playef(11); music.playef(11);
game.createmenu("options"); game.createmenu(Menu::options);
break; break;
} }
} }
else if (game.currentmenuname == "cleardatamenu") else if (game.currentmenuname == Menu::cleardatamenu)
{ {
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
//back //back
music.playef(11); music.playef(11);
game.createmenu("options"); game.createmenu(Menu::options);
map.nexttowercolour(); map.nexttowercolour();
break; break;
default: default:
@ -1004,30 +1004,30 @@ void menuactionpress()
game.deletestats(); game.deletestats();
game.flashlight = 5; game.flashlight = 5;
game.screenshake = 15; game.screenshake = 15;
game.createmenu("mainmenu"); game.createmenu(Menu::mainmenu);
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} }
else if (game.currentmenuname == "playmodes") else if (game.currentmenuname == Menu::playmodes)
{ {
if (game.currentmenuoption == 0 && game.slowdown == 30 && !map.invincibility) //go to the time trial menu if (game.currentmenuoption == 0 && game.slowdown == 30 && !map.invincibility) //go to the time trial menu
{ {
music.playef(11); music.playef(11);
game.createmenu("timetrials"); game.createmenu(Menu::timetrials);
map.nexttowercolour(); map.nexttowercolour();
} }
else if (game.currentmenuoption == 1 && game.unlock[16]) else if (game.currentmenuoption == 1 && game.unlock[16])
{ {
//intermission mode menu //intermission mode menu
music.playef(11); music.playef(11);
game.createmenu("intermissionmenu"); game.createmenu(Menu::intermissionmenu);
map.nexttowercolour(); map.nexttowercolour();
} }
else if (game.currentmenuoption == 2 && game.unlock[17] && game.slowdown == 30 && !map.invincibility) //start a game in no death mode else if (game.currentmenuoption == 2 && game.unlock[17] && game.slowdown == 30 && !map.invincibility) //start a game in no death mode
{ {
music.playef(11); music.playef(11);
game.createmenu("startnodeathmode"); game.createmenu(Menu::startnodeathmode);
map.nexttowercolour(); map.nexttowercolour();
} }
else if (game.currentmenuoption == 3 && game.unlock[18]) //enable/disable flip mode else if (game.currentmenuoption == 3 && game.unlock[18]) //enable/disable flip mode
@ -1042,7 +1042,7 @@ void menuactionpress()
{ {
//back //back
music.playef(11); music.playef(11);
game.createmenu("play"); game.createmenu(Menu::play);
map.nexttowercolour(); map.nexttowercolour();
} }
else else
@ -1051,7 +1051,7 @@ void menuactionpress()
music.playef(2); music.playef(2);
} }
} }
else if (game.currentmenuname == "startnodeathmode") else if (game.currentmenuname == Menu::startnodeathmode)
{ {
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
@ -1066,12 +1066,12 @@ void menuactionpress()
case 2: case 2:
//back //back
music.playef(11); music.playef(11);
game.createmenu("play"); game.createmenu(Menu::play);
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} }
else if (game.currentmenuname == "continue") else if (game.currentmenuname == Menu::continuemenu)
{ {
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
@ -1086,36 +1086,36 @@ void menuactionpress()
case 2: case 2:
//back //back
music.playef(11); music.playef(11);
game.createmenu("play"); game.createmenu(Menu::play);
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} }
else if (game.currentmenuname == "intermissionmenu") else if (game.currentmenuname == Menu::intermissionmenu)
{ {
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
music.playef(11); music.playef(11);
music.play(6); music.play(6);
game.createmenu("playint1"); game.createmenu(Menu::playint1);
map.nexttowercolour(); map.nexttowercolour();
break; break;
case 1: case 1:
music.playef(11); music.playef(11);
music.play(6); music.play(6);
game.createmenu("playint2"); game.createmenu(Menu::playint2);
map.nexttowercolour(); map.nexttowercolour();
break; break;
case 2: case 2:
//back //back
music.playef(11); music.playef(11);
game.createmenu("play"); game.createmenu(Menu::play);
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} }
else if (game.currentmenuname == "playint1") else if (game.currentmenuname == Menu::playint1)
{ {
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
@ -1138,12 +1138,12 @@ void menuactionpress()
case 4: case 4:
//back //back
music.playef(11); music.playef(11);
game.createmenu("play"); game.createmenu(Menu::play);
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} }
else if (game.currentmenuname == "playint2") else if (game.currentmenuname == Menu::playint2)
{ {
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
@ -1166,31 +1166,31 @@ void menuactionpress()
case 4: case 4:
//back //back
music.playef(11); music.playef(11);
game.createmenu("play"); game.createmenu(Menu::play);
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} }
else if (game.currentmenuname == "gameover2") else if (game.currentmenuname == Menu::gameover2)
{ {
//back //back
music.playef(11); music.playef(11);
music.play(6); music.play(6);
game.createmenu("mainmenu"); game.createmenu(Menu::mainmenu);
map.nexttowercolour(); map.nexttowercolour();
} }
else if (game.currentmenuname == "unlocktimetrials" else if (game.currentmenuname == Menu::unlocktimetrials
|| game.currentmenuname == "unlocktimetrial" || game.currentmenuname == Menu::unlocktimetrial
|| game.currentmenuname == "unlocknodeathmode" || game.currentmenuname == Menu::unlocknodeathmode
|| game.currentmenuname == "unlockintermission" || game.currentmenuname == Menu::unlockintermission
|| game.currentmenuname == "unlockflipmode") || game.currentmenuname == Menu::unlockflipmode)
{ {
//back //back
music.playef(11); music.playef(11);
game.createmenu("play"); game.createmenu(Menu::play);
map.nexttowercolour(); map.nexttowercolour();
} }
else if (game.currentmenuname == "timetrials") else if (game.currentmenuname == Menu::timetrials)
{ {
if (game.currentmenuoption == 0 && game.unlock[9]) //space station 1 if (game.currentmenuoption == 0 && game.unlock[9]) //space station 1
{ {
@ -1226,7 +1226,7 @@ void menuactionpress()
{ {
//back //back
music.playef(11); music.playef(11);
game.createmenu("play"); game.createmenu(Menu::play);
map.nexttowercolour(); map.nexttowercolour();
} }
else else
@ -1235,7 +1235,7 @@ void menuactionpress()
music.playef(2); music.playef(2);
} }
} }
else if (game.currentmenuname == "timetrialcomplete3") else if (game.currentmenuname == Menu::timetrialcomplete3)
{ {
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
@ -1243,7 +1243,7 @@ void menuactionpress()
//back //back
music.playef(11); music.playef(11);
music.play(6); music.play(6);
game.createmenu("play"); game.createmenu(Menu::play);
map.nexttowercolour(); map.nexttowercolour();
break; break;
case 1: case 1:
@ -1281,11 +1281,11 @@ void menuactionpress()
break; break;
} }
} }
else if (game.currentmenuname == "gamecompletecontinue" || game.currentmenuname == "nodeathmodecomplete2") else if (game.currentmenuname == Menu::gamecompletecontinue || game.currentmenuname == Menu::nodeathmodecomplete2)
{ {
music.play(6); music.play(6);
music.playef(11); music.playef(11);
game.createmenu("play"); game.createmenu(Menu::play);
map.nexttowercolour(); map.nexttowercolour();
} }
} }
@ -1334,11 +1334,11 @@ void titleinput()
game.jumpheld = true; game.jumpheld = true;
} }
if (key.isDown(27) && game.currentmenuname != "youwannaquit" && game.menustart) if (key.isDown(27) && game.currentmenuname != Menu::youwannaquit && game.menustart)
{ {
music.playef(11); music.playef(11);
game.previousmenuname = game.currentmenuname; game.previousmenuname = game.currentmenuname;
game.createmenu("youwannaquit"); game.createmenu(Menu::youwannaquit);
map.nexttowercolour(); map.nexttowercolour();
} }
@ -1374,7 +1374,7 @@ void titleinput()
menuactionpress(); menuactionpress();
} }
} }
if ( game.currentmenuname == "controller" && if ( game.currentmenuname == Menu::controller &&
game.currentmenuoption > 0 && game.currentmenuoption > 0 &&
game.currentmenuoption < 4 && game.currentmenuoption < 4 &&
key.controllerButtonDown() ) key.controllerButtonDown() )

View file

@ -18,15 +18,15 @@ void titlelogic()
game.menucountdown--; game.menucountdown--;
if (game.menucountdown == 0) if (game.menucountdown == 0)
{ {
if (game.menudest == "mainmenu") if (game.menudest == Menu::mainmenu)
{ {
music.play(6); music.play(6);
} }
else if (game.menudest == "gameover2") else if (game.menudest == Menu::gameover2)
{ {
music.playef(11); music.playef(11);
} }
else if (game.menudest == "timetrialcomplete3") else if (game.menudest == Menu::timetrialcomplete3)
{ {
music.playef(3); music.playef(3);
} }
@ -109,7 +109,7 @@ void gamecompletelogic2()
game.gamestate = 1; game.gamestate = 1;
graphics.fademode = 4; graphics.fademode = 4;
music.playef(18); music.playef(18);
game.createmenu("gamecompletecontinue"); game.createmenu(Menu::gamecompletecontinue);
map.nexttowercolour(); map.nexttowercolour();
} }
} }

View file

@ -20,7 +20,7 @@ void menurender()
{ {
int temp = 50; int temp = 50;
if(game.currentmenuname=="mainmenu") if(game.currentmenuname==Menu::mainmenu)
{ {
graphics.drawsprite((160 - 96) + 0 * 32, temp, 23, tr, tg, tb); graphics.drawsprite((160 - 96) + 0 * 32, temp, 23, tr, tg, tb);
graphics.drawsprite((160 - 96) + 1 * 32, temp, 23, tr, tg, tb); graphics.drawsprite((160 - 96) + 1 * 32, temp, 23, tr, tg, tb);
@ -38,7 +38,7 @@ void menurender()
} }
} }
#if !defined(NO_CUSTOM_LEVELS) #if !defined(NO_CUSTOM_LEVELS)
else if (game.currentmenuname == "levellist") else if (game.currentmenuname == Menu::levellist)
{ {
if(ed.ListOfMetaData.size()==0){ if(ed.ListOfMetaData.size()==0){
graphics.Print( -1, 100, "ERROR: No levels found.", tr, tg, tb, true); graphics.Print( -1, 100, "ERROR: No levels found.", tr, tg, tb, true);
@ -59,12 +59,12 @@ void menurender()
} }
} }
#endif #endif
else if (game.currentmenuname == "errornostart") else if (game.currentmenuname == Menu::errornostart)
{ {
graphics.Print( -1, 65, "ERROR: This level has", tr, tg, tb, true); graphics.Print( -1, 65, "ERROR: This level has", tr, tg, tb, true);
graphics.Print( -1, 75, "no start point!", tr, tg, tb, true); graphics.Print( -1, 75, "no start point!", tr, tg, tb, true);
} }
else if (game.currentmenuname == "options") else if (game.currentmenuname == Menu::options)
{ {
#if defined(MAKEANDPLAY) #if defined(MAKEANDPLAY)
#define OFFSET -1 #define OFFSET -1
@ -110,7 +110,7 @@ void menurender()
} }
#undef OFFSET #undef OFFSET
} }
else if (game.currentmenuname == "graphicoptions") else if (game.currentmenuname == Menu::graphicoptions)
{ {
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
@ -167,7 +167,7 @@ void menurender()
break; break;
} }
} }
else if (game.currentmenuname == "credits") else if (game.currentmenuname == Menu::credits)
{ {
graphics.Print( -1, 50, "VVVVVV is a game by", tr, tg, tb, true); graphics.Print( -1, 50, "VVVVVV is a game by", tr, tg, tb, true);
graphics.bigprint( 40, 65, "Terry Cavanagh", tr, tg, tb, true, 2); graphics.bigprint( 40, 65, "Terry Cavanagh", tr, tg, tb, true, 2);
@ -178,7 +178,7 @@ void menurender()
graphics.bigprint( 40, 135, "Magnus P~lsson", tr, tg, tb, true, 2); graphics.bigprint( 40, 135, "Magnus P~lsson", tr, tg, tb, true, 2);
graphics.drawimagecol(8, -1, 156, tr *0.75, tg *0.75, tb *0.75, true); graphics.drawimagecol(8, -1, 156, tr *0.75, tg *0.75, tb *0.75, true);
} }
else if (game.currentmenuname == "credits2") else if (game.currentmenuname == Menu::credits2)
{ {
graphics.Print( -1, 50, "Roomnames are by", tr, tg, tb, true); graphics.Print( -1, 50, "Roomnames are by", tr, tg, tb, true);
graphics.bigprint( 40, 65, "Bennett Foddy", tr, tg, tb, true); graphics.bigprint( 40, 65, "Bennett Foddy", tr, tg, tb, true);
@ -187,7 +187,7 @@ void menurender()
graphics.bigprint( 40, 125, "Simon Roth", tr, tg, tb, true); graphics.bigprint( 40, 125, "Simon Roth", tr, tg, tb, true);
graphics.bigprint( 40, 145, "Ethan Lee", tr, tg, tb, true); graphics.bigprint( 40, 145, "Ethan Lee", tr, tg, tb, true);
} }
else if (game.currentmenuname == "credits25") else if (game.currentmenuname == Menu::credits25)
{ {
graphics.Print( -1, 40, "Beta Testing by", tr, tg, tb, true); graphics.Print( -1, 40, "Beta Testing by", tr, tg, tb, true);
graphics.bigprint( 40, 55, "Sam Kaplan", tr, tg, tb, true); graphics.bigprint( 40, 55, "Sam Kaplan", tr, tg, tb, true);
@ -195,7 +195,7 @@ void menurender()
graphics.Print( -1, 130, "Ending Picture by", tr, tg, tb, true); graphics.Print( -1, 130, "Ending Picture by", tr, tg, tb, true);
graphics.bigprint( 40, 145, "Pauli Kohberger", tr, tg, tb, true); graphics.bigprint( 40, 145, "Pauli Kohberger", tr, tg, tb, true);
} }
else if (game.currentmenuname == "credits3") else if (game.currentmenuname == Menu::credits3)
{ {
graphics.Print( -1, 20, "VVVVVV is supported by", tr, tg, tb, true); graphics.Print( -1, 20, "VVVVVV is supported by", tr, tg, tb, true);
graphics.Print( 40, 30, "the following patrons", tr, tg, tb, true); graphics.Print( 40, 30, "the following patrons", tr, tg, tb, true);
@ -213,7 +213,7 @@ void menurender()
yofs += 14; yofs += 14;
} }
} }
else if (game.currentmenuname == "credits4") else if (game.currentmenuname == Menu::credits4)
{ {
graphics.Print( -1, 20, "and also by", tr, tg, tb, true); graphics.Print( -1, 20, "and also by", tr, tg, tb, true);
@ -232,7 +232,7 @@ void menurender()
yofs += 10; yofs += 10;
} }
} }
else if (game.currentmenuname == "credits5") else if (game.currentmenuname == Menu::credits5)
{ {
graphics.Print( -1, 20, "With contributions on", tr, tg, tb, true); graphics.Print( -1, 20, "With contributions on", tr, tg, tb, true);
graphics.Print( 40, 30, "GitHub from", tr, tg, tb, true); graphics.Print( 40, 30, "GitHub from", tr, tg, tb, true);
@ -254,7 +254,7 @@ void menurender()
yofs += 14; yofs += 14;
} }
} }
else if (game.currentmenuname == "credits6") else if (game.currentmenuname == Menu::credits6)
{ {
graphics.Print( -1, 20, "and thanks also to:", tr, tg, tb, true); graphics.Print( -1, 20, "and thanks also to:", tr, tg, tb, true);
@ -267,19 +267,19 @@ void menurender()
graphics.Print( 80, 150,"Thank you!", tr, tg, tb,true); graphics.Print( 80, 150,"Thank you!", tr, tg, tb,true);
} }
else if (game.currentmenuname == "setinvincibility") else if (game.currentmenuname == Menu::setinvincibility)
{ {
graphics.Print( -1, 100, "Are you sure you want to ", tr, tg, tb, true); graphics.Print( -1, 100, "Are you sure you want to ", tr, tg, tb, true);
graphics.Print( -1, 110, "enable invincibility?", tr, tg, tb, true); graphics.Print( -1, 110, "enable invincibility?", tr, tg, tb, true);
} }
else if (game.currentmenuname == "setslowdown1") else if (game.currentmenuname == Menu::setslowdown1)
{ {
graphics.Print( -1, 90, "Warning! Changing the game speed", tr, tg, tb, true); graphics.Print( -1, 90, "Warning! Changing the game speed", tr, tg, tb, true);
graphics.Print( -1, 100, "requires a game restart, and will", tr, tg, tb, true); graphics.Print( -1, 100, "requires a game restart, and will", tr, tg, tb, true);
graphics.Print( -1, 110, "delete your current saves.", tr, tg, tb, true); graphics.Print( -1, 110, "delete your current saves.", tr, tg, tb, true);
graphics.Print( -1, 120, "Is this ok?", tr, tg, tb, true); graphics.Print( -1, 120, "Is this ok?", tr, tg, tb, true);
} }
else if (game.currentmenuname == "setslowdown2") else if (game.currentmenuname == Menu::setslowdown2)
{ {
graphics.bigprint( -1, 40, "Game Speed", tr, tg, tb, true); graphics.bigprint( -1, 40, "Game Speed", tr, tg, tb, true);
graphics.Print( -1, 75, "Select a new game speed below.", tr, tg, tb, true); graphics.Print( -1, 75, "Select a new game speed below.", tr, tg, tb, true);
@ -299,24 +299,24 @@ void menurender()
break; break;
} }
} }
else if (game.currentmenuname == "newgamewarning") else if (game.currentmenuname == Menu::newgamewarning)
{ {
graphics.Print( -1, 100, "Are you sure? This will", tr, tg, tb, true); graphics.Print( -1, 100, "Are you sure? This will", tr, tg, tb, true);
graphics.Print( -1, 110, "delete your current saves...", tr, tg, tb, true); graphics.Print( -1, 110, "delete your current saves...", tr, tg, tb, true);
} }
else if (game.currentmenuname == "cleardatamenu") else if (game.currentmenuname == Menu::cleardatamenu)
{ {
graphics.Print( -1, 100, "Are you sure you want to", tr, tg, tb, true); graphics.Print( -1, 100, "Are you sure you want to", tr, tg, tb, true);
graphics.Print( -1, 110, "delete all your saved data?", tr, tg, tb, true); graphics.Print( -1, 110, "delete all your saved data?", tr, tg, tb, true);
} }
else if (game.currentmenuname == "startnodeathmode") else if (game.currentmenuname == Menu::startnodeathmode)
{ {
graphics.Print( -1, 45, "Good luck!", tr, tg, tb, true); graphics.Print( -1, 45, "Good luck!", tr, tg, tb, true);
graphics.Print( -1, 80, "You cannot save in this mode.", tr, tg, tb, true); graphics.Print( -1, 80, "You cannot save in this mode.", tr, tg, tb, true);
graphics.Print( -1, 100, "Would you like to disable the", tr, tg, tb, true); graphics.Print( -1, 100, "Would you like to disable the", tr, tg, tb, true);
graphics.Print( -1, 112, "cutscenes during the game?", tr, tg, tb, true); graphics.Print( -1, 112, "cutscenes during the game?", tr, tg, tb, true);
} }
else if (game.currentmenuname == "controller") else if (game.currentmenuname == Menu::controller)
{ {
graphics.bigprint( -1, 30, "Game Pad", tr, tg, tb, true); graphics.bigprint( -1, 30, "Game Pad", tr, tg, tb, true);
graphics.Print( -1, 55, "Change controller options.", tr, tg, tb, true); graphics.Print( -1, 55, "Change controller options.", tr, tg, tb, true);
@ -358,7 +358,7 @@ void menurender()
} }
else if (game.currentmenuname == "accessibility") else if (game.currentmenuname == Menu::accessibility)
{ {
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
@ -450,12 +450,12 @@ void menurender()
break; break;
} }
} }
else if (game.currentmenuname == "playint1" || game.currentmenuname == "playint2") else if (game.currentmenuname == Menu::playint1 || game.currentmenuname == Menu::playint2)
{ {
graphics.Print( -1, 65, "Who do you want to play", tr, tg, tb, true); graphics.Print( -1, 65, "Who do you want to play", tr, tg, tb, true);
graphics.Print( -1, 75, "the level with?", tr, tg, tb, true); graphics.Print( -1, 75, "the level with?", tr, tg, tb, true);
} }
else if (game.currentmenuname == "playmodes") else if (game.currentmenuname == Menu::playmodes)
{ {
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
@ -519,11 +519,11 @@ void menurender()
break; break;
} }
} }
else if (game.currentmenuname == "youwannaquit") else if (game.currentmenuname == Menu::youwannaquit)
{ {
graphics.Print( -1, 75, "Are you sure you want to quit?", tr, tg, tb, true); graphics.Print( -1, 75, "Are you sure you want to quit?", tr, tg, tb, true);
} }
else if (game.currentmenuname == "continue") else if (game.currentmenuname == Menu::continuemenu)
{ {
graphics.crewframedelay--; graphics.crewframedelay--;
if (graphics.crewframedelay <= 0) if (graphics.crewframedelay <= 0)
@ -567,7 +567,7 @@ void menurender()
break; break;
} }
} }
else if (game.currentmenuname == "gameover" || game.currentmenuname == "gameover2") else if (game.currentmenuname == Menu::gameover || game.currentmenuname == Menu::gameover2)
{ {
graphics.bigprint( -1, 25, "GAME OVER", tr, tg, tb, true, 3); graphics.bigprint( -1, 25, "GAME OVER", tr, tg, tb, true, 3);
@ -616,7 +616,7 @@ void menurender()
graphics.Print(0, 190, tempstring, tr, tg, tb, true); graphics.Print(0, 190, tempstring, tr, tg, tb, true);
} }
else if (game.currentmenuname == "nodeathmodecomplete" || game.currentmenuname == "nodeathmodecomplete2") else if (game.currentmenuname == Menu::nodeathmodecomplete || game.currentmenuname == Menu::nodeathmodecomplete2)
{ {
graphics.bigprint( -1, 8, "WOW", tr, tg, tb, true, 4); graphics.bigprint( -1, 8, "WOW", tr, tg, tb, true, 4);
@ -640,8 +640,8 @@ void menurender()
graphics.Print(0, 170, "placed in the secret lab to", tr, tg, tb, true); graphics.Print(0, 170, "placed in the secret lab to", tr, tg, tb, true);
graphics.Print(0, 180, "acknowledge your achievement!", tr, tg, tb, true); graphics.Print(0, 180, "acknowledge your achievement!", tr, tg, tb, true);
} }
else if (game.currentmenuname == "timetrialcomplete" || game.currentmenuname == "timetrialcomplete2" else if (game.currentmenuname == Menu::timetrialcomplete || game.currentmenuname == Menu::timetrialcomplete2
|| game.currentmenuname == "timetrialcomplete3" || game.currentmenuname == "timetrialcomplete4") || game.currentmenuname == Menu::timetrialcomplete3)
{ {
graphics.bigprint( -1, 20, "Results", tr, tg, tb, true, 3); graphics.bigprint( -1, 20, "Results", tr, tg, tb, true, 3);
@ -673,12 +673,12 @@ void menurender()
graphics.Print(220, 85+55, "+1 Rank!", 255, 255, 255); graphics.Print(220, 85+55, "+1 Rank!", 255, 255, 255);
} }
if (game.currentmenuname == "timetrialcomplete2" || game.currentmenuname == "timetrialcomplete3") if (game.currentmenuname == Menu::timetrialcomplete2 || game.currentmenuname == Menu::timetrialcomplete3)
{ {
graphics.bigprint( 100, 175, "Rank:", tr, tg, tb, false, 2); graphics.bigprint( 100, 175, "Rank:", tr, tg, tb, false, 2);
} }
if (game.currentmenuname == "timetrialcomplete3") if (game.currentmenuname == Menu::timetrialcomplete3)
{ {
switch(game.timetrialrank) switch(game.timetrialrank)
{ {
@ -697,13 +697,13 @@ void menurender()
} }
} }
} }
else if (game.currentmenuname == "unlockmenutrials") else if (game.currentmenuname == Menu::unlockmenutrials)
{ {
graphics.bigprint( -1, 30, "Unlock Time Trials", tr, tg, tb, true); graphics.bigprint( -1, 30, "Unlock Time Trials", tr, tg, tb, true);
graphics.Print( -1, 65, "You can unlock each time", tr, tg, tb, true); graphics.Print( -1, 65, "You can unlock each time", tr, tg, tb, true);
graphics.Print( -1, 75, "trial separately.", tr, tg, tb, true); graphics.Print( -1, 75, "trial separately.", tr, tg, tb, true);
} }
else if (game.currentmenuname == "timetrials") else if (game.currentmenuname == Menu::timetrials)
{ {
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
@ -985,7 +985,7 @@ void menurender()
break; break;
} }
} }
else if (game.currentmenuname == "gamecompletecontinue") else if (game.currentmenuname == Menu::gamecompletecontinue)
{ {
graphics.bigprint( -1, 25, "Congratulations!", tr, tg, tb, true, 2); graphics.bigprint( -1, 25, "Congratulations!", tr, tg, tb, true, 2);
@ -995,7 +995,7 @@ void menurender()
graphics.Print( -1, 120, "the game, select CONTINUE", tr, tg, tb, true); graphics.Print( -1, 120, "the game, select CONTINUE", tr, tg, tb, true);
graphics.Print( -1, 130, "from the play menu.", tr, tg, tb, true); graphics.Print( -1, 130, "from the play menu.", tr, tg, tb, true);
} }
else if (game.currentmenuname == "unlockmenu") else if (game.currentmenuname == Menu::unlockmenu)
{ {
graphics.bigprint( -1, 25, "Unlock Play Modes", tr, tg, tb, true, 2); graphics.bigprint( -1, 25, "Unlock Play Modes", tr, tg, tb, true, 2);
@ -1003,41 +1003,41 @@ void menurender()
graphics.Print( -1, 65, "of the game that are normally", tr, tg, tb, true); graphics.Print( -1, 65, "of the game that are normally", tr, tg, tb, true);
graphics.Print( -1, 75, "unlocked as you play.", tr, tg, tb, true); graphics.Print( -1, 75, "unlocked as you play.", tr, tg, tb, true);
} }
else if (game.currentmenuname == "unlocktimetrial") else if (game.currentmenuname == Menu::unlocktimetrial)
{ {
graphics.bigprint( -1, 45, "Congratulations!", tr, tg, tb, true, 2); graphics.bigprint( -1, 45, "Congratulations!", tr, tg, tb, true, 2);
graphics.Print( -1, 125, "You have unlocked", tr, tg, tb, true); graphics.Print( -1, 125, "You have unlocked", tr, tg, tb, true);
graphics.Print( -1, 135, "a new Time Trial.", tr, tg, tb, true); graphics.Print( -1, 135, "a new Time Trial.", tr, tg, tb, true);
} }
else if (game.currentmenuname == "unlocktimetrials") else if (game.currentmenuname == Menu::unlocktimetrials)
{ {
graphics.bigprint( -1, 45, "Congratulations!", tr, tg, tb, true, 2); graphics.bigprint( -1, 45, "Congratulations!", tr, tg, tb, true, 2);
graphics.Print( -1, 125, "You have unlocked some", tr, tg, tb, true); graphics.Print( -1, 125, "You have unlocked some", tr, tg, tb, true);
graphics.Print( -1, 135, "new Time Trials.", tr, tg, tb, true); graphics.Print( -1, 135, "new Time Trials.", tr, tg, tb, true);
} }
else if (game.currentmenuname == "unlocknodeathmode") else if (game.currentmenuname == Menu::unlocknodeathmode)
{ {
graphics.bigprint( -1, 45, "Congratulations!", tr, tg, tb, true, 2); graphics.bigprint( -1, 45, "Congratulations!", tr, tg, tb, true, 2);
graphics.Print( -1, 125, "You have unlocked", tr, tg, tb, true); graphics.Print( -1, 125, "You have unlocked", tr, tg, tb, true);
graphics.Print( -1, 135, "No Death Mode.", tr, tg, tb, true); graphics.Print( -1, 135, "No Death Mode.", tr, tg, tb, true);
} }
else if (game.currentmenuname == "unlockflipmode") else if (game.currentmenuname == Menu::unlockflipmode)
{ {
graphics.bigprint( -1, 45, "Congratulations!", tr, tg, tb, true, 2); graphics.bigprint( -1, 45, "Congratulations!", tr, tg, tb, true, 2);
graphics.Print( -1, 125, "You have unlocked", tr, tg, tb, true); graphics.Print( -1, 125, "You have unlocked", tr, tg, tb, true);
graphics.Print( -1, 135, "Flip Mode.", tr, tg, tb, true); graphics.Print( -1, 135, "Flip Mode.", tr, tg, tb, true);
} }
else if (game.currentmenuname == "unlockintermission") else if (game.currentmenuname == Menu::unlockintermission)
{ {
graphics.bigprint( -1, 45, "Congratulations!", tr, tg, tb, true, 2); graphics.bigprint( -1, 45, "Congratulations!", tr, tg, tb, true, 2);
graphics.Print( -1, 125, "You have unlocked", tr, tg, tb, true); graphics.Print( -1, 125, "You have unlocked", tr, tg, tb, true);
graphics.Print( -1, 135, "the intermission levels.", tr, tg, tb, true); graphics.Print( -1, 135, "the intermission levels.", tr, tg, tb, true);
}else if (game.currentmenuname == "playerworlds") }else if (game.currentmenuname == Menu::playerworlds)
{ {
std::string tempstring = FILESYSTEM_getUserLevelDirectory(); std::string tempstring = FILESYSTEM_getUserLevelDirectory();
if(tempstring.length()>80){ if(tempstring.length()>80){
@ -1109,27 +1109,27 @@ void titlerender()
if(tg>255) tg=255; if(tg>255) tg=255;
if (tb < 0) tb = 0; if (tb < 0) tb = 0;
if(tb>255) tb=255; if(tb>255) tb=255;
if (game.currentmenuname == "timetrials" || game.currentmenuname == "unlockmenutrials") if (game.currentmenuname == Menu::timetrials || game.currentmenuname == Menu::unlockmenutrials)
{ {
graphics.drawmenu(tr, tg, tb, 15); graphics.drawmenu(tr, tg, tb, 15);
} }
else if (game.currentmenuname == "unlockmenu") else if (game.currentmenuname == Menu::unlockmenu)
{ {
graphics.drawmenu(tr, tg, tb, 15); graphics.drawmenu(tr, tg, tb, 15);
} }
else if (game.currentmenuname == "playmodes") else if (game.currentmenuname == Menu::playmodes)
{ {
graphics.drawmenu(tr, tg, tb, 20); graphics.drawmenu(tr, tg, tb, 20);
} }
else if (game.currentmenuname == "mainmenu") else if (game.currentmenuname == Menu::mainmenu)
{ {
graphics.drawmenu(tr, tg, tb, 15); graphics.drawmenu(tr, tg, tb, 15);
} }
else if (game.currentmenuname == "playerworlds") else if (game.currentmenuname == Menu::playerworlds)
{ {
graphics.drawmenu(tr, tg, tb, 15); graphics.drawmenu(tr, tg, tb, 15);
} }
else if (game.currentmenuname == "levellist") else if (game.currentmenuname == Menu::levellist)
{ {
graphics.drawlevelmenu(tr, tg, tb, 5); graphics.drawlevelmenu(tr, tg, tb, 5);
} }

View file

@ -2534,7 +2534,7 @@ void scriptclass::resetgametomenu()
graphics.flipmode = false; graphics.flipmode = false;
obj.entities.clear(); obj.entities.clear();
graphics.fademode = 4; graphics.fademode = 4;
game.createmenu("gameover"); game.createmenu(Menu::gameover);
} }
void scriptclass::startgamemode( int t ) void scriptclass::startgamemode( int t )

View file

@ -2183,11 +2183,11 @@ void editorclass::generatecustomminimap()
void editormenurender(int tr, int tg, int tb) void editormenurender(int tr, int tg, int tb)
{ {
if (game.currentmenuname == "ed_settings") if (game.currentmenuname == Menu::ed_settings)
{ {
graphics.bigprint( -1, 75, "Map Settings", tr, tg, tb, true); graphics.bigprint( -1, 75, "Map Settings", tr, tg, tb, true);
} }
else if (game.currentmenuname=="ed_desc") else if (game.currentmenuname==Menu::ed_desc)
{ {
if(ed.titlemod) if(ed.titlemod)
{ {
@ -2280,7 +2280,7 @@ void editormenurender(int tr, int tg, int tb)
graphics.Print( -1, 110, ed.Desc3, tr, tg, tb, true); graphics.Print( -1, 110, ed.Desc3, tr, tg, tb, true);
} }
} }
else if (game.currentmenuname == "ed_music") else if (game.currentmenuname == Menu::ed_music)
{ {
graphics.bigprint( -1, 65, "Map Music", tr, tg, tb, true); graphics.bigprint( -1, 65, "Map Music", tr, tg, tb, true);
@ -2328,7 +2328,7 @@ void editormenurender(int tr, int tg, int tb)
break; break;
} }
} }
else if (game.currentmenuname == "ed_quit") else if (game.currentmenuname == Menu::ed_quit)
{ {
graphics.bigprint( -1, 90, "Save before", tr, tg, tb, true); graphics.bigprint( -1, 90, "Save before", tr, tg, tb, true);
graphics.bigprint( -1, 110, "quitting?", tr, tg, tb, true); graphics.bigprint( -1, 110, "quitting?", tr, tg, tb, true);
@ -3454,14 +3454,14 @@ void editorlogic()
map.nexttowercolour(); map.nexttowercolour();
ed.settingsmod=false; ed.settingsmod=false;
graphics.backgrounddrawn=false; graphics.backgrounddrawn=false;
game.createmenu("mainmenu"); game.createmenu(Menu::mainmenu);
} }
} }
void editormenuactionpress() void editormenuactionpress()
{ {
if (game.currentmenuname == "ed_desc") if (game.currentmenuname == Menu::ed_desc)
{ {
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
@ -3491,19 +3491,19 @@ void editormenuactionpress()
break; break;
case 4: case 4:
music.playef(11); music.playef(11);
game.createmenu("ed_settings"); game.createmenu(Menu::ed_settings);
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} }
else if (game.currentmenuname == "ed_settings") else if (game.currentmenuname == Menu::ed_settings)
{ {
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
//Change level description stuff //Change level description stuff
music.playef(11); music.playef(11);
game.createmenu("ed_desc"); game.createmenu(Menu::ed_desc);
map.nexttowercolour(); map.nexttowercolour();
break; break;
case 1: case 1:
@ -3522,7 +3522,7 @@ void editormenuactionpress()
break; break;
case 2: case 2:
music.playef(11); music.playef(11);
game.createmenu("ed_music"); game.createmenu(Menu::ed_music);
map.nexttowercolour(); map.nexttowercolour();
if(ed.levmusic>0) music.play(ed.levmusic); if(ed.levmusic>0) music.play(ed.levmusic);
break; break;
@ -3556,12 +3556,12 @@ void editormenuactionpress()
break; break;
case 5: case 5:
music.playef(11); music.playef(11);
game.createmenu("ed_quit"); game.createmenu(Menu::ed_quit);
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} }
else if (game.currentmenuname == "ed_music") else if (game.currentmenuname == Menu::ed_music)
{ {
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
@ -3584,12 +3584,12 @@ void editormenuactionpress()
case 1: case 1:
music.playef(11); music.playef(11);
music.fadeout(); music.fadeout();
game.createmenu("ed_settings"); game.createmenu(Menu::ed_settings);
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} }
else if (game.currentmenuname == "ed_quit") else if (game.currentmenuname == Menu::ed_quit)
{ {
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
@ -3618,7 +3618,7 @@ void editormenuactionpress()
case 2: case 2:
//Go back to editor //Go back to editor
music.playef(11); music.playef(11);
game.createmenu("ed_settings"); game.createmenu(Menu::ed_settings);
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
@ -3701,7 +3701,7 @@ void editorinput()
ed.settingsmod=!ed.settingsmod; ed.settingsmod=!ed.settingsmod;
graphics.backgrounddrawn=false; graphics.backgrounddrawn=false;
game.createmenu("ed_settings"); game.createmenu(Menu::ed_settings);
map.nexttowercolour(); map.nexttowercolour();
} }
} }