Skip to content

Commit 1ea60f7

Browse files
committed
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
2 parents 65430c0 + e18465b commit 1ea60f7

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

apps/openmw/mwgui/windowmanagerimp.cpp

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <MyGUI_FactoryManager.h>
1313
#include <MyGUI_InputManager.h>
1414
#include <MyGUI_LanguageManager.h>
15+
#include <MyGUI_LayerManager.h>
1516
#include <MyGUI_PointerManager.h>
1617
#include <MyGUI_UString.h>
1718

@@ -981,6 +982,10 @@ namespace MWGui
981982
MWBase::Environment::get().getInputManager()->setGamepadGuiCursorEnabled(
982983
mGuiModeStates[mode].mWindows[activeIndex]->isGamepadCursorAllowed());
983984

985+
WindowBase* activeWindow = mGuiModeStates[mode].mWindows[activeIndex];
986+
if (activeWindow->isVisible())
987+
MyGUI::LayerManager::getInstance().upLayerItem(activeWindow->mMainWidget);
988+
984989
updateControllerButtonsOverlay();
985990
setCursorActive(false);
986991

@@ -1435,11 +1440,17 @@ namespace MWGui
14351440
if (Settings::gui().mControllerMenus)
14361441
{
14371442
if (mode == GM_Container)
1438-
mActiveControllerWindows[mode] = 0; // Ensure controller focus is on container
1439-
// Activate first visible window. This needs to be called after updateVisible.
1440-
if (mActiveControllerWindows[mode] != 0)
1441-
mActiveControllerWindows[mode] = mActiveControllerWindows[mode] - 1;
1442-
cycleActiveControllerWindow(true);
1443+
{
1444+
// Ensure controller focus is on container when entering container mode.
1445+
setActiveControllerWindow(mode, 0);
1446+
}
1447+
else
1448+
{
1449+
// Activate first visible window. This needs to be called after updateVisible.
1450+
if (mActiveControllerWindows[mode] != 0)
1451+
mActiveControllerWindows[mode] = mActiveControllerWindows[mode] - 1;
1452+
cycleActiveControllerWindow(true);
1453+
}
14431454
}
14441455
}
14451456

0 commit comments

Comments
 (0)