mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 01:59:43 +01:00
Use game.returnmenu() for all "return" menu options
This is to not reset your cursor position every time you return on something. It's also to automatically keep track of which menu was the previous menu instead of manually hardcoding said previous menu.
This commit is contained in:
parent
224585d774
commit
2bb64198fe
1 changed files with 34 additions and 36 deletions
|
@ -196,7 +196,7 @@ void menuactionpress()
|
||||||
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(Menu::mainmenu);
|
game.returnmenu();
|
||||||
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
|
||||||
|
@ -288,7 +288,7 @@ void menuactionpress()
|
||||||
case OFFSET+2:
|
case OFFSET+2:
|
||||||
//back
|
//back
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
game.createmenu(Menu::mainmenu);
|
game.returnmenu();
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -347,7 +347,7 @@ void menuactionpress()
|
||||||
default:
|
default:
|
||||||
//back
|
//back
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
game.createmenu(Menu::mainmenu);
|
game.returnmenu();
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -364,7 +364,7 @@ void menuactionpress()
|
||||||
default:
|
default:
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
map.nexttowercolour(); //This goes first, otherwise mismatching continuemenu color is possible
|
map.nexttowercolour(); //This goes first, otherwise mismatching continuemenu color is possible
|
||||||
game.createmenu(game.previousmenuname);
|
game.returnmenu();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Menu::setinvincibility:
|
case Menu::setinvincibility:
|
||||||
|
@ -373,16 +373,14 @@ void menuactionpress()
|
||||||
case 0:
|
case 0:
|
||||||
//back
|
//back
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
game.createmenu(Menu::accessibility);
|
game.returnmenu();
|
||||||
game.currentmenuoption = 3;
|
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
map.invincibility = !map.invincibility;
|
map.invincibility = !map.invincibility;
|
||||||
game.savestats();
|
game.savestats();
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
game.createmenu(Menu::accessibility);
|
game.returnmenu();
|
||||||
game.currentmenuoption = 3;
|
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -396,7 +394,7 @@ void menuactionpress()
|
||||||
game.slowdown = 30;
|
game.slowdown = 30;
|
||||||
game.savestats();
|
game.savestats();
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
game.createmenu(Menu::accessibility);
|
game.returnmenu();
|
||||||
game.currentmenuoption = 4;
|
game.currentmenuoption = 4;
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
break;
|
break;
|
||||||
|
@ -405,7 +403,7 @@ void menuactionpress()
|
||||||
game.slowdown = 24;
|
game.slowdown = 24;
|
||||||
game.savestats();
|
game.savestats();
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
game.createmenu(Menu::accessibility);
|
game.returnmenu();
|
||||||
game.currentmenuoption = 4;
|
game.currentmenuoption = 4;
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
break;
|
break;
|
||||||
|
@ -414,7 +412,7 @@ void menuactionpress()
|
||||||
game.slowdown = 18;
|
game.slowdown = 18;
|
||||||
game.savestats();
|
game.savestats();
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
game.createmenu(Menu::accessibility);
|
game.returnmenu();
|
||||||
game.currentmenuoption = 4;
|
game.currentmenuoption = 4;
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
break;
|
break;
|
||||||
|
@ -423,7 +421,7 @@ void menuactionpress()
|
||||||
game.slowdown = 12;
|
game.slowdown = 12;
|
||||||
game.savestats();
|
game.savestats();
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
game.createmenu(Menu::accessibility);
|
game.returnmenu();
|
||||||
game.currentmenuoption = 4;
|
game.currentmenuoption = 4;
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
break;
|
break;
|
||||||
|
@ -490,7 +488,7 @@ void menuactionpress()
|
||||||
case 7:
|
case 7:
|
||||||
//back
|
//back
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
game.createmenu(Menu::options);
|
game.returnmenu();
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -555,7 +553,7 @@ void menuactionpress()
|
||||||
{
|
{
|
||||||
//back
|
//back
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
game.createmenu(Menu::mainmenu);
|
game.returnmenu();
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
}
|
}
|
||||||
#undef OFFSET
|
#undef OFFSET
|
||||||
|
@ -615,7 +613,7 @@ void menuactionpress()
|
||||||
case 6: //back
|
case 6: //back
|
||||||
//back
|
//back
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
game.createmenu(Menu::unlockmenu);
|
game.returnmenu();
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -678,7 +676,7 @@ void menuactionpress()
|
||||||
default:
|
default:
|
||||||
//back
|
//back
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
game.createmenu(Menu::options);
|
game.returnmenu();
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -695,7 +693,7 @@ void menuactionpress()
|
||||||
default:
|
default:
|
||||||
//back
|
//back
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
game.createmenu(Menu::mainmenu);
|
game.returnmenu();
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -712,7 +710,7 @@ void menuactionpress()
|
||||||
case 1:
|
case 1:
|
||||||
//back
|
//back
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
game.createmenu(Menu::mainmenu);
|
game.returnmenu();
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -729,7 +727,7 @@ void menuactionpress()
|
||||||
default:
|
default:
|
||||||
//back
|
//back
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
game.createmenu(Menu::mainmenu);
|
game.returnmenu();
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -760,7 +758,7 @@ void menuactionpress()
|
||||||
//back
|
//back
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
game.current_credits_list_index = 0;
|
game.current_credits_list_index = 0;
|
||||||
game.createmenu(Menu::mainmenu);
|
game.returnmenu();
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -791,7 +789,7 @@ void menuactionpress()
|
||||||
//back
|
//back
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
game.current_credits_list_index = 0;
|
game.current_credits_list_index = 0;
|
||||||
game.createmenu(Menu::mainmenu);
|
game.returnmenu();
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -822,7 +820,7 @@ void menuactionpress()
|
||||||
//back
|
//back
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
game.current_credits_list_index = 0;
|
game.current_credits_list_index = 0;
|
||||||
game.createmenu(Menu::mainmenu);
|
game.returnmenu();
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -839,7 +837,7 @@ void menuactionpress()
|
||||||
default:
|
default:
|
||||||
//back
|
//back
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
game.createmenu(Menu::mainmenu);
|
game.returnmenu();
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
music.niceplay(6);
|
music.niceplay(6);
|
||||||
break;
|
break;
|
||||||
|
@ -901,7 +899,7 @@ void menuactionpress()
|
||||||
{
|
{
|
||||||
//back
|
//back
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
game.createmenu(Menu::mainmenu);
|
game.returnmenu();
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -919,7 +917,7 @@ void menuactionpress()
|
||||||
default:
|
default:
|
||||||
//back
|
//back
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
game.createmenu(Menu::play);
|
game.returnmenu();
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -939,7 +937,7 @@ void menuactionpress()
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
game.createmenu(Menu::options);
|
game.returnmenu();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -949,7 +947,7 @@ void menuactionpress()
|
||||||
case 0:
|
case 0:
|
||||||
//back
|
//back
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
game.createmenu(Menu::options);
|
game.returnmenu();
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -997,7 +995,7 @@ void menuactionpress()
|
||||||
{
|
{
|
||||||
//back
|
//back
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
game.createmenu(Menu::play);
|
game.returnmenu();
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1020,7 +1018,7 @@ void menuactionpress()
|
||||||
case 2:
|
case 2:
|
||||||
//back
|
//back
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
game.createmenu(Menu::play);
|
game.returnmenu();
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1039,7 +1037,7 @@ void menuactionpress()
|
||||||
case 2:
|
case 2:
|
||||||
//back
|
//back
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
game.createmenu(Menu::play);
|
game.returnmenu();
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1062,7 +1060,7 @@ void menuactionpress()
|
||||||
case 2:
|
case 2:
|
||||||
//back
|
//back
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
game.createmenu(Menu::play);
|
game.returnmenu();
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1089,7 +1087,7 @@ void menuactionpress()
|
||||||
case 4:
|
case 4:
|
||||||
//back
|
//back
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
game.createmenu(Menu::play);
|
game.returnmenu();
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1116,7 +1114,7 @@ void menuactionpress()
|
||||||
case 4:
|
case 4:
|
||||||
//back
|
//back
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
game.createmenu(Menu::play);
|
game.returnmenu();
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1125,7 +1123,7 @@ void menuactionpress()
|
||||||
//back
|
//back
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
music.play(6);
|
music.play(6);
|
||||||
game.createmenu(Menu::mainmenu);
|
game.returnmenu();
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
break;
|
break;
|
||||||
case Menu::unlocktimetrials:
|
case Menu::unlocktimetrials:
|
||||||
|
@ -1173,7 +1171,7 @@ void menuactionpress()
|
||||||
{
|
{
|
||||||
//back
|
//back
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
game.createmenu(Menu::play);
|
game.returnmenu();
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1189,7 +1187,7 @@ void menuactionpress()
|
||||||
//back
|
//back
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
music.play(6);
|
music.play(6);
|
||||||
game.createmenu(Menu::play);
|
game.returnmenu();
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
|
|
Loading…
Reference in a new issue