1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-03-28 20:06:41 +00:00

[Client] Prevent constant loss of key focus for chat window

This commit is contained in:
David Cernat 2020-05-11 01:57:19 +03:00
parent dc0ce09ab6
commit 95e5e6d33d

View file

@ -8,6 +8,17 @@
#include <components/debug/debuglog.hpp> #include <components/debug/debuglog.hpp>
/*
Start of tes3mp addition
Include additional headers for multiplayer purposes
*/
#include "../mwmp/Main.hpp"
#include "../mwmp/GUIController.hpp"
/*
End of tes3mp addition
*/
#include "../mwbase/windowmanager.hpp" #include "../mwbase/windowmanager.hpp"
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
@ -116,7 +127,15 @@ void KeyboardNavigation::onFrame()
if (!mEnabled) if (!mEnabled)
return; return;
if (!MWBase::Environment::get().getWindowManager()->isGuiMode()) /*
Start of tes3mp change (major)
Don't clear key focus widget when not in menus if the chat is currently focused
*/
if (!MWBase::Environment::get().getWindowManager()->isGuiMode() && !mwmp::Main::get().getGUIController()->getChatEditState())
/*
End of tes3mp change (major)
*/
{ {
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(nullptr); MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(nullptr);
return; return;