From 7274d825a3e4362b9bb59614be18873b95e21782 Mon Sep 17 00:00:00 2001 From: Alexei Kotov Date: Sun, 26 May 2024 23:34:05 +0300 Subject: [PATCH] Hide the settings window when any main menu button is pressed --- apps/openmw/mwgui/mainmenu.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/apps/openmw/mwgui/mainmenu.cpp b/apps/openmw/mwgui/mainmenu.cpp index 53f791fdac..4ea31778ce 100644 --- a/apps/openmw/mwgui/mainmenu.cpp +++ b/apps/openmw/mwgui/mainmenu.cpp @@ -100,10 +100,6 @@ namespace MWGui { winMgr->removeGuiMode(GM_MainMenu); } - else if (name == "options") - { - winMgr->toggleSettingsWindow(); - } else if (name == "credits") winMgr->playVideo("mw_credits.bik", true); else if (name == "exitgame") @@ -132,17 +128,18 @@ namespace MWGui dialog->eventCancelClicked.clear(); } } - - else + else if (name == "loadgame" || name == "savegame") { if (!mSaveGameDialog) mSaveGameDialog = std::make_unique(); - if (name == "loadgame") - mSaveGameDialog->setLoadOrSave(true); - else if (name == "savegame") - mSaveGameDialog->setLoadOrSave(false); + mSaveGameDialog->setLoadOrSave(name == "loadgame"); mSaveGameDialog->setVisible(true); } + + if (winMgr->isSettingsWindowVisible() || name == "options") + { + winMgr->toggleSettingsWindow(); + } } void MainMenu::showBackground(bool show)