From 67ecfd5dc5ac6b45e42f6a47263f494fa17bc46d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 26 Aug 2014 20:53:04 +0300 Subject: Move chat command /dirs into actions. --- src/actions/actions.cpp | 16 ++++++++++++++++ src/actions/actions.h | 1 + src/commands.cpp | 16 ---------------- src/commands.h | 5 +---- src/input/inputaction.h | 1 + src/input/inputactionmap.h | 9 +++++++++ src/input/pages/other.cpp | 6 ++++++ 7 files changed, 34 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp index a46e37347..65f6e366c 100644 --- a/src/actions/actions.cpp +++ b/src/actions/actions.cpp @@ -702,4 +702,20 @@ impHandler(undress) return true; } +impHandler0(dirs) +{ + if (!debugChatTab) + return false; + + debugChatTab->chatLog("config directory: " + + settings.configDir); + debugChatTab->chatLog("logs directory: " + + settings.localDataDir); + debugChatTab->chatLog("screenshots directory: " + + settings.screenshotDir); + debugChatTab->chatLog("temp directory: " + + settings.tempDir); + return true; +} + } // namespace Actions diff --git a/src/actions/actions.h b/src/actions/actions.h index 4b586b169..f80c4f8e6 100644 --- a/src/actions/actions.h +++ b/src/actions/actions.h @@ -66,6 +66,7 @@ namespace Actions decHandler(cacheInfo); decHandler(disconnect); decHandler(undress); + decHandler(dirs); } // namespace Actions #undef decHandler diff --git a/src/commands.cpp b/src/commands.cpp index 3c3b1dbe4..acb240b28 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -157,22 +157,6 @@ impHandler(hack) return true; } -impHandler0(dirs) -{ - if (!localPlayer || !debugChatTab) - return false; - - debugChatTab->chatLog("config directory: " - + settings.configDir); - debugChatTab->chatLog("logs directory: " - + settings.localDataDir); - debugChatTab->chatLog("screenshots directory: " - + settings.screenshotDir); - debugChatTab->chatLog("temp directory: " - + settings.tempDir); - return true; -} - impHandler(info) { if (!event.tab || !localPlayer || tmwServerVersion > 0) diff --git a/src/commands.h b/src/commands.h index 5dde98d8f..d5c7b2e35 100644 --- a/src/commands.h +++ b/src/commands.h @@ -52,7 +52,6 @@ struct CommandInfo final namespace Commands { decHandler(hack); - decHandler(dirs); decHandler(info); decHandler(wait); decHandler(uptime); @@ -96,8 +95,7 @@ namespace Commands enum { - COMMAND_DIRS = 0, - COMMAND_INFO, + COMMAND_INFO = 0, COMMAND_WAIT, COMMAND_UPTIME, COMMAND_ADDPRIORITYATTACK, @@ -141,7 +139,6 @@ enum static const CommandInfo commands[] = { - {"dirs", &Commands::dirs, -1, false}, {"info", &Commands::info, -1, false}, {"wait", &Commands::wait, -1, true}, {"uptime", &Commands::uptime, -1, false}, diff --git a/src/input/inputaction.h b/src/input/inputaction.h index 67ed7a8a0..e57deb0bc 100644 --- a/src/input/inputaction.h +++ b/src/input/inputaction.h @@ -385,6 +385,7 @@ namespace InputAction CACHE_INFO, DISCONNECT, UNDRESS, + DIRS, TOTAL }; } // namespace InputAction diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h index 7fdda0480..10dbcf90f 100644 --- a/src/input/inputactionmap.h +++ b/src/input/inputactionmap.h @@ -3234,6 +3234,15 @@ static const InputActionData inputActionData[InputAction::TOTAL] = { InputAction::NO_VALUE, 50, InputCondition::INGAME, "undress", + true}, + {"keyDirs", + InputType::UNKNOWN, InputAction::NO_VALUE, + InputType::UNKNOWN, InputAction::NO_VALUE, + Input::GRP_DEFAULT, + &Actions::dirs, + InputAction::NO_VALUE, 50, + InputCondition::INGAME, + "dirs", false} }; diff --git a/src/input/pages/other.cpp b/src/input/pages/other.cpp index 5d9aca31e..f730db629 100644 --- a/src/input/pages/other.cpp +++ b/src/input/pages/other.cpp @@ -267,6 +267,12 @@ SetupActionData setupActionDataOther[] = InputAction::DISCONNECT, "", }, + { + // TRANSLATORS: input action name + N_("Print configured directories in chat"), + InputAction::DIRS, + "", + }, { "", InputAction::NO_VALUE, -- cgit v1.2.3-70-g09d2