diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-10-01 21:23:36 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-10-01 21:23:36 +0300 |
commit | 9aa0f34c4a6205590d7dbba6f0a65f91a4897ed0 (patch) | |
tree | bf963d72dadbdd7a969fd1791083145728362806 | |
parent | cd8b69ef3edafde047ad4db6f7b81afb53bb23f0 (diff) | |
download | mv-9aa0f34c4a6205590d7dbba6f0a65f91a4897ed0.tar.gz mv-9aa0f34c4a6205590d7dbba6f0a65f91a4897ed0.tar.bz2 mv-9aa0f34c4a6205590d7dbba6f0a65f91a4897ed0.tar.xz mv-9aa0f34c4a6205590d7dbba6f0a65f91a4897ed0.zip |
Fix input fields detection for input rules.
-rw-r--r-- | src/input/inputmanager.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/input/inputmanager.cpp b/src/input/inputmanager.cpp index 4405b0c0a..83e01d0ba 100644 --- a/src/input/inputmanager.cpp +++ b/src/input/inputmanager.cpp @@ -38,6 +38,7 @@ #include "gui/sdlinput.h" #include "gui/widgets/selldialog.h" +#include "gui/widgets/textfield.h" #include "gui/widgets/tabs/setup_input.h" @@ -657,7 +658,23 @@ void InputManager::updateConditionMask() !InventoryWindow::isAnyInputFocused() && (!tradeWindow || !tradeWindow->isInpupFocused())) { - mMask |= InputCondition::NOINPUT; + if (gui) + { + FocusHandler *const focus = gui->getFocusHandler(); + if (focus) + { + if (!dynamic_cast<TextField*>(focus->getFocused())) + mMask |= InputCondition::NOINPUT; + } + else + { + mMask |= InputCondition::NOINPUT; + } + } + else + { + mMask |= InputCondition::NOINPUT; + } } if (!BuyDialog::isActive() && !SellDialog::isActive()) |