mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 10:09:43 +01:00
Pull the game.press_action conditional out of all the if-statements
No need to repeat yourself if you can just surround the whole thing in an 'if (game.press_action)' block, which is much easier.
This commit is contained in:
parent
13cc7b2a4b
commit
5717afaa37
1 changed files with 10 additions and 7 deletions
|
@ -1975,7 +1975,10 @@ void mapinput()
|
||||||
game.menupage++;
|
game.menupage++;
|
||||||
}
|
}
|
||||||
|
|
||||||
mapmenuactionpress();
|
if (game.press_action)
|
||||||
|
{
|
||||||
|
mapmenuactionpress();
|
||||||
|
}
|
||||||
|
|
||||||
if (game.menupage < 0) game.menupage = 3;
|
if (game.menupage < 0) game.menupage = 3;
|
||||||
if (game.menupage > 3 && game.menupage < 9) game.menupage = 0;
|
if (game.menupage > 3 && game.menupage < 9) game.menupage = 0;
|
||||||
|
@ -1993,7 +1996,7 @@ void mapinput()
|
||||||
|
|
||||||
void mapmenuactionpress()
|
void mapmenuactionpress()
|
||||||
{
|
{
|
||||||
if (game.menupage == 1 && obj.flags[67] && game.press_action && !game.insecretlab && !map.custommode)
|
if (game.menupage == 1 && obj.flags[67] && !game.insecretlab && !map.custommode)
|
||||||
{
|
{
|
||||||
//Warp back to the ship
|
//Warp back to the ship
|
||||||
graphics.resumegamemode = true;
|
graphics.resumegamemode = true;
|
||||||
|
@ -2017,7 +2020,7 @@ void mapmenuactionpress()
|
||||||
game.statedelay = 0;
|
game.statedelay = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (game.menupage == 3 && !game.gamesaved && game.press_action && !game.intimetrial
|
if (game.menupage == 3 && !game.gamesaved && !game.intimetrial
|
||||||
&& !game.nodeathmode && !game.insecretlab && !game.inintermission)
|
&& !game.nodeathmode && !game.insecretlab && !game.inintermission)
|
||||||
{
|
{
|
||||||
game.flashlight = 5;
|
game.flashlight = 5;
|
||||||
|
@ -2043,12 +2046,12 @@ void mapmenuactionpress()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (game.menupage == 10 && game.press_action)
|
if (game.menupage == 10)
|
||||||
{
|
{
|
||||||
//return to game
|
//return to game
|
||||||
graphics.resumegamemode = true;
|
graphics.resumegamemode = true;
|
||||||
}
|
}
|
||||||
if (game.menupage == 11 && game.press_action)
|
if (game.menupage == 11)
|
||||||
{
|
{
|
||||||
//quit to menu
|
//quit to menu
|
||||||
|
|
||||||
|
@ -2062,12 +2065,12 @@ void mapmenuactionpress()
|
||||||
game.fadetomenudelay = 16;
|
game.fadetomenudelay = 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (game.menupage == 20 && game.press_action)
|
if (game.menupage == 20)
|
||||||
{
|
{
|
||||||
//return to game
|
//return to game
|
||||||
graphics.resumegamemode = true;
|
graphics.resumegamemode = true;
|
||||||
}
|
}
|
||||||
if (game.menupage == 21 && game.press_action)
|
if (game.menupage == 21)
|
||||||
{
|
{
|
||||||
//quit to menu
|
//quit to menu
|
||||||
game.swnmode = false;
|
game.swnmode = false;
|
||||||
|
|
Loading…
Reference in a new issue