|
12 | 12 | #include <MyGUI_FactoryManager.h> |
13 | 13 | #include <MyGUI_InputManager.h> |
14 | 14 | #include <MyGUI_LanguageManager.h> |
| 15 | +#include <MyGUI_LayerManager.h> |
15 | 16 | #include <MyGUI_PointerManager.h> |
16 | 17 | #include <MyGUI_UString.h> |
17 | 18 |
|
@@ -981,6 +982,10 @@ namespace MWGui |
981 | 982 | MWBase::Environment::get().getInputManager()->setGamepadGuiCursorEnabled( |
982 | 983 | mGuiModeStates[mode].mWindows[activeIndex]->isGamepadCursorAllowed()); |
983 | 984 |
|
| 985 | + WindowBase* activeWindow = mGuiModeStates[mode].mWindows[activeIndex]; |
| 986 | + if (activeWindow->isVisible()) |
| 987 | + MyGUI::LayerManager::getInstance().upLayerItem(activeWindow->mMainWidget); |
| 988 | + |
984 | 989 | updateControllerButtonsOverlay(); |
985 | 990 | setCursorActive(false); |
986 | 991 |
|
@@ -1435,11 +1440,17 @@ namespace MWGui |
1435 | 1440 | if (Settings::gui().mControllerMenus) |
1436 | 1441 | { |
1437 | 1442 | 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 | + } |
1443 | 1454 | } |
1444 | 1455 | } |
1445 | 1456 |
|
|
0 commit comments