diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-08-26 21:47:16 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-08-26 21:47:16 +0300 |
commit | 8c53409bb625415ddc6fe131061c7e540d56a67e (patch) | |
tree | 95ba8f651a4d15794c0fdf5aebb86e88f56480ca /src | |
parent | 0888773fc1de5cc2aa1d92564e8d05231189e6f9 (diff) | |
download | manaplus-8c53409bb625415ddc6fe131061c7e540d56a67e.tar.gz manaplus-8c53409bb625415ddc6fe131061c7e540d56a67e.tar.bz2 manaplus-8c53409bb625415ddc6fe131061c7e540d56a67e.tar.xz manaplus-8c53409bb625415ddc6fe131061c7e540d56a67e.zip |
Move chat command /removeattack into actions.
Diffstat (limited to 'src')
-rw-r--r-- | src/actions/commands.cpp | 15 | ||||
-rw-r--r-- | src/actions/commands.h | 1 | ||||
-rw-r--r-- | src/commands.cpp | 15 | ||||
-rw-r--r-- | src/commands.h | 6 | ||||
-rw-r--r-- | src/input/inputaction.h | 1 | ||||
-rw-r--r-- | src/input/inputactionmap.h | 9 |
6 files changed, 27 insertions, 20 deletions
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp index 78a2fc0e5..b4ab52ba8 100644 --- a/src/actions/commands.cpp +++ b/src/actions/commands.cpp @@ -496,4 +496,19 @@ impHandler(addAttack) return true; } +impHandler(removeAttack) +{ + if (!actorManager || event.args.empty() + || !actorManager->isInAttackList(event.args)) + { + return false; + } + + actorManager->removeAttackMob(event.args); + + if (socialWindow) + socialWindow->updateAttackFilter(); + return true; +} + } // namespace Actions diff --git a/src/actions/commands.h b/src/actions/commands.h index a1e7b86f9..9686b59d2 100644 --- a/src/actions/commands.h +++ b/src/actions/commands.h @@ -53,6 +53,7 @@ namespace Actions decHandler(wait); decHandler(addPriorityAttack); decHandler(addAttack); + decHandler(removeAttack); } // namespace Actions #undef decHandler diff --git a/src/commands.cpp b/src/commands.cpp index 46d2f17ea..6ba4789c9 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -157,21 +157,6 @@ impHandler(hack) return true; } -impHandler(removeAttack) -{ - if (!actorManager || event.args.empty() - || !actorManager->isInAttackList(event.args)) - { - return false; - } - - actorManager->removeAttackMob(event.args); - - if (socialWindow) - socialWindow->updateAttackFilter(); - return true; -} - impHandler(addIgnoreAttack) { if (!actorManager || actorManager->isInIgnoreAttackList(event.args)) diff --git a/src/commands.h b/src/commands.h index b8d6ab829..4976e7596 100644 --- a/src/commands.h +++ b/src/commands.h @@ -52,7 +52,6 @@ struct CommandInfo final namespace Commands { decHandler(hack); - decHandler(removeAttack); decHandler(addIgnoreAttack); decHandler(serverIgnoreAll); decHandler(serverUnIgnoreAll); @@ -90,8 +89,7 @@ namespace Commands enum { - COMMAND_REMOVEATTACK = 0, - COMMAND_REMOVEIGNOREATTACK, + COMMAND_REMOVEIGNOREATTACK = 0, COMMAND_ADDIGNOREATTACK, COMMAND_DUMP, COMMAND_SERVERIGNOREALL, @@ -129,8 +127,6 @@ enum static const CommandInfo commands[] = { - {"removeattack", Commands::removeAttack, -1, true}, - {"removeignoreattack", &Commands::removeAttack, -1, true}, {"addignoreattack", &Commands::addIgnoreAttack, -1, true}, {"dump", &Commands::dump, -1, false}, {"serverignoreall", &Commands::serverIgnoreAll, -1, false}, diff --git a/src/input/inputaction.h b/src/input/inputaction.h index dfdab0777..e4b9be2f9 100644 --- a/src/input/inputaction.h +++ b/src/input/inputaction.h @@ -391,6 +391,7 @@ namespace InputAction UPTIME, ADD_PRIORITY_ATTACK, ADD_ATTACK, + REMOVE_ATTACK, TOTAL }; } // namespace InputAction diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h index b7f59361d..9a6b4d576 100644 --- a/src/input/inputactionmap.h +++ b/src/input/inputactionmap.h @@ -3288,6 +3288,15 @@ static const InputActionData inputActionData[InputAction::TOTAL] = { InputAction::NO_VALUE, 50, InputCondition::INGAME, "addattack", + true}, + {"keyRemoveAttack", + InputType::UNKNOWN, InputAction::NO_VALUE, + InputType::UNKNOWN, InputAction::NO_VALUE, + Input::GRP_DEFAULT, + &Actions::removeAttack, + InputAction::NO_VALUE, 50, + InputCondition::INGAME, + "removeattack|removeignoreattack", true} }; |