From 35e14007fe44877b160c48db1d4106eba6306859 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 23 Aug 2014 15:27:04 +0300 Subject: Move chat command /ignoreallwhispers into actions. --- src/actions/chat.cpp | 11 +++++++++++ src/actions/chat.h | 1 + src/commands.cpp | 11 ----------- src/commands.h | 5 +---- src/input/inputaction.h | 1 + src/input/inputactionmap.h | 9 +++++++++ src/input/pages/chat.cpp | 6 ++++++ 7 files changed, 29 insertions(+), 15 deletions(-) diff --git a/src/actions/chat.cpp b/src/actions/chat.cpp index 9895d8388..d69895af3 100644 --- a/src/actions/chat.cpp +++ b/src/actions/chat.cpp @@ -123,6 +123,17 @@ impHandler0(closeAllChatTabs) return false; } +impHandler0(ignoreAllWhispers) +{ + if (chatWindow) + { + chatWindow->ignoreAllWhispers(); + chatWindow->saveState(); + return true; + } + return false; +} + impHandler0(scrollChatUp) { if (chatWindow && chatWindow->isWindowVisible()) diff --git a/src/actions/chat.h b/src/actions/chat.h index bdb62e209..8d0003e73 100644 --- a/src/actions/chat.h +++ b/src/actions/chat.h @@ -32,6 +32,7 @@ namespace Actions decHandler(nextChatTab); decHandler(closeChatTab); decHandler(closeAllChatTabs); + decHandler(ignoreAllWhispers); decHandler(scrollChatUp); decHandler(scrollChatDown); } // namespace Actions diff --git a/src/commands.cpp b/src/commands.cpp index 3c0734e43..abbfeb91e 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -754,17 +754,6 @@ impHandler0(attackHuman) return true; } -impHandler0(ignoreAll) -{ - if (chatWindow) - { - chatWindow->ignoreAllWhispers(); - chatWindow->saveState(); - return true; - } - return false; -} - impHandler(outfit) { if (outfitWindow) diff --git a/src/commands.h b/src/commands.h index 8a03a5f40..e694937c6 100644 --- a/src/commands.h +++ b/src/commands.h @@ -80,7 +80,6 @@ namespace Commands decHandler(move); decHandler(target); decHandler(attackHuman); - decHandler(ignoreAll); decHandler(outfit); decHandler(emote); decHandler(emotePet); @@ -143,8 +142,7 @@ namespace Commands enum { - COMMAND_IGNOREALL = 0, - COMMAND_HELP, + COMMAND_HELP = 0, COMMAND_ANNOUNCE, COMMAND_IPC_TOGGLE, COMMAND_WHERE, @@ -239,7 +237,6 @@ enum static const CommandInfo commands[] = { - {"ignoreall", &Commands::ignoreAll, -1, false}, {"help", &Commands::help, -1, false}, {"announce", &Commands::announce, -1, true}, {"ipctoggle", &Commands::ipcToggle, -1, false}, diff --git a/src/input/inputaction.h b/src/input/inputaction.h index 5cea51f31..c9a35a66f 100644 --- a/src/input/inputaction.h +++ b/src/input/inputaction.h @@ -342,6 +342,7 @@ namespace InputAction WINDOW_UPDATER, TARGET_CLOSEST_MONSTER, CLOSE_ALL_CHAT_TABS, + IGNORE_ALL_WHISPERS, TOTAL }; } // namespace InputAction diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h index 35fd37d57..19026df4d 100644 --- a/src/input/inputactionmap.h +++ b/src/input/inputactionmap.h @@ -2846,6 +2846,15 @@ static const InputActionData inputActionData[InputAction::TOTAL] = { InputAction::NO_VALUE, 50, InputCondition::INGAME, "closeall", + false}, + {"keyChatIgnoreAllWhispers", + InputType::UNKNOWN, InputAction::NO_VALUE, + InputType::UNKNOWN, InputAction::NO_VALUE, + Input::GRP_DEFAULT | Input::GRP_GUI, + &Actions::ignoreAllWhispers, + InputAction::NO_VALUE, 50, + InputCondition::INGAME, + "ignoreallwhispers", false} }; diff --git a/src/input/pages/chat.cpp b/src/input/pages/chat.cpp index 113efa3a5..d61f7855a 100644 --- a/src/input/pages/chat.cpp +++ b/src/input/pages/chat.cpp @@ -72,6 +72,12 @@ SetupActionData setupActionDataChat[] = InputAction::CLOSE_ALL_CHAT_TABS, "", }, + { + // TRANSLATORS: input action name + N_("Ignore all whispers"), + InputAction::IGNORE_ALL_WHISPERS, + "", + }, { // TRANSLATORS: input action name N_("Previous chat line"), -- cgit v1.2.3-60-g2f50