summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-05-10 12:06:16 +0200
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-05-10 12:06:16 +0200
commit1931eb352bd6db3e12285d7fde1e1be886fefa11 (patch)
tree21152b55fa4fe2cd7f106e5102eaaac11bad3755 /src/game.cpp
parentb74add61aa176df9f3661d6a9c710abe05cc8f11 (diff)
downloadmana-client-1931eb352bd6db3e12285d7fde1e1be886fefa11.tar.gz
mana-client-1931eb352bd6db3e12285d7fde1e1be886fefa11.tar.bz2
mana-client-1931eb352bd6db3e12285d7fde1e1be886fefa11.tar.xz
mana-client-1931eb352bd6db3e12285d7fde1e1be886fefa11.zip
Don't show the chat input when a modal widget has focus
For example, the chat input would become visible when using Enter to confirm the exit dialog.
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 203629ff..d3ca2e7c 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -87,6 +87,7 @@
#include "utils/gettext.h"
#include <guichan/exception.hpp>
+#include <guichan/focushandler.hpp>
#include <fstream>
#include <physfs.h>
@@ -544,11 +545,13 @@ void Game::handleInput()
}
}
- if (!(chatWindow->isInputFocused() || deathNotice || weightNotice))
+ if (!chatWindow->isInputFocused()
+ && !gui->getFocusHandler()->getModalFocused())
+ {
if (keyboard.isKeyActive(keyboard.KEY_OK))
{
#ifdef TMWSERV_SUPPORT
- // Don not focus chat input when quit dialog is active
+ // Do not focus chat input when quit dialog is active
if (quitDialog != NULL && quitDialog->isVisible())
continue;
#else
@@ -579,6 +582,7 @@ void Game::handleInput()
if (chatWindow->requestChatFocus())
used = true;
}
+ }
if (!chatWindow->isInputFocused() || (event.key.keysym.mod & KMOD_ALT))