mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 01:59:43 +01:00
Save current menu to temp variable when entering options from in-game
This is to pre-emptively prevent piling up stack frames for what I'll be adding next, which is pressing Esc in the options menu in-game automatically moving you back to MAPMODE.
This commit is contained in:
parent
75326ca2ee
commit
6582801dc9
3 changed files with 7 additions and 2 deletions
|
@ -390,6 +390,7 @@ void Game::init(void)
|
|||
over30mode = false;
|
||||
|
||||
ingame_titlemode = false;
|
||||
kludge_ingametemp = Menu::mainmenu;
|
||||
|
||||
/* Terry's Patrons... */
|
||||
const char* superpatrons_arr[] = {
|
||||
|
|
|
@ -216,6 +216,7 @@ public:
|
|||
std::vector<MenuOption> menuoptions;
|
||||
int currentmenuoption ;
|
||||
enum Menu::MenuName currentmenuname;
|
||||
enum Menu::MenuName kludge_ingametemp;
|
||||
int current_credits_list_index;
|
||||
int menuxoff, menuyoff;
|
||||
std::vector<MenuStackFrame> menustack;
|
||||
|
|
|
@ -375,15 +375,16 @@ void menuactionpress()
|
|||
default:
|
||||
//back
|
||||
music.playef(11);
|
||||
game.returnmenu();
|
||||
if (game.ingame_titlemode)
|
||||
{
|
||||
game.ingame_titlemode = false;
|
||||
game.returntomenu(game.kludge_ingametemp);
|
||||
game.gamestate = MAPMODE;
|
||||
map.kludge_to_bg();
|
||||
}
|
||||
else
|
||||
{
|
||||
game.returnmenu();
|
||||
map.nexttowercolour();
|
||||
}
|
||||
break;
|
||||
|
@ -590,15 +591,16 @@ void menuactionpress()
|
|||
{
|
||||
//back
|
||||
music.playef(11);
|
||||
game.returnmenu();
|
||||
if (game.ingame_titlemode)
|
||||
{
|
||||
game.ingame_titlemode = false;
|
||||
game.returntomenu(game.kludge_ingametemp);
|
||||
game.gamestate = MAPMODE;
|
||||
map.kludge_to_bg();
|
||||
}
|
||||
else
|
||||
{
|
||||
game.returnmenu();
|
||||
map.nexttowercolour();
|
||||
}
|
||||
}
|
||||
|
@ -2122,6 +2124,7 @@ void mapmenuactionpress()
|
|||
game.createmenu(Menu::options);
|
||||
}
|
||||
map.bg_to_kludge();
|
||||
game.kludge_ingametemp = game.currentmenuname;
|
||||
|
||||
map.nexttowercolour();
|
||||
map.scrolldir = 0;
|
||||
|
|
Loading…
Reference in a new issue