diff options
Diffstat (limited to 'src/gui/chat.cpp')
-rw-r--r-- | src/gui/chat.cpp | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index 1c18a438..0377dbf8 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -24,11 +24,11 @@ #include "beingmanager.h" #include "configuration.h" #include "localplayer.h" +#include "party.h" #include "gui/recorder.h" #include "gui/setup.h" #include "gui/sdlinput.h" -#include "gui/partywindow.h" #include "gui/widgets/chattab.h" #include "gui/widgets/itemlinkhandler.h" @@ -75,8 +75,7 @@ class ChatInput : public TextField, public gcn::FocusListener ChatWindow::ChatWindow(): Window(_("Chat")), - mTmpVisible(false), - mCurrentTab(NULL) + mTmpVisible(false) { setWindowName("Chat"); @@ -128,15 +127,6 @@ void ChatWindow::resetToDefaultSize() Window::resetToDefaultSize(); } -void ChatWindow::logic() -{ - Window::logic(); - - Tab *tab = getFocused(); - if (tab != mCurrentTab) - mCurrentTab = tab; -} - ChatTab *ChatWindow::getFocused() const { return dynamic_cast<ChatTab*>(mChatTabs->getSelectedTab()); @@ -338,7 +328,7 @@ void ChatWindow::mousePressed(gcn::MouseEvent &event) if (event.isConsumed()) return; - mMoved = event.getY() <= mCurrentTab->getHeight(); + mMoved = event.getY() <= getFocused()->getHeight(); mDragOffsetX = event.getX(); mDragOffsetY = event.getY(); @@ -533,7 +523,11 @@ void ChatWindow::autoComplete() std::vector<std::string> nameList; if (cTab && cTab->getType() == ChatTab::PARTY) { - partyWindow->getNames(nameList); + Party *p = player_node->getParty(); + + if (p) // Shouldn't be needed, but lets be safe + p->getNames(nameList); + newName = autoComplete(nameList, name); } if (newName == "") |