diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-03-01 15:40:45 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-03-01 15:40:45 +0300 |
commit | c9a0a01ffff11b23c517cc2d0c6a08a83c7a8158 (patch) | |
tree | d5e06d87250dd4be2a70b672eaea7145396d5dc5 /src | |
parent | 5f4951d34c52e92ddd38606b140e8dcded25448c (diff) | |
download | manaplus-c9a0a01ffff11b23c517cc2d0c6a08a83c7a8158.tar.gz manaplus-c9a0a01ffff11b23c517cc2d0c6a08a83c7a8158.tar.bz2 manaplus-c9a0a01ffff11b23c517cc2d0c6a08a83c7a8158.tar.xz manaplus-c9a0a01ffff11b23c517cc2d0c6a08a83c7a8158.zip |
Add chat command /guildrecall. Also add it to player context menu.
Diffstat (limited to 'src')
-rw-r--r-- | src/actions/commands.cpp | 9 | ||||
-rw-r--r-- | src/actions/commands.h | 1 | ||||
-rw-r--r-- | src/dyetool/actions/commands.cpp | 1 | ||||
-rw-r--r-- | src/enums/input/inputaction.h | 1 | ||||
-rw-r--r-- | src/gui/popups/popupmenu.cpp | 20 | ||||
-rw-r--r-- | src/input/inputactionmap.h | 6 | ||||
-rw-r--r-- | src/net/adminhandler.h | 2 | ||||
-rw-r--r-- | src/net/eathena/adminhandler.cpp | 5 | ||||
-rw-r--r-- | src/net/eathena/adminhandler.h | 2 | ||||
-rw-r--r-- | src/net/tmwa/adminhandler.cpp | 4 | ||||
-rw-r--r-- | src/net/tmwa/adminhandler.h | 2 |
11 files changed, 48 insertions, 5 deletions
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp index a163ad5ab..9e70c55de 100644 --- a/src/actions/commands.cpp +++ b/src/actions/commands.cpp @@ -1533,4 +1533,13 @@ impHandler(commandBreakGuild) return true; } +impHandler(commandGuildRecall) +{ + const std::string args = event.args; + if (args.empty()) + return false; + adminHandler->guildRecall(args); + return true; +} + } // namespace Actions diff --git a/src/actions/commands.h b/src/actions/commands.h index e314226cb..41db1e042 100644 --- a/src/actions/commands.h +++ b/src/actions/commands.h @@ -137,6 +137,7 @@ namespace Actions decHandler(commandChangePartyLeader); decHandler(commandPartyRecall); decHandler(commandBreakGuild); + decHandler(commandGuildRecall); } // namespace Actions #undef decHandler diff --git a/src/dyetool/actions/commands.cpp b/src/dyetool/actions/commands.cpp index 50ccc0c9f..1da8b9540 100644 --- a/src/dyetool/actions/commands.cpp +++ b/src/dyetool/actions/commands.cpp @@ -137,5 +137,6 @@ impHandlerVoid(commandNpcShow) impHandlerVoid(commandChangePartyLeader) impHandlerVoid(commandPartyRecall) impHandlerVoid(commandBreakGuild) +impHandlerVoid(commandGuildRecall) } // namespace Actions diff --git a/src/enums/input/inputaction.h b/src/enums/input/inputaction.h index 96d9fca3e..71a0e4631 100644 --- a/src/enums/input/inputaction.h +++ b/src/enums/input/inputaction.h @@ -666,6 +666,7 @@ enumStart(InputAction) COMMAND_CHANGE_PARTY_LEADER, COMMAND_PARTY_RECALL, COMMAND_BREAK_GUILD, + COMMAND_GUILD_RECALL, TOTAL } enumEnd(InputAction); diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index dae11fd12..101072d58 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -2771,12 +2771,22 @@ void PopupMenu::showPlayerGMCommands(const std::string &name) { Being *const being = actorManager->findBeingByName(name, ActorType::Player); - if (being && !being->getPartyName().empty()) + if (being) { - mBrowserBox->addRow("/partyrecall 'PARTY'", - // TRANSLATORS: popup menu item - // TRANSLATORS: recall all party to player location - _("Recall party")); + if (!being->getPartyName().empty()) + { + mBrowserBox->addRow("/partyrecall 'PARTY'", + // TRANSLATORS: popup menu item + // TRANSLATORS: recall all party members to player location + _("Recall party")); + } + if (!being->getGuildName().empty()) + { + mBrowserBox->addRow("/guildrecall 'PARTY'", + // TRANSLATORS: popup menu item + // TRANSLATORS: recall all guild members to player location + _("Recall guild")); + } } if (localPlayer && localPlayer->isInParty()) { diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h index b8df98796..e2e2a8b14 100644 --- a/src/input/inputactionmap.h +++ b/src/input/inputactionmap.h @@ -5485,6 +5485,12 @@ static const InputActionData inputActionData "breakguild|gmbreakguild", UseArgs_true, Protected_true}, + {"keyCommandGuildRecall", + defaultAction(&Actions::commandGuildRecall), + InputCondition::INGAME, + "guildrecall|recallguild", + UseArgs_true, + Protected_true}, }; #undef defaultAction diff --git a/src/net/adminhandler.h b/src/net/adminhandler.h index ee9c2b76a..71517229f 100644 --- a/src/net/adminhandler.h +++ b/src/net/adminhandler.h @@ -176,6 +176,8 @@ class AdminHandler notfinal virtual void partyRecall(const std::string &name) const = 0; virtual void breakGuild(const std::string &name) const = 0; + + virtual void guildRecall(const std::string &name) const = 0; }; } // namespace Net diff --git a/src/net/eathena/adminhandler.cpp b/src/net/eathena/adminhandler.cpp index d02a26479..0084c6e98 100644 --- a/src/net/eathena/adminhandler.cpp +++ b/src/net/eathena/adminhandler.cpp @@ -362,4 +362,9 @@ void AdminHandler::breakGuild(const std::string &name) const Gm::runCharCommand("breakguild", name); } +void AdminHandler::guildRecall(const std::string &name) const +{ + Gm::runCommand("guildrecall", name); +} + } // namespace EAthena diff --git a/src/net/eathena/adminhandler.h b/src/net/eathena/adminhandler.h index d5f937307..542fab695 100644 --- a/src/net/eathena/adminhandler.h +++ b/src/net/eathena/adminhandler.h @@ -152,6 +152,8 @@ class AdminHandler final : public Ea::AdminHandler void breakGuild(const std::string &name) const override final; + void guildRecall(const std::string &name) const override final; + protected: static std::string mStatsName; }; diff --git a/src/net/tmwa/adminhandler.cpp b/src/net/tmwa/adminhandler.cpp index edcb5f76a..b6c4ff33e 100644 --- a/src/net/tmwa/adminhandler.cpp +++ b/src/net/tmwa/adminhandler.cpp @@ -283,4 +283,8 @@ void AdminHandler::breakGuild(const std::string &name A_UNUSED) const { } +void AdminHandler::guildRecall(const std::string &name A_UNUSED) const +{ +} + } // namespace TmwAthena diff --git a/src/net/tmwa/adminhandler.h b/src/net/tmwa/adminhandler.h index bff931718..21eddd437 100644 --- a/src/net/tmwa/adminhandler.h +++ b/src/net/tmwa/adminhandler.h @@ -165,6 +165,8 @@ class AdminHandler final : public Ea::AdminHandler void partyRecall(const std::string &name) const override final A_CONST; void breakGuild(const std::string &name) const override final A_CONST; + + void guildRecall(const std::string &name) const override final A_CONST; }; } // namespace TmwAthena |