diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-12-11 23:53:57 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-12-11 23:53:57 +0300 |
commit | e9fccf3db2f44531e013d708a64550ebb6c4927a (patch) | |
tree | 8dc3469dd0d3b463746bcb88d50ac4061f74def3 | |
parent | f441bb5b1dbb6ea579d7628f39bdd1f53787756e (diff) | |
download | manaplus-e9fccf3db2f44531e013d708a64550ebb6c4927a.tar.gz manaplus-e9fccf3db2f44531e013d708a64550ebb6c4927a.tar.bz2 manaplus-e9fccf3db2f44531e013d708a64550ebb6c4927a.tar.xz manaplus-e9fccf3db2f44531e013d708a64550ebb6c4927a.zip |
Add new chat command for invite to guild.
New chat command: /guild name
-rw-r--r-- | src/actions/chat.cpp | 26 | ||||
-rw-r--r-- | src/actions/chat.h | 1 | ||||
-rw-r--r-- | src/input/inputaction.h | 1 | ||||
-rw-r--r-- | src/input/inputactionmap.h | 9 |
4 files changed, 37 insertions, 0 deletions
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 diff --git a/src/input/inputaction.h b/src/input/inputaction.h index b3b95a8f7..5b9288950 100644 --- a/src/input/inputaction.h +++ b/src/input/inputaction.h @@ -493,6 +493,7 @@ namespace InputAction BUY, SELL, WHISPER2, + GUILD, TOTAL }; } // namespace InputAction diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h index 8e14f911c..292fdc1c1 100644 --- a/src/input/inputactionmap.h +++ b/src/input/inputactionmap.h @@ -4180,6 +4180,15 @@ static const InputActionData inputActionData[InputAction::TOTAL] = { InputCondition::INGAME, "w2|whisper2|msg2", true}, + {"keyGuild", + InputType::UNKNOWN, InputAction::NO_VALUE, + InputType::UNKNOWN, InputAction::NO_VALUE, + Input::GRP_DEFAULT, + &Actions::guild, + InputAction::NO_VALUE, 50, + InputCondition::INGAME, + "guild", + true}, }; #endif // INPUT_INPUTACTIONMAP_H |