From a46dd32f12a3fcc0e41b2e1609bf11d7d3bc6706 Mon Sep 17 00:00:00 2001 From: Misa Date: Mon, 22 Jun 2020 16:52:40 -0700 Subject: [PATCH] Consolidate common case 32/33 code If most of the code in the cases is the same, then just consolidate and de-duplicate them. It's less error-prone this way. --- desktop_version/src/Input.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/desktop_version/src/Input.cpp b/desktop_version/src/Input.cpp index a1ecfc39..2dfcfe7f 100644 --- a/desktop_version/src/Input.cpp +++ b/desktop_version/src/Input.cpp @@ -2106,23 +2106,19 @@ void mapmenuactionpress() game.menupage = 10; break; case 32: - // Graphic options - music.playef(11); - game.gamestate = TITLEMODE; - game.ingame_titlemode = true; - game.createmenu(Menu::graphicoptions); - map.nexttowercolour(); - - // Fix delta rendering glitch - graphics.updatetowerbackground(); - titleupdatetextcol(); - break; case 33: - // Game options + // Graphic options and game options music.playef(11); game.gamestate = TITLEMODE; game.ingame_titlemode = true; - game.createmenu(Menu::options); + if (game.menupage == 32) + { + game.createmenu(Menu::graphicoptions); + } + else + { + game.createmenu(Menu::options); + } map.nexttowercolour(); // Fix delta rendering glitch