From fb062d9f90d44e279ce02985c3f4f4335550cf87 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 25 Aug 2014 21:38:12 +0300 Subject: Move chat command /all into actions. --- src/actions/commands.cpp | 10 ++++++++++ src/actions/commands.h | 1 + src/commands.cpp | 10 ---------- src/commands.h | 5 +---- src/input/inputaction.h | 1 + src/input/inputactionmap.h | 9 +++++++++ src/input/pages/other.cpp | 6 ++++++ 7 files changed, 28 insertions(+), 14 deletions(-) diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp index 103248aa8..797c75edb 100644 --- a/src/actions/commands.cpp +++ b/src/actions/commands.cpp @@ -262,4 +262,14 @@ impHandler0(present) return false; } +impHandler0(printAll) +{ + if (actorManager) + { + actorManager->printAllToChat(); + return true; + } + return false; +} + } // namespace Actions diff --git a/src/actions/commands.h b/src/actions/commands.h index bd9a7148c..02810286c 100644 --- a/src/actions/commands.h +++ b/src/actions/commands.h @@ -37,6 +37,7 @@ namespace Actions decHandler(chatEnemy); decHandler(chatErase); decHandler(present); + decHandler(printAll); } // namespace Actions #undef decHandler diff --git a/src/commands.cpp b/src/commands.cpp index 01639ebbd..4e4c2ef5f 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -251,16 +251,6 @@ static void outStringNormal(ChatTab *const tab, } } -impHandler0(showAll) -{ - if (actorManager) - { - actorManager->printAllToChat(); - return true; - } - return false; -} - impHandler(move) { int x = 0; diff --git a/src/commands.h b/src/commands.h index 6ca88553b..41b2231c8 100644 --- a/src/commands.h +++ b/src/commands.h @@ -51,7 +51,6 @@ struct CommandInfo final namespace Commands { - decHandler(showAll); decHandler(move); decHandler(target); decHandler(attackHuman); @@ -117,8 +116,7 @@ namespace Commands enum { - COMMAND_ALL = 0, - COMMAND_MOVE, + COMMAND_MOVE = 0, COMMAND_TARGET, COMMAND_ATKHUMAN, COMMAND_OUTFIT, @@ -183,7 +181,6 @@ enum static const CommandInfo commands[] = { - {"all", &Commands::showAll, -1, false}, {"move", &Commands::move, -1, true}, {"target", &Commands::target, -1, true}, {"atkhuman", &Commands::attackHuman, -1, true}, diff --git a/src/input/inputaction.h b/src/input/inputaction.h index e9813d3d8..9385ae765 100644 --- a/src/input/inputaction.h +++ b/src/input/inputaction.h @@ -366,6 +366,7 @@ namespace InputAction ME, TOGGLE, PRESENT, + PRINT_ALL, TOTAL }; } // namespace InputAction diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h index ff7b3bf6e..b55887c65 100644 --- a/src/input/inputactionmap.h +++ b/src/input/inputactionmap.h @@ -3063,6 +3063,15 @@ static const InputActionData inputActionData[InputAction::TOTAL] = { InputAction::NO_VALUE, 50, InputCondition::INGAME, "present", + false}, + {"keyPrintAll", + InputType::UNKNOWN, InputAction::NO_VALUE, + InputType::UNKNOWN, InputAction::NO_VALUE, + Input::GRP_DEFAULT, + &Actions::printAll, + InputAction::NO_VALUE, 50, + InputCondition::INGAME, + "all", false} }; diff --git a/src/input/pages/other.cpp b/src/input/pages/other.cpp index 46a1eb286..c7db9c05d 100644 --- a/src/input/pages/other.cpp +++ b/src/input/pages/other.cpp @@ -231,6 +231,12 @@ SetupActionData setupActionDataOther[] = InputAction::PRESENT, "", }, + { + // TRANSLATORS: input action name + N_("Print all visible beings in chat"), + InputAction::PRINT_ALL, + "", + }, { "", InputAction::NO_VALUE, -- cgit v1.2.3-60-g2f50