1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-22 17:49:43 +01:00

Don't go to main menu when exiting to menu

This also replaces some createmenu()s with returnmenu()s as needed even
when said createmenu()s already didn't go to the main menu.

Now when you exit the level editor, you'll be selecting the "level
editor" option in "play levels", and if you exit from a level you'll
still be selecting that level in the levels list.

Furthermore, regardless of what you're exiting, your cursor position
will be remembered.
This commit is contained in:
Misa 2020-04-16 21:25:30 -07:00 committed by Ethan Lee
parent 4d9c834a13
commit e909515f3d
4 changed files with 24 additions and 6 deletions

View file

@ -1338,7 +1338,13 @@ void Game::updatestate()
graphics.backgrounddrawn = false;
map.tdrawback = true;
graphics.flipmode = false;
createmenu(Menu::mainmenu);
//Don't be stuck on the summary screen,
//or "who do you want to play the level with?"
//or "do you want cutscenes?"
if (!intimetrial)
{
returnmenu();
}
state = 0;
break;
@ -2098,7 +2104,6 @@ void Game::updatestate()
}
}
#endif
createmenu(Menu::levellist);
state = 0;
break;
@ -2993,6 +2998,7 @@ void Game::updatestate()
{
graphics.fademode = 2;
companion = 0;
returnmenu();
state=3100;
}
else
@ -3023,6 +3029,7 @@ void Game::updatestate()
state++;
graphics.fademode = 2;
music.fadeout();
returnmenu();
state=3100;
}
else
@ -3053,7 +3060,6 @@ void Game::updatestate()
graphics.fademode = 4;
graphics.backgrounddrawn = true;
map.tdrawback = true;
createmenu(Menu::play);
music.play(6);
state = 0;
break;

View file

@ -1191,6 +1191,15 @@ void menuactionpress()
map.nexttowercolour();
break;
case 1:
//Ok but first quickly remove the last stack frame to prevent piling up timetrialcomplete stack frames
if (game.menustack.empty())
{
puts("Error: menu stack is empty!");
}
else
{
game.menustack.pop_back();
}
//duplicate the above based on given time trial level!
if (game.timetriallevel == 0) //space station 1
{
@ -1229,7 +1238,7 @@ void menuactionpress()
case Menu::nodeathmodecomplete2:
music.play(6);
music.playef(11);
game.createmenu(Menu::play);
game.returnmenu();
map.nexttowercolour();
break;
default:

View file

@ -30,7 +30,7 @@ void titlelogic()
{
music.playef(3);
}
game.createmenu(game.menudest);
game.createmenu(game.menudest, true);
}
}
}

View file

@ -3455,7 +3455,10 @@ void editorlogic()
map.nexttowercolour();
ed.settingsmod=false;
graphics.backgrounddrawn=false;
game.createmenu(Menu::mainmenu);
//Do returnmenu twice because we have two menus:
//the main editor menu and the confirm save&quit menu
game.returnmenu();
game.returnmenu();
}
}