mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-22 17:49:43 +01:00
De-duplicate "secret lab" menu option in "play" menu
Instead of creating an entirely new menu for it, just dynamically add the Secret Lab menu option as needed.
This commit is contained in:
parent
4f6835c485
commit
678ade88b9
2 changed files with 21 additions and 71 deletions
|
@ -6939,19 +6939,27 @@ void Game::createmenu( std::string t )
|
|||
createmenu("unlockintermission");
|
||||
savemystats = true;
|
||||
}
|
||||
//ok, secret lab! no notification, but test:
|
||||
else if (unlock[8])
|
||||
{
|
||||
createmenu("playsecretlab");
|
||||
}
|
||||
else
|
||||
{
|
||||
option("continue");
|
||||
//ok, secret lab! no notification, but test:
|
||||
if (unlock[8])
|
||||
{
|
||||
option("secret lab");
|
||||
}
|
||||
option("play modes");
|
||||
option("new game");
|
||||
option("return");
|
||||
menuxoff = -20;
|
||||
menuyoff = -40;
|
||||
if (unlock[8])
|
||||
{
|
||||
menuxoff = -40;
|
||||
menuyoff = -30;
|
||||
}
|
||||
else
|
||||
{
|
||||
menuxoff = -20;
|
||||
menuyoff = -40;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6965,16 +6973,6 @@ void Game::createmenu( std::string t )
|
|||
menuxoff = 20;
|
||||
menuyoff = 70;
|
||||
}
|
||||
else if (t == "playsecretlab")
|
||||
{
|
||||
option("continue");
|
||||
option("secret lab");
|
||||
option("play modes");
|
||||
option("new game");
|
||||
option("return");
|
||||
menuxoff = -40;
|
||||
menuyoff = -30;
|
||||
}
|
||||
else if (t == "newgamewarning")
|
||||
{
|
||||
option("start new game");
|
||||
|
|
|
@ -886,6 +886,8 @@ void menuactionpress()
|
|||
}
|
||||
else if (game.currentmenuname == "play")
|
||||
{
|
||||
//Do we have the Secret Lab option?
|
||||
int offset = game.unlock[8] ? 0 : -1;
|
||||
if (game.currentmenuoption == 0)
|
||||
{
|
||||
//continue
|
||||
|
@ -911,57 +913,7 @@ void menuactionpress()
|
|||
map.settowercolour(3);
|
||||
}
|
||||
}
|
||||
else if (game.currentmenuoption == 1)
|
||||
{
|
||||
//play modes
|
||||
music.playef(11);
|
||||
game.createmenu("playmodes");
|
||||
map.nexttowercolour();
|
||||
}
|
||||
else if (game.currentmenuoption == 2)
|
||||
{
|
||||
//newgame
|
||||
music.playef(11);
|
||||
game.createmenu("newgamewarning");
|
||||
map.nexttowercolour();
|
||||
}
|
||||
else if (game.currentmenuoption == 3)
|
||||
{
|
||||
//back
|
||||
music.playef(11);
|
||||
game.createmenu("mainmenu");
|
||||
map.nexttowercolour();
|
||||
}
|
||||
}
|
||||
else if (game.currentmenuname == "playsecretlab")
|
||||
{
|
||||
//as above, except with an extra option...
|
||||
if (game.currentmenuoption == 0)
|
||||
{
|
||||
//continue
|
||||
//right, this depends on what saves you've got
|
||||
if (game.telesummary == "")
|
||||
{
|
||||
//You at least have a quicksave, or you couldn't have gotten here
|
||||
game.mainmenu = 2;
|
||||
graphics.fademode = 2;
|
||||
}
|
||||
else if (game.quicksummary == "")
|
||||
{
|
||||
//You at least have a telesave, or you couldn't have gotten here
|
||||
game.mainmenu = 1;
|
||||
graphics.fademode = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
//go to a menu!
|
||||
music.playef(11);
|
||||
game.loadsummary(); //Prepare save slots to display
|
||||
game.createmenu("continue");
|
||||
map.settowercolour(3);
|
||||
}
|
||||
}
|
||||
else if (game.currentmenuoption == 1)
|
||||
else if (game.currentmenuoption == 1 && game.unlock[8])
|
||||
{
|
||||
if(!map.invincibility){
|
||||
game.mainmenu = 11;
|
||||
|
@ -971,21 +923,21 @@ void menuactionpress()
|
|||
music.playef(2);
|
||||
}
|
||||
}
|
||||
else if (game.currentmenuoption == 2)
|
||||
else if (game.currentmenuoption == offset+2)
|
||||
{
|
||||
//play modes
|
||||
music.playef(11);
|
||||
game.createmenu("playmodes");
|
||||
map.nexttowercolour();
|
||||
}
|
||||
else if (game.currentmenuoption == 3)
|
||||
else if (game.currentmenuoption == offset+3)
|
||||
{
|
||||
//newgame
|
||||
music.playef(11);
|
||||
game.createmenu("newgamewarning");
|
||||
map.nexttowercolour();
|
||||
}
|
||||
else if (game.currentmenuoption == 4)
|
||||
else if (game.currentmenuoption == offset+4)
|
||||
{
|
||||
//back
|
||||
music.playef(11);
|
||||
|
|
Loading…
Reference in a new issue