summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-02-12 12:14:01 +0300
committerAndrei Karas <akaras@inbox.ru>2014-02-12 12:14:01 +0300
commite10e6c7f8860536986b455b58b907026996b28fa (patch)
tree5281f76c52d61be643ff7ef44804a361b079829b
parent165556c8ddf4d3a036d6d89e680e208d2b435866 (diff)
downloadmanaplus-e10e6c7f8860536986b455b58b907026996b28fa.tar.gz
manaplus-e10e6c7f8860536986b455b58b907026996b28fa.tar.bz2
manaplus-e10e6c7f8860536986b455b58b907026996b28fa.tar.xz
manaplus-e10e6c7f8860536986b455b58b907026996b28fa.zip
add autocomplete special commands in party tab.
-rw-r--r--src/gui/widgets/tabs/chattab.h3
-rw-r--r--src/gui/windows/chatwindow.cpp6
-rw-r--r--src/net/ea/gui/partytab.cpp10
-rw-r--r--src/net/ea/gui/partytab.h4
4 files changed, 22 insertions, 1 deletions
diff --git a/src/gui/widgets/tabs/chattab.h b/src/gui/widgets/tabs/chattab.h
index 9790c33e4..404d59b91 100644
--- a/src/gui/widgets/tabs/chattab.h
+++ b/src/gui/widgets/tabs/chattab.h
@@ -195,6 +195,9 @@ class ChatTab : public Tab
virtual void getAutoCompleteList(StringVect&) const
{}
+ virtual void getAutoCompleteCommands(StringVect&) const
+ {}
+
void addRow(std::string &line);
BrowserBox *mTextOutput;
diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp
index 5b0bb69b6..61817053a 100644
--- a/src/gui/windows/chatwindow.cpp
+++ b/src/gui/windows/chatwindow.cpp
@@ -1337,6 +1337,12 @@ void ChatWindow::autoComplete()
if (!newName.empty() && !startName)
secureChatCommand(newName);
+ if (cTab && newName.empty())
+ {
+ cTab->getAutoCompleteCommands(nameList);
+ newName = autoComplete(nameList, name);
+ }
+
if (newName.empty() && actorManager)
{
actorManager->getPlayerNames(nameList, true);
diff --git a/src/net/ea/gui/partytab.cpp b/src/net/ea/gui/partytab.cpp
index 4a59e89b7..1307e2882 100644
--- a/src/net/ea/gui/partytab.cpp
+++ b/src/net/ea/gui/partytab.cpp
@@ -275,6 +275,16 @@ void PartyTab::getAutoCompleteList(StringVect &names) const
p->getNames(names);
}
+void PartyTab::getAutoCompleteCommands(StringVect &names) const
+{
+ names.push_back("/help");
+ names.push_back("/invite ");
+ names.push_back("/leave");
+ names.push_back("/kick ");
+ names.push_back("/item");
+ names.push_back("/exp");
+}
+
void PartyTab::saveToLogFile(const std::string &msg) const
{
if (chatLogger)
diff --git a/src/net/ea/gui/partytab.h b/src/net/ea/gui/partytab.h
index a73fbaaeb..6662b3ae1 100644
--- a/src/net/ea/gui/partytab.h
+++ b/src/net/ea/gui/partytab.h
@@ -57,7 +57,9 @@ class PartyTab : public ChatTab, public ConfigListener
protected:
void handleInput(const std::string &msg) override final;
- virtual void getAutoCompleteList(StringVect&) const override final;
+ void getAutoCompleteList(StringVect&) const override final;
+
+ void getAutoCompleteCommands(StringVect &names) const override final;
};
extern PartyTab *partyTab;