mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-01-10 19:09:45 +01:00
Restore janky gamestate-based quit-to-title system in glitchrunnermode
This was fixed in 2.3 because one of the side effects of this janky system was being able to accidentally immediately quit to the title if the screen was black during a cutscene, which is something very likely to happen to casual players. Anyway, credits warp uses this gamestate-based system because it utilizes quitting to the title screen doing gamestate 80. From there, you increment the gamestate to gamestate 94 to use the Space Station 2 expo script.
This commit is contained in:
parent
9bab6bd0cb
commit
cb8540d7bd
2 changed files with 48 additions and 6 deletions
|
@ -1916,7 +1916,41 @@ void mapinput()
|
|||
game.press_action = false;
|
||||
game.press_map = false;
|
||||
|
||||
if (game.fadetomenu)
|
||||
if (game.glitchrunnermode && graphics.fademode == 1 && graphics.menuoffset == 0)
|
||||
{
|
||||
// Deliberate re-addition of the glitchy gamestate-based fadeout!
|
||||
|
||||
// First of all, detecting a black screen means if the glitchy fadeout
|
||||
// gets interrupted but you're still on a black screen, opening a menu
|
||||
// immediately quits you to the title. This has the side effect that if
|
||||
// you accidentally press Esc during a cutscene when it's black, you'll
|
||||
// immediately be quit and lose all your progress, but that's fair in
|
||||
// glitchrunner mode.
|
||||
// Also have to check graphics.menuoffset so this doesn't run every frame
|
||||
|
||||
// Have to close the menu in order to run gamestates. This adds
|
||||
// about an extra half second of completely black screen.
|
||||
graphics.resumegamemode = true;
|
||||
|
||||
// Technically this was in <=2.2 as well
|
||||
obj.removeallblocks();
|
||||
|
||||
if (game.menupage >= 20 && game.menupage <= 21)
|
||||
{
|
||||
game.state = 96;
|
||||
game.statedelay = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Produces more glitchiness! Necessary for credits warp to work.
|
||||
script.hardreset();
|
||||
|
||||
game.state = 80;
|
||||
game.statedelay = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (game.fadetomenu && !game.glitchrunnermode)
|
||||
{
|
||||
if (game.fadetomenudelay > 0)
|
||||
{
|
||||
|
@ -1929,7 +1963,7 @@ void mapinput()
|
|||
}
|
||||
}
|
||||
|
||||
if (game.fadetolab)
|
||||
if (game.fadetolab && !game.glitchrunnermode)
|
||||
{
|
||||
if (game.fadetolabdelay > 0)
|
||||
{
|
||||
|
@ -1942,7 +1976,9 @@ void mapinput()
|
|||
}
|
||||
}
|
||||
|
||||
if(graphics.menuoffset==0 && game.fadetomenudelay <= 0 && game.fadetolabdelay <= 0)
|
||||
if(graphics.menuoffset==0
|
||||
&& (!game.glitchrunnermode || graphics.fademode == 0)
|
||||
&& game.fadetomenudelay <= 0 && game.fadetolabdelay <= 0)
|
||||
{
|
||||
if (graphics.flipmode)
|
||||
{
|
||||
|
@ -2119,8 +2155,11 @@ void mapmenuactionpress()
|
|||
graphics.fademode = 2;
|
||||
music.fadeout();
|
||||
map.nexttowercolour();
|
||||
game.fadetomenu = true;
|
||||
game.fadetomenudelay = 16;
|
||||
if (!game.glitchrunnermode)
|
||||
{
|
||||
game.fadetomenu = true;
|
||||
game.fadetomenudelay = 16;
|
||||
}
|
||||
break;
|
||||
|
||||
case 20:
|
||||
|
|
|
@ -2356,7 +2356,10 @@ void maprender()
|
|||
|
||||
|
||||
|
||||
if (graphics.fademode == 3 || graphics.fademode == 5)
|
||||
// We need to draw the black screen above the menu in order to disguise it
|
||||
// being jankily brought down in glitchrunner mode when exiting to the title
|
||||
// Otherwise, there's no reason to obscure the menu
|
||||
if (game.glitchrunnermode || graphics.fademode == 3 || graphics.fademode == 5)
|
||||
{
|
||||
graphics.drawfade();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue