summaryrefslogtreecommitdiff
path: root/src/gui/chat.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-02-08 14:40:04 -0700
committerJared Adams <jaxad0127@gmail.com>2010-02-08 14:43:51 -0700
commit8a31e96d8534d402db9cd48183c0b15732f7d95e (patch)
tree885d83febf301c1289c3bf7f83bf9dca89e0347c /src/gui/chat.cpp
parentbc5c031e43eff506c925682349dd2a52b89d6565 (diff)
downloadmana-8a31e96d8534d402db9cd48183c0b15732f7d95e.tar.gz
mana-8a31e96d8534d402db9cd48183c0b15732f7d95e.tar.bz2
mana-8a31e96d8534d402db9cd48183c0b15732f7d95e.tar.xz
mana-8a31e96d8534d402db9cd48183c0b15732f7d95e.zip
Merge PartyWindow and GuildWindow into SocialWindow
Diffstat (limited to 'src/gui/chat.cpp')
-rw-r--r--src/gui/chat.cpp22
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 == "")