mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-25 02:59:44 +01:00
Prevent user-initiated map menu changes during menu animations
This makes it so it's not even possible to stay on the TELEPORTERMODE screen by opening the map while it's being brought down. It also makes it so the map animation is able to be canceled when being brought up just by opening the map and closing it. Fixes #833.
This commit is contained in:
parent
4ecec8a327
commit
82971296c2
4 changed files with 14 additions and 7 deletions
|
@ -6888,8 +6888,15 @@ void Game::unlockAchievement(const char *name) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void Game::mapmenuchange(const int newgamestate)
|
void Game::mapmenuchange(const int newgamestate, const bool user_initiated)
|
||||||
{
|
{
|
||||||
|
if (user_initiated
|
||||||
|
&& graphics.menuoffset > 0
|
||||||
|
&& graphics.menuoffset < (map.extrarow ? 230 : 240))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
prevgamestate = gamestate;
|
prevgamestate = gamestate;
|
||||||
gamestate = newgamestate;
|
gamestate = newgamestate;
|
||||||
graphics.resumegamemode = false;
|
graphics.resumegamemode = false;
|
||||||
|
|
|
@ -245,7 +245,7 @@ public:
|
||||||
int tapleft, tapright;
|
int tapleft, tapright;
|
||||||
|
|
||||||
//Menu interaction stuff
|
//Menu interaction stuff
|
||||||
void mapmenuchange(const int newgamestate);
|
void mapmenuchange(const int newgamestate, const bool user_initiated);
|
||||||
bool mapheld;
|
bool mapheld;
|
||||||
int menupage;
|
int menupage;
|
||||||
int lastsaved;
|
int lastsaved;
|
||||||
|
|
|
@ -2124,7 +2124,7 @@ void gameinput(void)
|
||||||
else if (game.companion == 0)
|
else if (game.companion == 0)
|
||||||
{
|
{
|
||||||
//Alright, normal teleporting
|
//Alright, normal teleporting
|
||||||
game.mapmenuchange(TELEPORTERMODE);
|
game.mapmenuchange(TELEPORTERMODE, true);
|
||||||
|
|
||||||
game.useteleporter = true;
|
game.useteleporter = true;
|
||||||
game.initteleportermode();
|
game.initteleportermode();
|
||||||
|
@ -2279,7 +2279,7 @@ void gameinput(void)
|
||||||
//quitting the super gravitron
|
//quitting the super gravitron
|
||||||
game.mapheld = true;
|
game.mapheld = true;
|
||||||
//Quit menu, same conditions as in game menu
|
//Quit menu, same conditions as in game menu
|
||||||
game.mapmenuchange(MAPMODE);
|
game.mapmenuchange(MAPMODE, true);
|
||||||
game.gamesaved = false;
|
game.gamesaved = false;
|
||||||
game.gamesavefailed = false;
|
game.gamesavefailed = false;
|
||||||
game.menupage = 20; // The Map Page
|
game.menupage = 20; // The Map Page
|
||||||
|
@ -2299,7 +2299,7 @@ void gameinput(void)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//Normal map screen, do transition later
|
//Normal map screen, do transition later
|
||||||
game.mapmenuchange(MAPMODE);
|
game.mapmenuchange(MAPMODE, true);
|
||||||
map.cursordelay = 0;
|
map.cursordelay = 0;
|
||||||
map.cursorstate = 0;
|
map.cursorstate = 0;
|
||||||
game.gamesaved = false;
|
game.gamesaved = false;
|
||||||
|
@ -2320,7 +2320,7 @@ void gameinput(void)
|
||||||
{
|
{
|
||||||
game.mapheld = true;
|
game.mapheld = true;
|
||||||
//Quit menu, same conditions as in game menu
|
//Quit menu, same conditions as in game menu
|
||||||
game.mapmenuchange(MAPMODE);
|
game.mapmenuchange(MAPMODE, true);
|
||||||
game.gamesaved = false;
|
game.gamesaved = false;
|
||||||
game.gamesavefailed = false;
|
game.gamesavefailed = false;
|
||||||
game.menupage = 30; // Pause screen
|
game.menupage = 30; // Pause screen
|
||||||
|
|
|
@ -1349,7 +1349,7 @@ void scriptclass::run(void)
|
||||||
{
|
{
|
||||||
if (words[1] == "teleporter")
|
if (words[1] == "teleporter")
|
||||||
{
|
{
|
||||||
game.mapmenuchange(TELEPORTERMODE);
|
game.mapmenuchange(TELEPORTERMODE, false);
|
||||||
|
|
||||||
game.useteleporter = false; //good heavens don't actually use it
|
game.useteleporter = false; //good heavens don't actually use it
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue