summaryrefslogtreecommitdiff
path: root/src/gui/chat.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-02-28 10:49:55 -0700
committerJared Adams <jaxad0127@gmail.com>2009-02-28 10:49:55 -0700
commita65570a60c1d2f58d2f3fe01a4a54cd08a90d932 (patch)
tree91d5e6026b2e23c907b227af06ae3923677eca80 /src/gui/chat.cpp
parent49665def0ef539fc8c24cb66817fbf7e0408a1a4 (diff)
downloadmana-client-a65570a60c1d2f58d2f3fe01a4a54cd08a90d932.tar.gz
mana-client-a65570a60c1d2f58d2f3fe01a4a54cd08a90d932.tar.bz2
mana-client-a65570a60c1d2f58d2f3fe01a4a54cd08a90d932.tar.xz
mana-client-a65570a60c1d2f58d2f3fe01a4a54cd08a90d932.zip
Allow chatting while talking to NPCs
Diffstat (limited to 'src/gui/chat.cpp')
-rw-r--r--src/gui/chat.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp
index ac13355c..20d0213b 100644
--- a/src/gui/chat.cpp
+++ b/src/gui/chat.cpp
@@ -284,7 +284,7 @@ void ChatWindow::action(const gcn::ActionEvent &event)
}
}
-void ChatWindow::requestChatFocus()
+bool ChatWindow::requestChatFocus()
{
// Make sure chatWindow is visible
if (!isVisible())
@@ -299,9 +299,14 @@ void ChatWindow::requestChatFocus()
mTmpVisible = true;
}
+ // Don't do anything else if the input is already visible and has focus
+ if (mChatInput->isVisible() && mChatInput->isFocused())
+ return false;
+
// Give focus to the chat input
mChatInput->setVisible(true);
mChatInput->requestFocus();
+ return true;
}
bool ChatWindow::isInputFocused()