From fc86878922f72d673e2d160be8084d7e023a9644 Mon Sep 17 00:00:00 2001 From: Andrew Lanzone Date: Fri, 9 May 2025 23:43:29 -0700 Subject: [PATCH] Allow exiting credits by pressing B --- apps/openmw/mwgui/mainmenu.cpp | 10 ++++++++-- apps/openmw/mwinput/controllermanager.cpp | 6 ++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwgui/mainmenu.cpp b/apps/openmw/mwgui/mainmenu.cpp index ae5b5f9be2..5d0e2dc585 100644 --- a/apps/openmw/mwgui/mainmenu.cpp +++ b/apps/openmw/mwgui/mainmenu.cpp @@ -228,8 +228,14 @@ namespace MWGui break; case SDL_CONTROLLER_BUTTON_B: case SDL_CONTROLLER_BUTTON_START: - onButtonClicked(mButtons["return"]); - return true; + if (mButtons["return"]->getVisible()) + { + onButtonClicked(mButtons["return"]); + return true; + } + else + key = MyGUI::KeyCode::Escape; + break; } MWBase::Environment::get().getWindowManager()->injectKeyPress(key, 0, false); return true; diff --git a/apps/openmw/mwinput/controllermanager.cpp b/apps/openmw/mwinput/controllermanager.cpp index 404b156c24..7aff8172ce 100644 --- a/apps/openmw/mwinput/controllermanager.cpp +++ b/apps/openmw/mwinput/controllermanager.cpp @@ -244,7 +244,8 @@ namespace MWInput if (Settings::gui().mControllerMenus) { MWGui::WindowBase* topWin = MWBase::Environment::get().getWindowManager()->getTopWindow(); - return topWin && topWin->onControllerButtonEvent(arg); + if (topWin && topWin->onControllerButtonEvent(arg)) + return true; } // Presumption of GUI mode will be removed in the future. @@ -311,7 +312,8 @@ namespace MWInput if (Settings::gui().mControllerMenus) { MWGui::WindowBase* topWin = MWBase::Environment::get().getWindowManager()->getTopWindow(); - return topWin && topWin->onControllerThumbstickEvent(arg); + if (topWin && topWin->onControllerThumbstickEvent(arg)) + return true; } switch (arg.axis)