diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-08-23 14:50:14 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-08-23 14:50:14 +0300 |
commit | dded1355609c8f23281f78ec719b09b1693ea717 (patch) | |
tree | 00238316177f9099d2e58cd639269a269a2dd0d0 /src | |
parent | 44df89ce3e77f4f5e93555260f3eabab7621f77d (diff) | |
download | plus-dded1355609c8f23281f78ec719b09b1693ea717.tar.gz plus-dded1355609c8f23281f78ec719b09b1693ea717.tar.bz2 plus-dded1355609c8f23281f78ec719b09b1693ea717.tar.xz plus-dded1355609c8f23281f78ec719b09b1693ea717.zip |
Move chat command /closeall into actions.
Diffstat (limited to 'src')
-rw-r--r-- | src/actions/chat.cpp | 11 | ||||
-rw-r--r-- | src/actions/chat.h | 1 | ||||
-rw-r--r-- | src/commands.cpp | 12 | ||||
-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/chat.cpp | 6 |
7 files changed, 29 insertions, 16 deletions
diff --git a/src/actions/chat.cpp b/src/actions/chat.cpp index 5b70c2085..9895d8388 100644 --- a/src/actions/chat.cpp +++ b/src/actions/chat.cpp @@ -112,6 +112,17 @@ impHandler0(closeChatTab) return false; } +impHandler0(closeAllChatTabs) +{ + if (chatWindow) + { + chatWindow->removeAllWhispers(); + 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 ed7ef97ed..bdb62e209 100644 --- a/src/actions/chat.h +++ b/src/actions/chat.h @@ -31,6 +31,7 @@ namespace Actions decHandler(prevChatTab); decHandler(nextChatTab); decHandler(closeChatTab); + decHandler(closeAllChatTabs); decHandler(scrollChatUp); decHandler(scrollChatDown); } // namespace Actions diff --git a/src/commands.cpp b/src/commands.cpp index 2f68efda4..3c0734e43 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -754,18 +754,6 @@ impHandler0(attackHuman) return true; } - -impHandler0(closeAll) -{ - if (chatWindow) - { - chatWindow->removeAllWhispers(); - chatWindow->saveState(); - return true; - } - return false; -} - impHandler0(ignoreAll) { if (chatWindow) diff --git a/src/commands.h b/src/commands.h index ba3bb28df..8a03a5f40 100644 --- a/src/commands.h +++ b/src/commands.h @@ -80,7 +80,6 @@ namespace Commands decHandler(move); decHandler(target); decHandler(attackHuman); - decHandler(closeAll); decHandler(ignoreAll); decHandler(outfit); decHandler(emote); @@ -144,8 +143,7 @@ namespace Commands enum { - COMMAND_CLOSEALL = 0, - COMMAND_IGNOREALL, + COMMAND_IGNOREALL = 0, COMMAND_HELP, COMMAND_ANNOUNCE, COMMAND_IPC_TOGGLE, @@ -241,7 +239,6 @@ enum static const CommandInfo commands[] = { - {"closeall", &Commands::closeAll, -1, false}, {"ignoreall", &Commands::ignoreAll, -1, false}, {"help", &Commands::help, -1, false}, {"announce", &Commands::announce, -1, true}, diff --git a/src/input/inputaction.h b/src/input/inputaction.h index 2231a89dd..5cea51f31 100644 --- a/src/input/inputaction.h +++ b/src/input/inputaction.h @@ -341,6 +341,7 @@ namespace InputAction WINDOW_ABOUT, WINDOW_UPDATER, TARGET_CLOSEST_MONSTER, + CLOSE_ALL_CHAT_TABS, TOTAL }; } // namespace InputAction diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h index 65c145dbd..35fd37d57 100644 --- a/src/input/inputactionmap.h +++ b/src/input/inputactionmap.h @@ -2837,6 +2837,15 @@ static const InputActionData inputActionData[InputAction::TOTAL] = { InputCondition::GAME | InputCondition::NOTARGET | InputCondition::VALIDSPEED, "", + false}, + {"keyChatCloseAllTabs", + InputType::UNKNOWN, InputAction::NO_VALUE, + InputType::UNKNOWN, InputAction::NO_VALUE, + Input::GRP_DEFAULT | Input::GRP_GUI, + &Actions::closeAllChatTabs, + InputAction::NO_VALUE, 50, + InputCondition::INGAME, + "closeall", false} }; diff --git a/src/input/pages/chat.cpp b/src/input/pages/chat.cpp index 71922103a..113efa3a5 100644 --- a/src/input/pages/chat.cpp +++ b/src/input/pages/chat.cpp @@ -68,6 +68,12 @@ SetupActionData setupActionDataChat[] = }, { // TRANSLATORS: input action name + N_("Close all chat tabs"), + InputAction::CLOSE_ALL_CHAT_TABS, + "", + }, + { + // TRANSLATORS: input action name N_("Previous chat line"), InputAction::CHAT_PREV_HISTORY, "", |