summaryrefslogtreecommitdiff
path: root/src/gui/widgets/tabs/guildchattab.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/tabs/guildchattab.cpp')
-rw-r--r--src/gui/widgets/tabs/guildchattab.cpp62
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 ");
}