1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-12-07 18:04:34 +00:00

Allow exiting credits by pressing B

This commit is contained in:
Andrew Lanzone 2025-05-09 23:43:29 -07:00
parent b4e0590a10
commit fc86878922
2 changed files with 12 additions and 4 deletions

View file

@ -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;

View file

@ -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)