From c7266cda03bcab72b147b5597a126f01f915fe2c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 26 Aug 2014 22:53:07 +0300 Subject: Move chat command /serverignoreall into actions. --- src/actions/actions.cpp | 6 ++++++ src/actions/actions.h | 1 + src/commands.cpp | 6 ------ src/commands.h | 5 +---- src/input/inputaction.h | 1 + src/input/inputactionmap.h | 9 +++++++++ src/input/pages/chat.cpp | 6 ++++++ 7 files changed, 24 insertions(+), 10 deletions(-) diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp index 3111c551f..46a3d74d8 100644 --- a/src/actions/actions.cpp +++ b/src/actions/actions.cpp @@ -872,4 +872,10 @@ impHandler0(dump) } #endif +impHandler0(serverIgnoreAll) +{ + Net::getChatHandler()->ignoreAll(); + return true; +} + } // namespace Actions diff --git a/src/actions/actions.h b/src/actions/actions.h index 5a60e83f9..a731574bb 100644 --- a/src/actions/actions.h +++ b/src/actions/actions.h @@ -69,6 +69,7 @@ namespace Actions decHandler(dirs); decHandler(uptime); decHandler(dump); + decHandler(serverIgnoreAll); } // namespace Actions #undef decHandler diff --git a/src/commands.cpp b/src/commands.cpp index b1c6537f6..b5491a805 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -157,12 +157,6 @@ impHandler(hack) return true; } -impHandler0(serverIgnoreAll) -{ - Net::getChatHandler()->ignoreAll(); - return true; -} - impHandler0(serverUnIgnoreAll) { Net::getChatHandler()->unIgnoreAll(); diff --git a/src/commands.h b/src/commands.h index 9bad6c4ab..d90974eaf 100644 --- a/src/commands.h +++ b/src/commands.h @@ -52,7 +52,6 @@ struct CommandInfo final namespace Commands { decHandler(hack); - decHandler(serverIgnoreAll); decHandler(serverUnIgnoreAll); decHandler(setDrop); decHandler(error) __attribute__ ((noreturn)); @@ -87,8 +86,7 @@ namespace Commands enum { - COMMAND_SERVERIGNOREALL = 0, - COMMAND_SERVERUNIGNOREALL, + COMMAND_SERVERUNIGNOREALL = 0, COMMAND_SETDROP, COMMAND_ERROR, COMMAND_DUMPG, @@ -122,7 +120,6 @@ enum static const CommandInfo commands[] = { - {"serverignoreall", &Commands::serverIgnoreAll, -1, false}, {"serverunignoreall", &Commands::serverUnIgnoreAll, -1, false}, {"setdrop", &Commands::setDrop, -1, true}, {"error", &Commands::error, -1, false}, diff --git a/src/input/inputaction.h b/src/input/inputaction.h index 3d5353deb..572333a3d 100644 --- a/src/input/inputaction.h +++ b/src/input/inputaction.h @@ -394,6 +394,7 @@ namespace InputAction REMOVE_ATTACK, ADD_IGNORE_ATTACK, DUMP, + SERVER_IGNORE_ALL, TOTAL }; } // namespace InputAction diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h index ff79cafb3..82973a0cc 100644 --- a/src/input/inputactionmap.h +++ b/src/input/inputactionmap.h @@ -3315,6 +3315,15 @@ static const InputActionData inputActionData[InputAction::TOTAL] = { InputAction::NO_VALUE, 50, InputCondition::INGAME, "dump", + false}, + {"keyServerIgnoreAll", + InputType::UNKNOWN, InputAction::NO_VALUE, + InputType::UNKNOWN, InputAction::NO_VALUE, + Input::GRP_DEFAULT, + &Actions::serverIgnoreAll, + InputAction::NO_VALUE, 50, + InputCondition::INGAME, + "serverignoreall", false} }; diff --git a/src/input/pages/chat.cpp b/src/input/pages/chat.cpp index 234892c77..27e239cce 100644 --- a/src/input/pages/chat.cpp +++ b/src/input/pages/chat.cpp @@ -84,6 +84,12 @@ SetupActionData setupActionDataChat[] = InputAction::IGNORE_ALL_WHISPERS, "", }, + { + // TRANSLATORS: input action name + N_("Ignore all whispers on server side"), + InputAction::SERVER_IGNORE_ALL, + "", + }, { // TRANSLATORS: input action name N_("Previous chat line"), -- cgit v1.2.3-70-g09d2