1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2026-02-01 09:48:46 +00:00

Merge branch 'Issue#8774' into 'master'

Closes #8774: The container/trade menu now automatically brings the focused menu to the front

Closes #8774

See merge request OpenMW/openmw!5099
This commit is contained in:
AnyOldName3 2026-01-28 14:55:26 +00:00
commit 1ea60f7b8f

View file

@ -12,6 +12,7 @@
#include <MyGUI_FactoryManager.h>
#include <MyGUI_InputManager.h>
#include <MyGUI_LanguageManager.h>
#include <MyGUI_LayerManager.h>
#include <MyGUI_PointerManager.h>
#include <MyGUI_UString.h>
@ -981,6 +982,10 @@ namespace MWGui
MWBase::Environment::get().getInputManager()->setGamepadGuiCursorEnabled(
mGuiModeStates[mode].mWindows[activeIndex]->isGamepadCursorAllowed());
WindowBase* activeWindow = mGuiModeStates[mode].mWindows[activeIndex];
if (activeWindow->isVisible())
MyGUI::LayerManager::getInstance().upLayerItem(activeWindow->mMainWidget);
updateControllerButtonsOverlay();
setCursorActive(false);
@ -1435,11 +1440,17 @@ namespace MWGui
if (Settings::gui().mControllerMenus)
{
if (mode == GM_Container)
mActiveControllerWindows[mode] = 0; // Ensure controller focus is on container
// Activate first visible window. This needs to be called after updateVisible.
if (mActiveControllerWindows[mode] != 0)
mActiveControllerWindows[mode] = mActiveControllerWindows[mode] - 1;
cycleActiveControllerWindow(true);
{
// Ensure controller focus is on container when entering container mode.
setActiveControllerWindow(mode, 0);
}
else
{
// Activate first visible window. This needs to be called after updateVisible.
if (mActiveControllerWindows[mode] != 0)
mActiveControllerWindows[mode] = mActiveControllerWindows[mode] - 1;
cycleActiveControllerWindow(true);
}
}
}