1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2025-01-08 18:09:45 +01:00

Turn game.currentmenuname "else-if"s into case-switches

Much more stylistic, you don't need to repeat "game.currentmenuname" for
each case, and you don't need to deal with the dangling first "if" that
doesn't have an "else".
This commit is contained in:
Misa 2020-04-16 15:19:17 -07:00 committed by Ethan Lee
parent ceb8d3f3d8
commit 9e99246e02
4 changed files with 280 additions and 356 deletions

View file

@ -6551,8 +6551,9 @@ void Game::createmenu( enum Menu::MenuName t )
menucountdown = 0; menucountdown = 0;
menuoptions.clear(); menuoptions.clear();
if (t == Menu::mainmenu) switch (t)
{ {
case Menu::mainmenu:
#if !defined(MAKEANDPLAY) #if !defined(MAKEANDPLAY)
option("start game"); option("start game");
#endif #endif
@ -6567,10 +6568,9 @@ void Game::createmenu( enum Menu::MenuName t )
option("quit game"); option("quit game");
menuxoff = -16; menuxoff = -16;
menuyoff = -10; menuyoff = -10;
} break;
#if !defined(NO_CUSTOM_LEVELS) #if !defined(NO_CUSTOM_LEVELS)
else if (t == Menu::playerworlds) case Menu::playerworlds:
{
option("play a level"); option("play a level");
#if !defined(NO_EDITOR) #if !defined(NO_EDITOR)
option("level editor"); option("level editor");
@ -6579,9 +6579,8 @@ void Game::createmenu( enum Menu::MenuName t )
option("back to menu"); option("back to menu");
menuxoff = -30; menuxoff = -30;
menuyoff = -40; menuyoff = -40;
} break;
else if (t == Menu::levellist) case Menu::levellist:
{
if(ed.ListOfMetaData.size()==0) if(ed.ListOfMetaData.size()==0)
{ {
option("ok"); option("ok");
@ -6641,31 +6640,27 @@ void Game::createmenu( enum Menu::MenuName t )
menuxoff = -90; menuxoff = -90;
menuyoff = 70-(menuoptions.size()*10); menuyoff = 70-(menuoptions.size()*10);
} }
} break;
#endif #endif
else if (t == Menu::quickloadlevel) case Menu::quickloadlevel:
{
option("continue from save"); option("continue from save");
option("start from beginning"); option("start from beginning");
option("back to levels"); option("back to levels");
menuxoff = -40; menuxoff = -40;
menuyoff = -30; menuyoff = -30;
} break;
else if (t == Menu::youwannaquit) case Menu::youwannaquit:
{
option("yes, quit"); option("yes, quit");
option("no, return"); option("no, return");
menuxoff = 0; menuxoff = 0;
menuyoff = -20; menuyoff = -20;
} break;
else if (t == Menu::errornostart) case Menu::errornostart:
{
option("ok"); option("ok");
menuxoff = 0; menuxoff = 0;
menuyoff = -20; menuyoff = -20;
} break;
else if (t == Menu::graphicoptions) case Menu::graphicoptions:
{
option("toggle fullscreen"); option("toggle fullscreen");
option("toggle letterbox"); option("toggle letterbox");
option("toggle filter"); option("toggle filter");
@ -6674,9 +6669,8 @@ void Game::createmenu( enum Menu::MenuName t )
option("return"); option("return");
menuxoff = -50; menuxoff = -50;
menuyoff = 8; menuyoff = 8;
} break;
else if (t == Menu::ed_settings) case Menu::ed_settings:
{
option("change description"); option("change description");
option("edit scripts"); option("edit scripts");
option("change music"); option("change music");
@ -6686,9 +6680,8 @@ void Game::createmenu( enum Menu::MenuName t )
menuxoff = -50; menuxoff = -50;
menuyoff = -20; menuyoff = -20;
} break;
else if (t == Menu::ed_desc) case Menu::ed_desc:
{
option("change name"); option("change name");
option("change author"); option("change author");
option("change description"); option("change description");
@ -6697,24 +6690,21 @@ void Game::createmenu( enum Menu::MenuName t )
menuxoff = -40; menuxoff = -40;
menuyoff = 6; menuyoff = 6;
} break;
else if (t == Menu::ed_music) case Menu::ed_music:
{
option("next song"); option("next song");
option("back"); option("back");
menuxoff = -10; menuxoff = -10;
menuyoff = 16; menuyoff = 16;
} break;
else if (t == Menu::ed_quit) case Menu::ed_quit:
{
option("yes, save and quit"); option("yes, save and quit");
option("no, quit without saving"); option("no, quit without saving");
option("return to editor"); option("return to editor");
menuxoff = -50; menuxoff = -50;
menuyoff = 8; menuyoff = 8;
} break;
else if (t == Menu::options) case Menu::options:
{
option("accessibility options"); option("accessibility options");
#if !defined(MAKEANDPLAY) #if !defined(MAKEANDPLAY)
option("unlock play modes"); option("unlock play modes");
@ -6729,9 +6719,8 @@ void Game::createmenu( enum Menu::MenuName t )
option("return"); option("return");
menuxoff = -40; menuxoff = -40;
menuyoff = 0; menuyoff = 0;
} break;
else if (t == Menu::accessibility) case Menu::accessibility:
{
option("animated backgrounds"); option("animated backgrounds");
option("screen effects"); option("screen effects");
option("text outline"); option("text outline");
@ -6742,9 +6731,8 @@ void Game::createmenu( enum Menu::MenuName t )
option("return"); option("return");
menuxoff = -85; menuxoff = -85;
menuyoff = -10; menuyoff = -10;
} break;
else if(t == Menu::controller) case Menu::controller:
{
option("analog stick sensitivity"); option("analog stick sensitivity");
option("bind flip"); option("bind flip");
option("bind enter"); option("bind enter");
@ -6752,39 +6740,34 @@ void Game::createmenu( enum Menu::MenuName t )
option("return"); option("return");
menuxoff = -40; menuxoff = -40;
menuyoff = 10; menuyoff = 10;
} break;
else if (t == Menu::cleardatamenu) case 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;
} break;
else if (t == Menu::setinvincibility) case 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;
} break;
else if (t == Menu::setslowdown1) case 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;
} break;
else if (t == Menu::setslowdown2) case Menu::setslowdown2:
{
option("normal speed"); option("normal speed");
option("80% speed"); option("80% speed");
option("60% speed"); option("60% speed");
option("40% speed"); option("40% speed");
menuxoff = -40; menuxoff = -40;
menuyoff = 16; menuyoff = 16;
} break;
else if (t == Menu::unlockmenu) case Menu::unlockmenu:
{
option("unlock time trials"); option("unlock time trials");
option("unlock intermissions", !unlock[16]); option("unlock intermissions", !unlock[16]);
option("unlock no death mode", !unlock[17]); option("unlock no death mode", !unlock[17]);
@ -6794,58 +6777,50 @@ void Game::createmenu( enum Menu::MenuName t )
option("return"); option("return");
menuxoff = -70; menuxoff = -70;
menuyoff = -20; menuyoff = -20;
} break;
else if (t == Menu::credits) case Menu::credits:
{
option("next page"); option("next page");
option("return"); option("return");
menuxoff = 20; menuxoff = 20;
menuyoff = 64; menuyoff = 64;
} break;
else if (t == Menu::credits2) case Menu::credits2:
{
option("next page"); option("next page");
option("return"); option("return");
menuxoff = 20; menuxoff = 20;
menuyoff = 64; menuyoff = 64;
} break;
else if (t == Menu::credits25) case Menu::credits25:
{
option("next page"); option("next page");
option("return"); option("return");
menuxoff = 20; menuxoff = 20;
menuyoff = 64; menuyoff = 64;
} break;
else if (t == Menu::credits3) case Menu::credits3:
{
option("next page"); option("next page");
option("return"); option("return");
menuxoff = 20; menuxoff = 20;
menuyoff = 64; menuyoff = 64;
} break;
else if (t == Menu::credits4) case Menu::credits4:
{
option("next page"); option("next page");
option("return"); option("return");
menuxoff = 20; menuxoff = 20;
menuyoff = 64; menuyoff = 64;
} break;
else if (t == Menu::credits5) case Menu::credits5:
{
option("next page"); option("next page");
option("return"); option("return");
menuxoff = 20; menuxoff = 20;
menuyoff = 64; menuyoff = 64;
} break;
else if (t == Menu::credits6) case Menu::credits6:
{
option("first page"); option("first page");
option("return"); option("return");
menuxoff = 20; menuxoff = 20;
menuyoff = 64; menuyoff = 64;
} break;
else if (t == Menu::play) case 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:
temp = 0; temp = 0;
@ -6957,26 +6932,23 @@ void Game::createmenu( enum Menu::MenuName t )
} }
} }
} }
} break;
else if (t == Menu::unlocktimetrial case Menu::unlocktimetrial:
|| t == Menu::unlocktimetrials case Menu::unlocktimetrials:
|| t == Menu::unlocknodeathmode case Menu::unlocknodeathmode:
|| t == Menu::unlockintermission case Menu::unlockintermission:
|| t == Menu::unlockflipmode) case Menu::unlockflipmode:
{
option("continue"); option("continue");
menuxoff = 20; menuxoff = 20;
menuyoff = 70; menuyoff = 70;
} break;
else if (t == Menu::newgamewarning) case 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;
} break;
else if (t == Menu::playmodes) case 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]);
option("no death mode", unlock[17] && !map.invincibility && game.slowdown == 30); option("no death mode", unlock[17] && !map.invincibility && game.slowdown == 30);
@ -6984,17 +6956,15 @@ void Game::createmenu( enum Menu::MenuName t )
option("return to play menu"); option("return to play menu");
menuxoff = -70; menuxoff = -70;
menuyoff = 8; menuyoff = 8;
} break;
else if (t == Menu::intermissionmenu) case Menu::intermissionmenu:
{
option("play intermission 1"); option("play intermission 1");
option("play intermission 2"); option("play intermission 2");
option("return to play menu"); option("return to play menu");
menuxoff = -50; menuxoff = -50;
menuyoff = -35; menuyoff = -35;
} break;
else if (t == Menu::playint1) case Menu::playint1:
{
option("Vitellary"); option("Vitellary");
option("Vermilion"); option("Vermilion");
option("Verdigris"); option("Verdigris");
@ -7002,9 +6972,8 @@ void Game::createmenu( enum Menu::MenuName t )
option("return"); option("return");
menuxoff = -60; menuxoff = -60;
menuyoff = 10; menuyoff = 10;
} break;
else if (t == Menu::playint2) case Menu::playint2:
{
option("Vitellary"); option("Vitellary");
option("Vermilion"); option("Vermilion");
option("Verdigris"); option("Verdigris");
@ -7012,36 +6981,31 @@ void Game::createmenu( enum Menu::MenuName t )
option("return"); option("return");
menuxoff = -60; menuxoff = -60;
menuyoff = 10; menuyoff = 10;
} break;
else if (t == Menu::continuemenu) case Menu::continuemenu:
{
option("continue from teleporter"); option("continue from teleporter");
option("continue from quicksave"); option("continue from quicksave");
option("return to play menu"); option("return to play menu");
menuxoff = -60; menuxoff = -60;
menuyoff = 20; menuyoff = 20;
} break;
else if (t == Menu::startnodeathmode) case Menu::startnodeathmode:
{
option("disable cutscenes"); option("disable cutscenes");
option("enable cutscenes"); option("enable cutscenes");
option("return to play menu"); option("return to play menu");
menuxoff = -60; menuxoff = -60;
menuyoff = 40; menuyoff = 40;
} break;
else if (t == Menu::gameover) case Menu::gameover:
{
menucountdown = 120; menucountdown = 120;
menudest=Menu::gameover2; menudest=Menu::gameover2;
} break;
else if (t == Menu::gameover2) case Menu::gameover2:
{
option("return to play menu"); option("return to play menu");
menuxoff = -25; menuxoff = -25;
menuyoff = 80; menuyoff = 80;
} break;
else if (t == Menu::unlockmenutrials) case Menu::unlockmenutrials:
{
option("space station 1", !unlock[9]); option("space station 1", !unlock[9]);
option("the laboratory", !unlock[10]); option("the laboratory", !unlock[10]);
option("the tower", !unlock[11]); option("the tower", !unlock[11]);
@ -7052,9 +7016,8 @@ void Game::createmenu( enum Menu::MenuName t )
option("return to unlock menu"); option("return to unlock menu");
menuxoff = -80; menuxoff = -80;
menuyoff = 0; menuyoff = 0;
} break;
else if (t == Menu::timetrials) case 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]);
option(unlock[11] ? "the tower" : "???", unlock[11]); option(unlock[11] ? "the tower" : "???", unlock[11]);
@ -7065,40 +7028,35 @@ void Game::createmenu( enum Menu::MenuName t )
option("return to play menu"); option("return to play menu");
menuxoff = -80; menuxoff = -80;
menuyoff = 0; menuyoff = 0;
} break;
else if (t == Menu::nodeathmodecomplete) case Menu::nodeathmodecomplete:
{
menucountdown = 90; menucountdown = 90;
menudest = Menu::nodeathmodecomplete2; menudest = Menu::nodeathmodecomplete2;
} break;
else if (t == Menu::nodeathmodecomplete2) case Menu::nodeathmodecomplete2:
{
option("return to play menu"); option("return to play menu");
menuxoff = -25; menuxoff = -25;
menuyoff = 70; menuyoff = 70;
} break;
else if (t == Menu::timetrialcomplete) case Menu::timetrialcomplete:
{
menucountdown = 90; menucountdown = 90;
menudest=Menu::timetrialcomplete2; menudest=Menu::timetrialcomplete2;
} break;
else if (t == Menu::timetrialcomplete2) case Menu::timetrialcomplete2:
{
menucountdown = 60; menucountdown = 60;
menudest=Menu::timetrialcomplete3; menudest=Menu::timetrialcomplete3;
} break;
else if (t == Menu::timetrialcomplete3) case 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;
} break;
else if (t == Menu::gamecompletecontinue) case Menu::gamecompletecontinue:
{
option("return to play menu"); option("return to play menu");
menuxoff = -25; menuxoff = -25;
menuyoff = 70; menuyoff = 70;
break;
} }
} }

View file

@ -112,8 +112,9 @@ void updatebuttonmappings(int bind)
void menuactionpress() void menuactionpress()
{ {
if (game.currentmenuname == Menu::mainmenu) switch (game.currentmenuname)
{ {
case Menu::mainmenu:
#if defined(MAKEANDPLAY) #if defined(MAKEANDPLAY)
#define MPOFFSET -1 #define MPOFFSET -1
#else #else
@ -189,10 +190,9 @@ void menuactionpress()
#undef NOCUSTOMSOFFSET #undef NOCUSTOMSOFFSET
#undef MPOFFSET #undef MPOFFSET
} }
} break;
#if !defined(NO_CUSTOM_LEVELS) #if !defined(NO_CUSTOM_LEVELS)
else if(game.currentmenuname==Menu::levellist) case 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);
@ -227,10 +227,9 @@ void menuactionpress()
map.nexttowercolour(); map.nexttowercolour();
} }
} }
} break;
#endif #endif
else if(game.currentmenuname==Menu::quickloadlevel) case Menu::quickloadlevel:
{
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: //continue save case 0: //continue save
@ -248,10 +247,9 @@ void menuactionpress()
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} break;
#if !defined(NO_CUSTOM_LEVELS) #if !defined(NO_CUSTOM_LEVELS)
else if(game.currentmenuname==Menu::playerworlds) case Menu::playerworlds:
{
#if defined(NO_EDITOR) #if defined(NO_EDITOR)
#define OFFSET -1 #define OFFSET -1
#else #else
@ -295,15 +293,14 @@ void menuactionpress()
break; break;
} }
#undef OFFSET #undef OFFSET
} break;
#endif #endif
else if(game.currentmenuname==Menu::errornostart){ case Menu::errornostart:
music.playef(11); music.playef(11);
game.createmenu(Menu::mainmenu); game.createmenu(Menu::mainmenu);
map.nexttowercolour(); map.nexttowercolour();
} break;
else if (game.currentmenuname == Menu::graphicoptions) case Menu::graphicoptions:
{
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
@ -359,9 +356,8 @@ void menuactionpress()
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} break;
else if (game.currentmenuname == Menu::youwannaquit) case Menu::youwannaquit:
{
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
@ -375,9 +371,8 @@ void menuactionpress()
game.createmenu(game.previousmenuname); game.createmenu(game.previousmenuname);
map.nexttowercolour(); map.nexttowercolour();
} }
} break;
else if (game.currentmenuname == Menu::setinvincibility) case Menu::setinvincibility:
{
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
@ -396,9 +391,8 @@ void menuactionpress()
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} break;
else if (game.currentmenuname == Menu::setslowdown1) case Menu::setslowdown1:
{
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
@ -417,9 +411,8 @@ void menuactionpress()
music.playef(11); music.playef(11);
break; break;
} }
} break;
else if (game.currentmenuname == Menu::setslowdown2) case Menu::setslowdown2:
{
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
@ -460,9 +453,8 @@ void menuactionpress()
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} break;
else if (game.currentmenuname == Menu::accessibility) case Menu::accessibility:
{
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
@ -531,8 +523,8 @@ void menuactionpress()
music.playef(2); music.playef(2);
break; break;
} }
} break;
else if (game.currentmenuname == Menu::options) case Menu::options:
{ {
#if defined(MAKEANDPLAY) #if defined(MAKEANDPLAY)
#define OFFSET -1 #define OFFSET -1
@ -592,9 +584,9 @@ void menuactionpress()
map.nexttowercolour(); map.nexttowercolour();
} }
#undef OFFSET #undef OFFSET
break;
} }
else if (game.currentmenuname == Menu::unlockmenutrials) case Menu::unlockmenutrials:
{
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: //unlock 1 case 0: //unlock 1
@ -652,9 +644,8 @@ void menuactionpress()
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} break;
else if (game.currentmenuname == Menu::unlockmenu) case Menu::unlockmenu:
{
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
@ -716,9 +707,8 @@ void menuactionpress()
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} break;
else if (game.currentmenuname == Menu::credits) case Menu::credits:
{
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
@ -734,9 +724,8 @@ void menuactionpress()
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} break;
else if (game.currentmenuname == Menu::credits2) case Menu::credits2:
{
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
@ -752,9 +741,8 @@ void menuactionpress()
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} break;
else if (game.currentmenuname == Menu::credits25) case Menu::credits25:
{
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
@ -770,9 +758,8 @@ void menuactionpress()
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} break;
else if (game.currentmenuname == Menu::credits3) case Menu::credits3:
{
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
@ -802,9 +789,8 @@ void menuactionpress()
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} break;
else if (game.currentmenuname == Menu::credits4) case Menu::credits4:
{
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
@ -834,9 +820,8 @@ void menuactionpress()
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} break;
else if (game.currentmenuname == Menu::credits5) case Menu::credits5:
{
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
@ -866,9 +851,8 @@ void menuactionpress()
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} break;
else if (game.currentmenuname == Menu::credits6) case Menu::credits6:
{
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
@ -885,8 +869,8 @@ void menuactionpress()
music.niceplay(6); music.niceplay(6);
break; break;
} }
} break;
else if (game.currentmenuname == Menu::play) case 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;
@ -946,9 +930,9 @@ void menuactionpress()
game.createmenu(Menu::mainmenu); game.createmenu(Menu::mainmenu);
map.nexttowercolour(); map.nexttowercolour();
} }
break;
} }
else if (game.currentmenuname == Menu::newgamewarning) case Menu::newgamewarning:
{
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
@ -965,10 +949,9 @@ void menuactionpress()
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} break;
else if (game.currentmenuname == Menu::controller) case Menu::controller:
{
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
@ -985,9 +968,8 @@ void menuactionpress()
game.createmenu(Menu::options); game.createmenu(Menu::options);
break; break;
} }
} break;
else if (game.currentmenuname == Menu::cleardatamenu) case Menu::cleardatamenu:
{
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
@ -1008,9 +990,8 @@ void menuactionpress()
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} break;
else if (game.currentmenuname == Menu::playmodes) case 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);
@ -1050,9 +1031,8 @@ void menuactionpress()
//Can't do yet! play sad sound //Can't do yet! play sad sound
music.playef(2); music.playef(2);
} }
} break;
else if (game.currentmenuname == Menu::startnodeathmode) case Menu::startnodeathmode:
{
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: //start no death mode, disabling cutscenes case 0: //start no death mode, disabling cutscenes
@ -1070,9 +1050,8 @@ void menuactionpress()
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} break;
else if (game.currentmenuname == Menu::continuemenu) case Menu::continuemenu:
{
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
@ -1090,9 +1069,8 @@ void menuactionpress()
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} break;
else if (game.currentmenuname == Menu::intermissionmenu) case Menu::intermissionmenu:
{
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
@ -1114,9 +1092,8 @@ void menuactionpress()
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} break;
else if (game.currentmenuname == Menu::playint1) case Menu::playint1:
{
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
@ -1142,9 +1119,8 @@ void menuactionpress()
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} break;
else if (game.currentmenuname == Menu::playint2) case Menu::playint2:
{
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
@ -1170,28 +1146,25 @@ void menuactionpress()
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} break;
else if (game.currentmenuname == Menu::gameover2) case Menu::gameover2:
{
//back //back
music.playef(11); music.playef(11);
music.play(6); music.play(6);
game.createmenu(Menu::mainmenu); game.createmenu(Menu::mainmenu);
map.nexttowercolour(); map.nexttowercolour();
} break;
else if (game.currentmenuname == Menu::unlocktimetrials case Menu::unlocktimetrials:
|| game.currentmenuname == Menu::unlocktimetrial case Menu::unlocktimetrial:
|| game.currentmenuname == Menu::unlocknodeathmode case Menu::unlocknodeathmode:
|| game.currentmenuname == Menu::unlockintermission case Menu::unlockintermission:
|| game.currentmenuname == Menu::unlockflipmode) case Menu::unlockflipmode:
{
//back //back
music.playef(11); music.playef(11);
game.createmenu(Menu::play); game.createmenu(Menu::play);
map.nexttowercolour(); map.nexttowercolour();
} break;
else if (game.currentmenuname == Menu::timetrials) case Menu::timetrials:
{
if (game.currentmenuoption == 0 && game.unlock[9]) //space station 1 if (game.currentmenuoption == 0 && game.unlock[9]) //space station 1
{ {
game.mainmenu = 3; game.mainmenu = 3;
@ -1234,9 +1207,8 @@ void menuactionpress()
//Can't do yet! play sad sound //Can't do yet! play sad sound
music.playef(2); music.playef(2);
} }
} break;
else if (game.currentmenuname == Menu::timetrialcomplete3) case Menu::timetrialcomplete3:
{
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
@ -1280,13 +1252,16 @@ void menuactionpress()
} }
break; break;
} }
} break;
else if (game.currentmenuname == Menu::gamecompletecontinue || game.currentmenuname == Menu::nodeathmodecomplete2) case Menu::gamecompletecontinue:
{ case Menu::nodeathmodecomplete2:
music.play(6); music.play(6);
music.playef(11); music.playef(11);
game.createmenu(Menu::play); game.createmenu(Menu::play);
map.nexttowercolour(); map.nexttowercolour();
break;
default:
break;
} }
} }

View file

@ -20,8 +20,9 @@ void menurender()
{ {
int temp = 50; int temp = 50;
if(game.currentmenuname==Menu::mainmenu) switch (game.currentmenuname)
{ {
case 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);
graphics.drawsprite((160 - 96) + 2 * 32, temp, 23, tr, tg, tb); graphics.drawsprite((160 - 96) + 2 * 32, temp, 23, tr, tg, tb);
@ -36,9 +37,9 @@ void menurender()
if(music.mmmmmm){ if(music.mmmmmm){
graphics.Print( 10, 230, "[MMMMMM Mod Installed]", tr/2, tg/2, tb/2); graphics.Print( 10, 230, "[MMMMMM Mod Installed]", tr/2, tg/2, tb/2);
} }
} break;
#if !defined(NO_CUSTOM_LEVELS) #if !defined(NO_CUSTOM_LEVELS)
else if (game.currentmenuname == Menu::levellist) case 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);
@ -57,15 +58,14 @@ void menurender()
graphics.Print( -1, 90, ed.ListOfMetaData[tmp].Desc3, tr, tg, tb, true); graphics.Print( -1, 90, ed.ListOfMetaData[tmp].Desc3, tr, tg, tb, true);
} }
} }
break;
} }
#endif #endif
else if (game.currentmenuname == Menu::errornostart) case 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);
} break;
else if (game.currentmenuname == Menu::options) case Menu::options:
{
#if defined(MAKEANDPLAY) #if defined(MAKEANDPLAY)
#define OFFSET -1 #define OFFSET -1
#else #else
@ -109,9 +109,8 @@ void menurender()
break; break;
} }
#undef OFFSET #undef OFFSET
} break;
else if (game.currentmenuname == Menu::graphicoptions) case Menu::graphicoptions:
{
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
@ -166,9 +165,8 @@ void menurender()
} }
break; break;
} }
} break;
else if (game.currentmenuname == Menu::credits) case 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);
@ -177,25 +175,23 @@ void menurender()
graphics.Print( -1, 120, "and features music by", tr, tg, tb, true); graphics.Print( -1, 120, "and features music by", tr, tg, tb, true);
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);
} break;
else if (game.currentmenuname == Menu::credits2) case 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);
graphics.drawimagecol(9, -1, 86, tr*0.75, tg *0.75, tb *0.75, true); graphics.drawimagecol(9, -1, 86, tr*0.75, tg *0.75, tb *0.75, true);
graphics.Print( -1, 110, "C++ version by", tr, tg, tb, true); graphics.Print( -1, 110, "C++ version by", tr, tg, tb, true);
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);
} break;
else if (game.currentmenuname == Menu::credits25) case 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);
graphics.bigprint( 40, 75, "Pauli Kohberger", tr, tg, tb, true); graphics.bigprint( 40, 75, "Pauli Kohberger", tr, tg, tb, true);
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);
} break;
else if (game.currentmenuname == Menu::credits3) case 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);
@ -212,8 +208,9 @@ void menurender()
xofs += 4; xofs += 4;
yofs += 14; yofs += 14;
} }
break;
} }
else if (game.currentmenuname == Menu::credits4) case Menu::credits4:
{ {
graphics.Print( -1, 20, "and also by", tr, tg, tb, true); graphics.Print( -1, 20, "and also by", tr, tg, tb, true);
@ -231,8 +228,9 @@ void menurender()
graphics.Print(80, yofs, game.patrons[i], tr, tg, tb); graphics.Print(80, yofs, game.patrons[i], tr, tg, tb);
yofs += 10; yofs += 10;
} }
break;
} }
else if (game.currentmenuname == Menu::credits5) case 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);
@ -253,9 +251,9 @@ void menurender()
xofs += 4; xofs += 4;
yofs += 14; yofs += 14;
} }
break;
} }
else if (game.currentmenuname == Menu::credits6) case 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);
graphics.bigprint(80, 60, "You!", tr, tg, tb, true); graphics.bigprint(80, 60, "You!", tr, tg, tb, true);
@ -266,21 +264,18 @@ void menurender()
graphics.Print( 80, 130, "and into the future.", tr, tg, tb, true); graphics.Print( 80, 130, "and into the future.", tr, tg, tb, true);
graphics.Print( 80, 150,"Thank you!", tr, tg, tb,true); graphics.Print( 80, 150,"Thank you!", tr, tg, tb,true);
} break;
else if (game.currentmenuname == Menu::setinvincibility) case 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);
} break;
else if (game.currentmenuname == Menu::setslowdown1) case 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);
} break;
else if (game.currentmenuname == Menu::setslowdown2) case 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);
switch (game.gameframerate) switch (game.gameframerate)
@ -298,26 +293,22 @@ void menurender()
graphics.Print( -1, 105, "Game speed is at 40%", tr, tg, tb, true); graphics.Print( -1, 105, "Game speed is at 40%", tr, tg, tb, true);
break; break;
} }
} break;
else if (game.currentmenuname == Menu::newgamewarning) case 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);
} break;
else if (game.currentmenuname == Menu::cleardatamenu) case 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);
} break;
else if (game.currentmenuname == Menu::startnodeathmode) case 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);
} break;
else if (game.currentmenuname == Menu::controller) case 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);
switch (game.currentmenuoption) switch (game.currentmenuoption)
@ -357,9 +348,8 @@ void menurender()
} }
} break;
else if (game.currentmenuname == Menu::accessibility) case Menu::accessibility:
{
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
@ -449,14 +439,13 @@ void menurender()
graphics.Print(-1, 105, "Room name background is OPAQUE", tr, tg, tb, true); graphics.Print(-1, 105, "Room name background is OPAQUE", tr, tg, tb, true);
break; break;
} }
} break;
else if (game.currentmenuname == Menu::playint1 || game.currentmenuname == Menu::playint2) case Menu::playint1:
{ case 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);
} break;
else if (game.currentmenuname == Menu::playmodes) case Menu::playmodes:
{
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
@ -518,13 +507,11 @@ void menurender()
} }
break; break;
} }
} break;
else if (game.currentmenuname == Menu::youwannaquit) case 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);
} break;
else if (game.currentmenuname == Menu::continuemenu) case Menu::continuemenu:
{
graphics.crewframedelay--; graphics.crewframedelay--;
if (graphics.crewframedelay <= 0) if (graphics.crewframedelay <= 0)
{ {
@ -566,8 +553,9 @@ void menurender()
graphics.drawspritesetcol(175, 126-20, 22, 18); graphics.drawspritesetcol(175, 126-20, 22, 18);
break; break;
} }
} break;
else if (game.currentmenuname == Menu::gameover || game.currentmenuname == Menu::gameover2) case Menu::gameover:
case Menu::gameover2:
{ {
graphics.bigprint( -1, 25, "GAME OVER", tr, tg, tb, true, 3); graphics.bigprint( -1, 25, "GAME OVER", tr, tg, tb, true, 3);
@ -615,8 +603,10 @@ void menurender()
} }
graphics.Print(0, 190, tempstring, tr, tg, tb, true); graphics.Print(0, 190, tempstring, tr, tg, tb, true);
break;
} }
else if (game.currentmenuname == Menu::nodeathmodecomplete || game.currentmenuname == Menu::nodeathmodecomplete2) case Menu::nodeathmodecomplete:
case Menu::nodeathmodecomplete2:
{ {
graphics.bigprint( -1, 8, "WOW", tr, tg, tb, true, 4); graphics.bigprint( -1, 8, "WOW", tr, tg, tb, true, 4);
@ -639,9 +629,11 @@ void menurender()
graphics.Print(0, 160, "A new trophy has been awarded and", tr, tg, tb, true); graphics.Print(0, 160, "A new trophy has been awarded and", tr, tg, tb, true);
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);
break;
} }
else if (game.currentmenuname == Menu::timetrialcomplete || game.currentmenuname == Menu::timetrialcomplete2 case Menu::timetrialcomplete:
|| game.currentmenuname == Menu::timetrialcomplete3) case Menu::timetrialcomplete2:
case Menu::timetrialcomplete3:
{ {
graphics.bigprint( -1, 20, "Results", tr, tg, tb, true, 3); graphics.bigprint( -1, 20, "Results", tr, tg, tb, true, 3);
@ -696,15 +688,14 @@ void menurender()
break; break;
} }
} }
break;
} }
else if (game.currentmenuname == Menu::unlockmenutrials) case 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);
} break;
else if (game.currentmenuname == Menu::timetrials) case Menu::timetrials:
{
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
@ -984,9 +975,8 @@ void menurender()
} }
break; break;
} }
} break;
else if (game.currentmenuname == Menu::gamecompletecontinue) case Menu::gamecompletecontinue:
{
graphics.bigprint( -1, 25, "Congratulations!", tr, tg, tb, true, 2); graphics.bigprint( -1, 25, "Congratulations!", tr, tg, tb, true, 2);
graphics.Print( -1, 45, "Your save files have been updated.", tr, tg, tb, true); graphics.Print( -1, 45, "Your save files have been updated.", tr, tg, tb, true);
@ -994,50 +984,45 @@ void menurender()
graphics.Print( -1, 110, "If you want to keep exploring", tr, tg, tb, true); graphics.Print( -1, 110, "If you want to keep exploring", tr, tg, tb, true);
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);
} break;
else if (game.currentmenuname == Menu::unlockmenu) case 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);
graphics.Print( -1, 55, "From here, you may unlock parts", tr, tg, tb, true); graphics.Print( -1, 55, "From here, you may unlock parts", tr, tg, tb, true);
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);
} break;
else if (game.currentmenuname == Menu::unlocktimetrial) case 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);
} break;
else if (game.currentmenuname == Menu::unlocktimetrials) case 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);
} break;
else if (game.currentmenuname == Menu::unlocknodeathmode) case 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);
} break;
else if (game.currentmenuname == Menu::unlockflipmode) case 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);
} break;
else if (game.currentmenuname == Menu::unlockintermission) case 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 == Menu::playerworlds) break;
case Menu::playerworlds:
{ {
std::string tempstring = FILESYSTEM_getUserLevelDirectory(); std::string tempstring = FILESYSTEM_getUserLevelDirectory();
if(tempstring.length()>80){ if(tempstring.length()>80){
@ -1056,6 +1041,10 @@ void menurender()
graphics.Print( -1, 190, "the .vvvvvv files to this folder:", tr, tg, tb, true); graphics.Print( -1, 190, "the .vvvvvv files to this folder:", tr, tg, tb, true);
graphics.Print( 320-(tempstring.length()*8), 210, tempstring, tr, tg, tb); graphics.Print( 320-(tempstring.length()*8), 210, tempstring, tr, tg, tb);
} }
break;
}
default:
break;
} }
} }

View file

@ -2183,12 +2183,12 @@ void editorclass::generatecustomminimap()
void editormenurender(int tr, int tg, int tb) void editormenurender(int tr, int tg, int tb)
{ {
if (game.currentmenuname == Menu::ed_settings) switch (game.currentmenuname)
{ {
case Menu::ed_settings:
graphics.bigprint( -1, 75, "Map Settings", tr, tg, tb, true); graphics.bigprint( -1, 75, "Map Settings", tr, tg, tb, true);
} break;
else if (game.currentmenuname==Menu::ed_desc) case Menu::ed_desc:
{
if(ed.titlemod) if(ed.titlemod)
{ {
if(ed.entframe<2) if(ed.entframe<2)
@ -2279,9 +2279,8 @@ 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);
} }
} break;
else if (game.currentmenuname == Menu::ed_music) case Menu::ed_music:
{
graphics.bigprint( -1, 65, "Map Music", tr, tg, tb, true); graphics.bigprint( -1, 65, "Map Music", tr, tg, tb, true);
graphics.Print( -1, 85, "Current map music:", tr, tg, tb, true); graphics.Print( -1, 85, "Current map music:", tr, tg, tb, true);
@ -2327,11 +2326,13 @@ void editormenurender(int tr, int tg, int tb)
graphics.Print( -1, 120, "?: something else", tr, tg, tb, true); graphics.Print( -1, 120, "?: something else", tr, tg, tb, true);
break; break;
} }
} break;
else if (game.currentmenuname == Menu::ed_quit) case 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);
break;
default:
break;
} }
} }
@ -3461,8 +3462,9 @@ void editorlogic()
void editormenuactionpress() void editormenuactionpress()
{ {
if (game.currentmenuname == Menu::ed_desc) switch (game.currentmenuname)
{ {
case Menu::ed_desc:
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
@ -3495,9 +3497,8 @@ void editormenuactionpress()
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} break;
else if (game.currentmenuname == Menu::ed_settings) case Menu::ed_settings:
{
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
@ -3560,9 +3561,8 @@ void editormenuactionpress()
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} break;
else if (game.currentmenuname == Menu::ed_music) case Menu::ed_music:
{
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
@ -3588,9 +3588,8 @@ void editormenuactionpress()
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
} break;
else if (game.currentmenuname == Menu::ed_quit) case Menu::ed_quit:
{
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
@ -3622,6 +3621,9 @@ void editormenuactionpress()
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
break;
default:
break;
} }
} }