diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-08-26 18:48:18 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-08-26 18:49:47 +0300 |
commit | 647c1a8b8b02b737b11b1e08af86ecc84f649a81 (patch) | |
tree | 1b1f30daaeeee39dd19195f07401a8bfd6a142f4 /src | |
parent | 537b66dbab370463a4a8d0d860a98626f73b4635 (diff) | |
download | manaplus-647c1a8b8b02b737b11b1e08af86ecc84f649a81.tar.gz manaplus-647c1a8b8b02b737b11b1e08af86ecc84f649a81.tar.bz2 manaplus-647c1a8b8b02b737b11b1e08af86ecc84f649a81.tar.xz manaplus-647c1a8b8b02b737b11b1e08af86ecc84f649a81.zip |
Move chat command /undress into actions.
Diffstat (limited to 'src')
-rw-r--r-- | src/actions/actions.cpp | 14 | ||||
-rw-r--r-- | src/actions/actions.h | 1 | ||||
-rw-r--r-- | src/commands.cpp | 11 | ||||
-rw-r--r-- | src/commands.h | 5 | ||||
-rw-r--r-- | src/input/inputaction.h | 1 | ||||
-rw-r--r-- | src/input/inputactionmap.h | 9 | ||||
-rw-r--r-- | src/input/pages/other.cpp | 6 |
7 files changed, 32 insertions, 15 deletions
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp index 3a8aeaa4a..6c5f365af 100644 --- a/src/actions/actions.cpp +++ b/src/actions/actions.cpp @@ -70,6 +70,7 @@ #include "render/graphics.h" +#include "net/beinghandler.h" #include "net/chathandler.h" #include "net/gamehandler.h" #include "net/ipc.h" @@ -681,4 +682,17 @@ impHandler0(disconnect) return true; } +impHandler(undress) +{ + if (!actorManager || !localPlayer) + return false; + + Being *target = localPlayer->getTarget(); + if (!target) + target = actorManager->findNearestByName(event.args); + if (target) + Net::getBeingHandler()->undress(target); + return true; +} + } // namespace Actions diff --git a/src/actions/actions.h b/src/actions/actions.h index 9e7e9f12c..4b586b169 100644 --- a/src/actions/actions.h +++ b/src/actions/actions.h @@ -65,6 +65,7 @@ namespace Actions decHandler(priceSave); decHandler(cacheInfo); decHandler(disconnect); + decHandler(undress); } // namespace Actions #undef decHandler diff --git a/src/commands.cpp b/src/commands.cpp index a8aa3a661..78ea09576 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -157,17 +157,6 @@ impHandler(hack) return true; } -impHandler(undress) -{ - if (!actorManager) - return false; - - Being *const target = actorManager->findNearestByName(event.args); - if (target) - Net::getBeingHandler()->undress(target); - return true; -} - impHandler(attack) { if (!localPlayer || !actorManager) diff --git a/src/commands.h b/src/commands.h index 9af069bc9..2089cb760 100644 --- a/src/commands.h +++ b/src/commands.h @@ -52,7 +52,6 @@ struct CommandInfo final namespace Commands { decHandler(hack); - decHandler(undress); decHandler(attack); decHandler(dirs); decHandler(info); @@ -98,8 +97,7 @@ namespace Commands enum { - COMMAND_UNDRESS = 0, - COMMAND_ATTACK, + COMMAND_ATTACK = 0, COMMAND_DIRS, COMMAND_INFO, COMMAND_WAIT, @@ -145,7 +143,6 @@ enum static const CommandInfo commands[] = { - {"undress", &Commands::undress, -1, true}, {"attack", &Commands::attack, -1, true}, {"dirs", &Commands::dirs, -1, false}, {"info", &Commands::info, -1, false}, diff --git a/src/input/inputaction.h b/src/input/inputaction.h index 403433064..67ed7a8a0 100644 --- a/src/input/inputaction.h +++ b/src/input/inputaction.h @@ -384,6 +384,7 @@ namespace InputAction PRICE_SAVE, CACHE_INFO, DISCONNECT, + UNDRESS, TOTAL }; } // namespace InputAction diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h index 0dde3f848..952926510 100644 --- a/src/input/inputactionmap.h +++ b/src/input/inputactionmap.h @@ -3225,6 +3225,15 @@ static const InputActionData inputActionData[InputAction::TOTAL] = { InputAction::NO_VALUE, 50, InputCondition::INGAME, "disconnect", + false}, + {"keyUndress", + InputType::UNKNOWN, InputAction::NO_VALUE, + InputType::UNKNOWN, InputAction::NO_VALUE, + Input::GRP_DEFAULT, + &Actions::undress, + InputAction::NO_VALUE, 50, + InputCondition::INGAME, + "undress", false} }; diff --git a/src/input/pages/other.cpp b/src/input/pages/other.cpp index 4c28e5a3b..5d9aca31e 100644 --- a/src/input/pages/other.cpp +++ b/src/input/pages/other.cpp @@ -257,6 +257,12 @@ SetupActionData setupActionDataOther[] = }, { // TRANSLATORS: input action name + N_("Undress selected player"), + InputAction::UNDRESS, + "", + }, + { + // TRANSLATORS: input action name N_("Quick disconnect from server"), InputAction::DISCONNECT, "", |