mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-11-12 14:09:43 +01:00
Decouple fademode from starting gamemode
Assuming glitchrunner mode is off, if you open the pause menu while fully faded-out and then go to Graphic Options or Game Options, then the 'mode' that you selected previously will kick in again and you'll be suddenly warped back. So if you previously started a new game in the main game (mode 0, also the selected mode if you do this from command-line playtesting), and then open the pause menu and go to in-game options, then you'll suddenly go back to starting a new game again. If you had started a custom level, doing this will warp you back to the start of the level again. The problem is simple - when the title screen is fully faded out, it calls startgamemode(). So the solution is simple as well - just decouple the fademode from calling startgamemode(), and use a different variable to know when to actually call startgamemode().
This commit is contained in:
parent
cd0c9ccb31
commit
82dfa0b86c
1 changed files with 17 additions and 2 deletions
|
@ -188,10 +188,15 @@ static void toggleflipmode(void)
|
|||
}
|
||||
}
|
||||
|
||||
static bool fadetomode = false;
|
||||
static int fadetomodedelay = 0;
|
||||
|
||||
static void startmode(const int mode)
|
||||
{
|
||||
game.mainmenu = mode;
|
||||
graphics.fademode = 2; /* fading out */
|
||||
fadetomode = true;
|
||||
fadetomodedelay = 16;
|
||||
}
|
||||
|
||||
static void menuactionpress(void)
|
||||
|
@ -1654,8 +1659,18 @@ void titleinput(void)
|
|||
|
||||
}
|
||||
|
||||
if (graphics.fademode == 1)
|
||||
script.startgamemode(game.mainmenu);
|
||||
if (fadetomode)
|
||||
{
|
||||
if (fadetomodedelay > 0)
|
||||
{
|
||||
--fadetomodedelay;
|
||||
}
|
||||
else
|
||||
{
|
||||
fadetomode = false;
|
||||
script.startgamemode(game.mainmenu);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void gameinput(void)
|
||||
|
|
Loading…
Reference in a new issue