mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 01:59:43 +01:00
Move quit to menu to Game::quittomenu()
I don't want the quit code to only be in the state machine, but I'll keep the gamestate around for compatibility reasons (there are custom levels that directly use gamestate 80 to quit to the menu).
This commit is contained in:
parent
0787475e63
commit
6ac41e112c
2 changed files with 45 additions and 38 deletions
|
@ -1336,44 +1336,7 @@ void Game::updatestate()
|
||||||
if(graphics.fademode == 1) state++;
|
if(graphics.fademode == 1) state++;
|
||||||
break;
|
break;
|
||||||
case 81:
|
case 81:
|
||||||
gamestate = TITLEMODE;
|
quittomenu();
|
||||||
graphics.fademode = 4;
|
|
||||||
music.play(6);
|
|
||||||
graphics.backgrounddrawn = false;
|
|
||||||
map.tdrawback = true;
|
|
||||||
graphics.flipmode = false;
|
|
||||||
//Don't be stuck on the summary screen,
|
|
||||||
//or "who do you want to play the level with?"
|
|
||||||
//or "do you want cutscenes?"
|
|
||||||
//or the confirm-load-quicksave menu
|
|
||||||
if (wasintimetrial)
|
|
||||||
{
|
|
||||||
returntomenu(Menu::timetrials);
|
|
||||||
}
|
|
||||||
else if (wasinintermission)
|
|
||||||
{
|
|
||||||
returntomenu(Menu::intermissionmenu);
|
|
||||||
}
|
|
||||||
else if (wasinnodeathmode)
|
|
||||||
{
|
|
||||||
returntomenu(Menu::playmodes);
|
|
||||||
}
|
|
||||||
else if (wasincustommode)
|
|
||||||
{
|
|
||||||
returntomenu(Menu::levellist);
|
|
||||||
}
|
|
||||||
else if (save_exists() || anything_unlocked())
|
|
||||||
{
|
|
||||||
returntomenu(Menu::play);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
createmenu(Menu::mainmenu);
|
|
||||||
}
|
|
||||||
wasintimetrial = false;
|
|
||||||
wasinintermission = false;
|
|
||||||
wasinnodeathmode = false;
|
|
||||||
wasincustommode = false;
|
|
||||||
state = 0;
|
state = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -7358,3 +7321,45 @@ bool Game::save_exists()
|
||||||
{
|
{
|
||||||
return telesummary != "" || quicksummary != "";
|
return telesummary != "" || quicksummary != "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Game::quittomenu()
|
||||||
|
{
|
||||||
|
gamestate = TITLEMODE;
|
||||||
|
graphics.fademode = 4;
|
||||||
|
music.play(6);
|
||||||
|
graphics.backgrounddrawn = false;
|
||||||
|
map.tdrawback = true;
|
||||||
|
graphics.flipmode = false;
|
||||||
|
//Don't be stuck on the summary screen,
|
||||||
|
//or "who do you want to play the level with?"
|
||||||
|
//or "do you want cutscenes?"
|
||||||
|
//or the confirm-load-quicksave menu
|
||||||
|
if (wasintimetrial)
|
||||||
|
{
|
||||||
|
returntomenu(Menu::timetrials);
|
||||||
|
}
|
||||||
|
else if (wasinintermission)
|
||||||
|
{
|
||||||
|
returntomenu(Menu::intermissionmenu);
|
||||||
|
}
|
||||||
|
else if (wasinnodeathmode)
|
||||||
|
{
|
||||||
|
returntomenu(Menu::playmodes);
|
||||||
|
}
|
||||||
|
else if (wasincustommode)
|
||||||
|
{
|
||||||
|
returntomenu(Menu::levellist);
|
||||||
|
}
|
||||||
|
else if (save_exists() || anything_unlocked())
|
||||||
|
{
|
||||||
|
returntomenu(Menu::play);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
createmenu(Menu::mainmenu);
|
||||||
|
}
|
||||||
|
wasintimetrial = false;
|
||||||
|
wasinintermission = false;
|
||||||
|
wasinnodeathmode = false;
|
||||||
|
wasincustommode = false;
|
||||||
|
}
|
||||||
|
|
|
@ -385,6 +385,8 @@ public:
|
||||||
int playrx;
|
int playrx;
|
||||||
int playry;
|
int playry;
|
||||||
int playgc;
|
int playgc;
|
||||||
|
|
||||||
|
void quittomenu();
|
||||||
};
|
};
|
||||||
|
|
||||||
extern Game game;
|
extern Game game;
|
||||||
|
|
Loading…
Reference in a new issue