diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-02-15 17:01:46 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-02-15 17:01:46 +0300 |
commit | 382067b05c4fe97bcf0da0143405375ec295f7c6 (patch) | |
tree | f668cd2595ac0c85f0942f88729d3ff1956676fa /src/gui/widgets/tabs/guildchattab.cpp | |
parent | ee8191705826d978b7793497fdd307536c709bff (diff) | |
parent | 9b329556e748050c4300174e9bdc72b15e5b8cc5 (diff) | |
download | plus-382067b05c4fe97bcf0da0143405375ec295f7c6.tar.gz plus-382067b05c4fe97bcf0da0143405375ec295f7c6.tar.bz2 plus-382067b05c4fe97bcf0da0143405375ec295f7c6.tar.xz plus-382067b05c4fe97bcf0da0143405375ec295f7c6.zip |
Merge branch 'master' into stable
Diffstat (limited to 'src/gui/widgets/tabs/guildchattab.cpp')
-rw-r--r-- | src/gui/widgets/tabs/guildchattab.cpp | 62 |
1 files changed, 10 insertions, 52 deletions
diff --git a/src/gui/widgets/tabs/guildchattab.cpp b/src/gui/widgets/tabs/guildchattab.cpp index 364b83968..da1a651e1 100644 --- a/src/gui/widgets/tabs/guildchattab.cpp +++ b/src/gui/widgets/tabs/guildchattab.cpp @@ -55,50 +55,16 @@ GuildChatTab::~GuildChatTab() bool GuildChatTab::handleCommand(const std::string &restrict type, const std::string &restrict args) { - if (type == "help") - { - if (args == "invite") - { - // TRANSLATORS: guild chat tab help - chatLog(_("Command: /invite <nick>")); - // TRANSLATORS: guild chat tab help - chatLog(_("This command invites <nick> to the guild you're in.")); - // TRANSLATORS: guild chat tab help - chatLog(_("If the <nick> has spaces in it, enclose it in " - "double quotes (\").")); - } - else if (args == "leave") - { - // TRANSLATORS: guild chat tab help - chatLog(_("Command: /leave")); - // TRANSLATORS: guild chat tab help - chatLog(_("This command causes the player to leave the guild.")); - } - else - { - return false; - } - } - else if (type == "invite" && guildManager) - { + if (type == "invite" && guildManager) guildManager->invite(args); - } else if (type == "leave" && guildManager) - { guildManager->leave(); - } else if (type == "kick" && guildManager) - { guildManager->kick(args); - } else if (type == "notice" && guildManager) - { guildManager->notice(args); - } else - { return false; - } return true; } @@ -107,23 +73,7 @@ void GuildChatTab::handleInput(const std::string &msg) { if (!guildManager) return; - - if (chatWindow) - guildManager->chat(chatWindow->doReplace(msg)); - else - guildManager->chat(msg); -} - -void GuildChatTab::showHelp() -{ - // TRANSLATORS: guild chat tab help - chatLog(_("/help > Display this help.")); - // TRANSLATORS: guild chat tab help - chatLog(_("/invite > Invite a player to your guild")); - // TRANSLATORS: guild chat tab help - chatLog(_("/leave > Leave the guild you are in")); - // TRANSLATORS: guild chat tab help - chatLog(_("/kick > Kick someone from the guild you are in")); + guildManager->chat(ChatWindow::doReplace(msg)); } void GuildChatTab::getAutoCompleteList(StringVect &names) const @@ -132,6 +82,14 @@ void GuildChatTab::getAutoCompleteList(StringVect &names) const return; guildManager->getNames(names); +} + +void GuildChatTab::getAutoCompleteCommands(StringVect &names) const +{ + names.push_back("/help"); + names.push_back("/invite "); + names.push_back("/leave"); + names.push_back("/kick "); names.push_back("/notice "); } |