From 6d7bff61b2f3bd73a36b7e94a37a5a24313fe16b Mon Sep 17 00:00:00 2001 From: Misa Date: Mon, 22 Jun 2020 16:51:16 -0700 Subject: [PATCH] Make returning from game/graphic options return to MAPMODE This is so return doesn't just lead back to more TITLEMODE. --- desktop_version/src/Game.cpp | 2 ++ desktop_version/src/Game.h | 2 ++ desktop_version/src/Input.cpp | 22 ++++++++++++++++++++-- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index 7ea1ad07..903a574e 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -389,6 +389,8 @@ void Game::init(void) over30mode = false; + ingame_titlemode = false; + /* Terry's Patrons... */ const char* superpatrons_arr[] = { "Anders Ekermo", diff --git a/desktop_version/src/Game.h b/desktop_version/src/Game.h index 86b83d6d..1cb4a549 100644 --- a/desktop_version/src/Game.h +++ b/desktop_version/src/Game.h @@ -404,6 +404,8 @@ public: } bool over30mode; + + bool ingame_titlemode; }; extern Game game; diff --git a/desktop_version/src/Input.cpp b/desktop_version/src/Input.cpp index ad70dd16..a1ecfc39 100644 --- a/desktop_version/src/Input.cpp +++ b/desktop_version/src/Input.cpp @@ -376,7 +376,15 @@ void menuactionpress() //back music.playef(11); game.returnmenu(); - map.nexttowercolour(); + if (game.ingame_titlemode) + { + game.ingame_titlemode = false; + game.gamestate = MAPMODE; + } + else + { + map.nexttowercolour(); + } break; } break; @@ -582,7 +590,15 @@ void menuactionpress() //back music.playef(11); game.returnmenu(); - map.nexttowercolour(); + if (game.ingame_titlemode) + { + game.ingame_titlemode = false; + game.gamestate = MAPMODE; + } + else + { + map.nexttowercolour(); + } } #undef OFFSET break; @@ -2093,6 +2109,7 @@ void mapmenuactionpress() // Graphic options music.playef(11); game.gamestate = TITLEMODE; + game.ingame_titlemode = true; game.createmenu(Menu::graphicoptions); map.nexttowercolour(); @@ -2104,6 +2121,7 @@ void mapmenuactionpress() // Game options music.playef(11); game.gamestate = TITLEMODE; + game.ingame_titlemode = true; game.createmenu(Menu::options); map.nexttowercolour();