diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-08-25 12:46:16 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-08-25 12:46:16 +0300 |
commit | e5ac29f35d9a0ede9d1263ab1bb7c20568dbdd67 (patch) | |
tree | 56240086db88e4e72fb29dabffea23aaf3034eb6 /src | |
parent | d1a7fe4f55b967d7d844c0587f976d7d393b99e0 (diff) | |
download | plus-e5ac29f35d9a0ede9d1263ab1bb7c20568dbdd67.tar.gz plus-e5ac29f35d9a0ede9d1263ab1bb7c20568dbdd67.tar.bz2 plus-e5ac29f35d9a0ede9d1263ab1bb7c20568dbdd67.tar.xz plus-e5ac29f35d9a0ede9d1263ab1bb7c20568dbdd67.zip |
Move chat command /cleangraphics into actions.
Diffstat (limited to 'src')
-rw-r--r-- | src/actions/actions.cpp | 14 | ||||
-rw-r--r-- | src/actions/actions.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 | 11 | ||||
-rw-r--r-- | src/input/pages/other.cpp | 6 |
7 files changed, 33 insertions, 17 deletions
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp index 73c57985c..ae9a21b76 100644 --- a/src/actions/actions.cpp +++ b/src/actions/actions.cpp @@ -78,6 +78,8 @@ #include "listeners/updatestatuslistener.h" +#include "resources/resourcemanager.h" + #include "resources/map/map.h" #include "utils/gettext.h" @@ -542,4 +544,16 @@ impHandler0(who) return true; } +impHandler0(cleanGraphics) +{ + ResourceManager::getInstance()->clearCache(); + + if (debugChatTab) + { + // TRANSLATORS: clear graphics command message + debugChatTab->chatLog(_("Cache cleaned")); + } + return true; +} + } // namespace Actions diff --git a/src/actions/actions.h b/src/actions/actions.h index db895d644..39017c33a 100644 --- a/src/actions/actions.h +++ b/src/actions/actions.h @@ -57,6 +57,7 @@ namespace Actions decHandler(ipcToggle); decHandler(where); decHandler(who); + decHandler(cleanGraphics); } // namespace Actions #undef decHandler diff --git a/src/commands.cpp b/src/commands.cpp index 953f2679d..3d8f94b39 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -251,18 +251,6 @@ static void outStringNormal(ChatTab *const tab, } } -impHandler0(cleanGraphics) -{ - ResourceManager::getInstance()->clearCache(); - - if (debugChatTab) - { - // TRANSLATORS: clear graphics command message - debugChatTab->chatLog(_("Cache cleaned")); - } - return true; -} - impHandler0(cleanFonts) { if (gui) diff --git a/src/commands.h b/src/commands.h index 9fb8013d2..507eb2dec 100644 --- a/src/commands.h +++ b/src/commands.h @@ -51,7 +51,6 @@ struct CommandInfo final namespace Commands { - decHandler(cleanGraphics); decHandler(cleanFonts); decHandler(createParty); decHandler(createGuild); @@ -126,8 +125,7 @@ namespace Commands enum { - COMMAND_CLEANGRAPHICS = 0, - COMMAND_CLEANFONTS, + COMMAND_CLEANFONTS = 0, COMMAND_CREATEPARTY, COMMAND_CREATEGUILD, COMMAND_PARTY, @@ -201,7 +199,6 @@ enum static const CommandInfo commands[] = { - {"cleangraphics", &Commands::cleanGraphics, -1, false}, {"cleanfonts", &Commands::cleanFonts, -1, false}, {"createparty", &Commands::createParty, -1, true}, {"createguild", &Commands::createGuild, -1, true}, diff --git a/src/input/inputaction.h b/src/input/inputaction.h index 3fc39aaf3..73e3bb2c7 100644 --- a/src/input/inputaction.h +++ b/src/input/inputaction.h @@ -358,6 +358,7 @@ namespace InputAction BLACKLIST, ENEMY, ERASE, + CLEAN_GRAPHICS, TOTAL }; } // namespace InputAction diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h index ebadff15d..5b740c61f 100644 --- a/src/input/inputactionmap.h +++ b/src/input/inputactionmap.h @@ -2991,7 +2991,16 @@ static const InputActionData inputActionData[InputAction::TOTAL] = { InputAction::NO_VALUE, 50, InputCondition::INGAME, "erase", - true} + true}, + {"keyCleanGraphics", + InputType::UNKNOWN, InputAction::NO_VALUE, + InputType::UNKNOWN, InputAction::NO_VALUE, + Input::GRP_DEFAULT, + &Actions::cleanGraphics, + InputAction::NO_VALUE, 50, + InputCondition::INGAME, + "cleangraphics", + false} }; #endif // INPUT_INPUTACTIONMAP_H diff --git a/src/input/pages/other.cpp b/src/input/pages/other.cpp index e60b2addd..c12a24232 100644 --- a/src/input/pages/other.cpp +++ b/src/input/pages/other.cpp @@ -214,6 +214,12 @@ SetupActionData setupActionDataOther[] = "", }, { + // TRANSLATORS: input action name + N_("Clean cached graphics"), + InputAction::CLEAN_GRAPHICS, + "", + }, + { "", InputAction::NO_VALUE, "" |