From a34fe1d9b288c4974e8fb7822f3bdfd4e6631915 Mon Sep 17 00:00:00 2001 From: Cody Date: Sun, 12 Apr 2020 10:18:07 -0700 Subject: [PATCH] proper game mode detection --- apps/openmw/mwgui/keyboardnavigation.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwgui/keyboardnavigation.cpp b/apps/openmw/mwgui/keyboardnavigation.cpp index d6922dc83..6dd66029b 100644 --- a/apps/openmw/mwgui/keyboardnavigation.cpp +++ b/apps/openmw/mwgui/keyboardnavigation.cpp @@ -116,8 +116,7 @@ void KeyboardNavigation::onFrame() if (!mEnabled) return; - MWGui::GuiMode mode = MWBase::Environment::get().getWindowManager()->getMode(); - if (mode == GM_None) + if (!MWBase::Environment::get().getWindowManager()->isGuiMode()) { MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(nullptr); return; @@ -222,8 +221,7 @@ bool KeyboardNavigation::injectKeyPress(MyGUI::KeyCode key, unsigned int text, b bool KeyboardNavigation::switchFocus(int direction, bool wrap) { - MWGui::GuiMode mode = MWBase::Environment::get().getWindowManager()->getMode(); - if (mode == GM_None) + if (!MWBase::Environment::get().getWindowManager()->isGuiMode()) return false; MyGUI::Widget* focus = MyGUI::InputManager::getInstance().getKeyFocusWidget();