From 00cbc7490641a697dbedb85b3b2ff3f75893b7ff Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Mon, 22 Feb 2010 16:49:38 -0700 Subject: Change chat autocompletion to be more flexible Reviewed-by: Chuck Miller --- src/net/ea/gui/partytab.cpp | 11 ++++++++--- src/net/ea/gui/partytab.h | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'src/net') diff --git a/src/net/ea/gui/partytab.cpp b/src/net/ea/gui/partytab.cpp index 6f2ff65a..27e5b2d9 100644 --- a/src/net/ea/gui/partytab.cpp +++ b/src/net/ea/gui/partytab.cpp @@ -19,9 +19,11 @@ * along with this program. If not, see . */ -#include "partytab.h" +#include "net/ea/gui/partytab.h" #include "commandhandler.h" +#include "localplayer.h" +#include "party.h" #include "gui/palette.h" @@ -196,9 +198,12 @@ bool PartyTab::handleCommand(const std::string &type, const std::string &args) return true; } -int PartyTab::getType() const +void PartyTab::getAutoCompleteList(std::vector &names) const { - return ChatTab::PARTY; + Party *p = player_node->getParty(); + + if (p) + p->getNames(names); } } // namespace EAthena diff --git a/src/net/ea/gui/partytab.h b/src/net/ea/gui/partytab.h index da225a07..af111836 100644 --- a/src/net/ea/gui/partytab.h +++ b/src/net/ea/gui/partytab.h @@ -39,10 +39,10 @@ class PartyTab : public ChatTab bool handleCommand(const std::string &type, const std::string &args); - int getType() const; - protected: void handleInput(const std::string &msg); + + virtual void getAutoCompleteList(std::vector&) const; }; extern PartyTab *partyTab; -- cgit v1.2.3-70-g09d2