From a65570a60c1d2f58d2f3fe01a4a54cd08a90d932 Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Sat, 28 Feb 2009 10:49:55 -0700 Subject: Allow chatting while talking to NPCs --- src/gui/chat.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/gui/chat.cpp') 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() -- cgit v1.2.3-70-g09d2