mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-01-05 16:39:44 +01:00
Fix going to wrong menu upon quit
The problem was, if you were in a time trial and quit, it wouldn't go back to selecting your current time trial. But also if you were in a custom level and quit, you would still be on the playerworlds menu. The problem was twofold: first, I simply wasn't doing the custommode check. But secondly, I couldn't use map.custommode directly, because whenever you quit the game aggressively hardreset()s everything immediately when you press ACTION. There's probably a good reason for that aggressive hardreset(), so I won't touch that hardreset() in any way. Instead, I had to introduce two kludge variables wasintimetrial and wasincustommode to Game, and use those to do the check proper.
This commit is contained in:
parent
995dc3940a
commit
b02c4aac78
3 changed files with 13 additions and 1 deletions
|
@ -232,6 +232,9 @@ void Game::init(void)
|
||||||
customleveltitle="";
|
customleveltitle="";
|
||||||
createmenu(Menu::mainmenu);
|
createmenu(Menu::mainmenu);
|
||||||
|
|
||||||
|
wasintimetrial = false;
|
||||||
|
wasincustommode = false;
|
||||||
|
|
||||||
deathcounts = 0;
|
deathcounts = 0;
|
||||||
gameoverdelay = 0;
|
gameoverdelay = 0;
|
||||||
frames = 0;
|
frames = 0;
|
||||||
|
@ -1341,10 +1344,13 @@ void Game::updatestate()
|
||||||
//Don't be stuck on the summary screen,
|
//Don't be stuck on the summary screen,
|
||||||
//or "who do you want to play the level with?"
|
//or "who do you want to play the level with?"
|
||||||
//or "do you want cutscenes?"
|
//or "do you want cutscenes?"
|
||||||
if (!intimetrial)
|
//or the confirm-load-quicksave menu
|
||||||
|
if ((!wasintimetrial && !wasincustommode) || currentmenuname == Menu::quickloadlevel)
|
||||||
{
|
{
|
||||||
returnmenu();
|
returnmenu();
|
||||||
}
|
}
|
||||||
|
wasintimetrial = false;
|
||||||
|
wasincustommode = false;
|
||||||
state = 0;
|
state = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -245,6 +245,10 @@ public:
|
||||||
|
|
||||||
int creditposx, creditposy, creditposdelay;
|
int creditposx, creditposy, creditposdelay;
|
||||||
|
|
||||||
|
//Menu kludge...
|
||||||
|
bool wasintimetrial;
|
||||||
|
bool wasincustommode;
|
||||||
|
|
||||||
|
|
||||||
//Sine Wave Ninja Minigame
|
//Sine Wave Ninja Minigame
|
||||||
bool swnmode;
|
bool swnmode;
|
||||||
|
|
|
@ -1958,6 +1958,8 @@ void mapinput()
|
||||||
//This fixes an apparent frame flicker.
|
//This fixes an apparent frame flicker.
|
||||||
FillRect(graphics.tempBuffer, 0x000000);
|
FillRect(graphics.tempBuffer, 0x000000);
|
||||||
if (game.intimetrial || game.insecretlab || game.nodeathmode) game.menukludge = true;
|
if (game.intimetrial || game.insecretlab || game.nodeathmode) game.menukludge = true;
|
||||||
|
game.wasintimetrial = game.intimetrial;
|
||||||
|
game.wasincustommode = map.custommode;
|
||||||
script.hardreset();
|
script.hardreset();
|
||||||
if(graphics.setflipmode) graphics.flipmode = true;
|
if(graphics.setflipmode) graphics.flipmode = true;
|
||||||
graphics.fademode = 2;
|
graphics.fademode = 2;
|
||||||
|
|
Loading…
Reference in a new issue