From fcf034583bbe4944232ed582c7a47d9fb6997063 Mon Sep 17 00:00:00 2001 From: Dav999 Date: Sun, 10 Sep 2023 15:00:20 +0200 Subject: [PATCH] Fix possible title screen from in-game if command-line playtesting In 8484b3619858d505cc9d463cab17cacc3ad795e5, I fixed the title screen showing up if you go to the language screen from in-game, while not having any language files. There was also one other possible way to get this to happen that I missed though: if you do have language files, and you have not set your language yet, and you start a playtest via the command line (e.g. by using Ved), and you then change the language from the in-game options. That is now fixed. --- desktop_version/src/Input.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/desktop_version/src/Input.cpp b/desktop_version/src/Input.cpp index 103d6794..a9c0446e 100644 --- a/desktop_version/src/Input.cpp +++ b/desktop_version/src/Input.cpp @@ -1037,6 +1037,7 @@ static void menuactionpress(void) { music.playef(Sound_VIRIDIAN); loc::loadlanguagelist(); + loc::pre_title_lang_menu = false; game.createmenu(Menu::language); game.currentmenuoption = loc::languagelist_curlang; map.nexttowercolour(); @@ -1114,16 +1115,13 @@ static void menuactionpress(void) if (loc::pre_title_lang_menu) { - /* Make the title screen appear, we haven't seen it yet */ + /* Make the title screen appear, we haven't seen it yet. + * game.returnmenu() works because Menu::mainmenu + * is created before the language menu. */ game.menustart = false; - game.createmenu(Menu::mainmenu); - game.currentmenuoption = 0; loc::pre_title_lang_menu = false; } - else - { - game.returnmenu(); - } + game.returnmenu(); map.nexttowercolour(); game.savestatsandsettings_menu();