diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-05-25 22:43:25 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-05-25 22:43:25 +0300 |
commit | ee82a8e3ca61d176e52078f8326d92e2220af2d0 (patch) | |
tree | beeef611c4b41dc056663126f6abb50dde91ef38 | |
parent | 0f49c02c2813ce853a7699b673103c8ef5edc05d (diff) | |
download | manaverse-ee82a8e3ca61d176e52078f8326d92e2220af2d0.tar.gz manaverse-ee82a8e3ca61d176e52078f8326d92e2220af2d0.tar.bz2 manaverse-ee82a8e3ca61d176e52078f8326d92e2220af2d0.tar.xz manaverse-ee82a8e3ca61d176e52078f8326d92e2220af2d0.zip |
Add chat command for recall player.
-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 | 6 | ||||
-rw-r--r-- | src/input/inputactionmap.h | 6 |
6 files changed, 19 insertions, 5 deletions
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp index 08c1fcbba..81f40697b 100644 --- a/src/actions/commands.cpp +++ b/src/actions/commands.cpp @@ -1447,6 +1447,15 @@ impHandler(commandGotoPc) return true; } +impHandler(commandRecallPc) +{ + const std::string args = event.args; + if (args.empty()) + return false; + adminHandler->recallName(args); + return true; +} + impHandler(commandKiller) { adminHandler->killer(event.args); diff --git a/src/actions/commands.h b/src/actions/commands.h index ed4deb9f5..24860b8f2 100644 --- a/src/actions/commands.h +++ b/src/actions/commands.h @@ -124,6 +124,7 @@ namespace Actions decHandler(commandRandomWarp); decHandler(commandGotoNpc); decHandler(commandGotoPc); + decHandler(commandRecallPc); decHandler(commandKiller); decHandler(commandKillable); decHandler(commandHeal); diff --git a/src/dyetool/actions/commands.cpp b/src/dyetool/actions/commands.cpp index 522ead2f2..e458d494e 100644 --- a/src/dyetool/actions/commands.cpp +++ b/src/dyetool/actions/commands.cpp @@ -124,6 +124,7 @@ impHandlerVoid(commandLoadPosition) impHandlerVoid(commandRandomWarp) impHandlerVoid(commandGotoNpc) impHandlerVoid(commandGotoPc) +impHandlerVoid(commandRecallPc) impHandlerVoid(commandKiller) impHandlerVoid(commandKillable) impHandlerVoid(commandHeal) diff --git a/src/enums/input/inputaction.h b/src/enums/input/inputaction.h index 094102f2c..21749b296 100644 --- a/src/enums/input/inputaction.h +++ b/src/enums/input/inputaction.h @@ -698,6 +698,7 @@ enumStart(InputAction) CLEAR_OUTFIT, CLIPBOARD_COPY, COMMAND_GOTO_PC, + COMMAND_RECALL_PC, TOTAL } enumEnd(InputAction); diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index 6b3aaf68a..da729206c 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -1253,10 +1253,6 @@ void PopupMenu::handleLink(const std::string &link, if (mTextField) mTextField->handlePaste(); } - else if (link == "recall" && !mName.empty()) - { - adminHandler->recallName(mName); - } else if (link == "ipcheck" && !mName.empty()) { adminHandler->ipcheckName(mName); @@ -2811,7 +2807,7 @@ void PopupMenu::showPlayerGMCommands(const std::string &name) mBrowserBox->addRow("/gotopc 'NAME'", _("Goto")); // TRANSLATORS: popup menu item // TRANSLATORS: recall player to current position - mBrowserBox->addRow("recall", _("Recall")); + mBrowserBox->addRow("/recallpc 'NAME'", _("Recall")); // TRANSLATORS: popup menu item // TRANSLATORS: revive player mBrowserBox->addRow("/alive 'NAME'", _("Revive")); diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h index e42e659d8..203d3067d 100644 --- a/src/input/inputactionmap.h +++ b/src/input/inputactionmap.h @@ -5678,6 +5678,12 @@ static const InputActionData inputActionData "goto|gotopc", UseArgs_true, Protected_true}, + {"keyCommandRecallPc", + defaultAction(&Actions::commandRecallPc), + InputCondition::INGAME, + "recall|recallpc", + UseArgs_true, + Protected_true}, }; #undef defaultAction |