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

Push a stack frame when Game::createmenu() is called

Unless it's the main menu, or unless it's not the same menu. Whether or
not the menu is the same is left up to the caller, because some menus
could be the same but use different names, so we can't simply
automatically check that the names are different and assume that they
aren't the same menu.
This commit is contained in:
Misa 2020-04-16 19:04:36 -07:00 committed by Ethan Lee
parent 58b9941d73
commit de0205e09b
2 changed files with 17 additions and 2 deletions

View file

@ -6552,8 +6552,23 @@ std::string Game::timetstring( int t )
return tempstring;
}
void Game::createmenu( enum Menu::MenuName t )
void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
{
if (t == Menu::mainmenu)
{
//Either we've just booted up the game or returned from gamemode
//Whichever it is, we shouldn't have a stack,
//and most likely don't have a current stackframe
menustack.clear();
}
else if (!samemenu)
{
MenuStackFrame frame;
frame.option = currentmenuoption;
frame.name = currentmenuname;
menustack.push_back(frame);
}
currentmenuoption = 0;
currentmenuname = t;
menuxoff = 0;

View file

@ -115,7 +115,7 @@ public:
std::string timetstring(int t);
void createmenu(enum Menu::MenuName t);
void createmenu(enum Menu::MenuName t, bool samemenu = false);
void lifesequence();