diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index ba939024..02d8f996 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -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; diff --git a/desktop_version/src/Input.cpp b/desktop_version/src/Input.cpp index 92f10b9a..3853ab5a 100644 --- a/desktop_version/src/Input.cpp +++ b/desktop_version/src/Input.cpp @@ -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: diff --git a/desktop_version/src/Logic.cpp b/desktop_version/src/Logic.cpp index 7aa05ab4..a4111174 100644 --- a/desktop_version/src/Logic.cpp +++ b/desktop_version/src/Logic.cpp @@ -30,7 +30,7 @@ void titlelogic() { music.playef(3); } - game.createmenu(game.menudest); + game.createmenu(game.menudest, true); } } } diff --git a/desktop_version/src/editor.cpp b/desktop_version/src/editor.cpp index d43e4b34..3c5da840 100644 --- a/desktop_version/src/editor.cpp +++ b/desktop_version/src/editor.cpp @@ -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(); } }