From e9fccf3db2f44531e013d708a64550ebb6c4927a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 11 Dec 2014 23:53:57 +0300 Subject: Add new chat command for invite to guild. New chat command: /guild name --- src/actions/chat.cpp | 26 ++++++++++++++++++++++++++ src/actions/chat.h | 1 + 2 files changed, 27 insertions(+) (limited to 'src/actions') diff --git a/src/actions/chat.cpp b/src/actions/chat.cpp index 142f9000e..2c7d84f91 100644 --- a/src/actions/chat.cpp +++ b/src/actions/chat.cpp @@ -340,6 +340,32 @@ impHandler(party) return true; } +impHandler(guild) +{ + if (!event.tab || !localPlayer) + return false; + + const std::string args = event.args; + if (!args.empty()) + { + const Guild *const guild = localPlayer->getGuild(); + if (guild) + { + if (guild->getServerGuild()) + guildHandler->invite(guild->getId(), args); + else if (guildManager) + guildManager->invite(args); + } + } + else + { + // TRANSLATORS: guild invite message + event.tab->chatLog(_("Please specify a name."), + ChatMsgType::BY_SERVER); + } + return true; +} + impHandler(me) { outString(event.tab, textToMe(event.args), event.args); diff --git a/src/actions/chat.h b/src/actions/chat.h index 321357553..459ee675d 100644 --- a/src/actions/chat.h +++ b/src/actions/chat.h @@ -42,6 +42,7 @@ namespace Actions decHandler(createParty); decHandler(createGuild); decHandler(party); + decHandler(guild); decHandler(me); decHandler(toggle); } // namespace Actions -- cgit v1.2.3-70-g09d2