From 8a31e96d8534d402db9cd48183c0b15732f7d95e Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Mon, 8 Feb 2010 14:40:04 -0700 Subject: Merge PartyWindow and GuildWindow into SocialWindow --- src/gui/chat.cpp | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'src/gui/chat.cpp') 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(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 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 == "") -- cgit v1.2.3-70-g09d2