From 4c0d3dc62399e35c288cb82dfbf3f8811328f06c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 25 Aug 2014 12:54:39 +0300 Subject: Move chat command /cleanfonts into actions. --- src/actions/actions.cpp | 12 ++++++++++++ src/actions/actions.h | 1 + src/commands.cpp | 12 ------------ src/commands.h | 5 +---- src/input/inputaction.h | 1 + src/input/inputactionmap.h | 9 +++++++++ src/input/pages/other.cpp | 6 ++++++ 7 files changed, 30 insertions(+), 16 deletions(-) diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp index ae9a21b76..188a46ea1 100644 --- a/src/actions/actions.cpp +++ b/src/actions/actions.cpp @@ -556,4 +556,16 @@ impHandler0(cleanGraphics) return true; } +impHandler0(cleanFonts) +{ + if (gui) + gui->clearFonts(); + if (debugChatTab) + { + // TRANSLATORS: clear fonts cache message + debugChatTab->chatLog(_("Cache cleaned")); + } + return true; +} + } // namespace Actions diff --git a/src/actions/actions.h b/src/actions/actions.h index 39017c33a..9b9c148b8 100644 --- a/src/actions/actions.h +++ b/src/actions/actions.h @@ -58,6 +58,7 @@ namespace Actions decHandler(where); decHandler(who); decHandler(cleanGraphics); + decHandler(cleanFonts); } // namespace Actions #undef decHandler diff --git a/src/commands.cpp b/src/commands.cpp index 3d8f94b39..ed90a9d56 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -251,18 +251,6 @@ static void outStringNormal(ChatTab *const tab, } } -impHandler0(cleanFonts) -{ - if (gui) - gui->clearFonts(); - if (debugChatTab) - { - // TRANSLATORS: clear fonts cache message - debugChatTab->chatLog(_("Cache cleaned")); - } - return true; -} - impHandler(createParty) { if (!event.tab) diff --git a/src/commands.h b/src/commands.h index 507eb2dec..fceff7fe1 100644 --- a/src/commands.h +++ b/src/commands.h @@ -51,7 +51,6 @@ struct CommandInfo final namespace Commands { - decHandler(cleanFonts); decHandler(createParty); decHandler(createGuild); decHandler(party); @@ -125,8 +124,7 @@ namespace Commands enum { - COMMAND_CLEANFONTS = 0, - COMMAND_CREATEPARTY, + COMMAND_CREATEPARTY = 0, COMMAND_CREATEGUILD, COMMAND_PARTY, COMMAND_ME, @@ -199,7 +197,6 @@ enum static const CommandInfo commands[] = { - {"cleanfonts", &Commands::cleanFonts, -1, false}, {"createparty", &Commands::createParty, -1, true}, {"createguild", &Commands::createGuild, -1, true}, {"party", &Commands::party, -1, true}, diff --git a/src/input/inputaction.h b/src/input/inputaction.h index 73e3bb2c7..68c0483d1 100644 --- a/src/input/inputaction.h +++ b/src/input/inputaction.h @@ -359,6 +359,7 @@ namespace InputAction ENEMY, ERASE, CLEAN_GRAPHICS, + CLEAN_FONTS, TOTAL }; } // namespace InputAction diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h index 5b740c61f..f8d8c944f 100644 --- a/src/input/inputactionmap.h +++ b/src/input/inputactionmap.h @@ -3000,6 +3000,15 @@ static const InputActionData inputActionData[InputAction::TOTAL] = { InputAction::NO_VALUE, 50, InputCondition::INGAME, "cleangraphics", + false}, + {"keyCleanFonts", + InputType::UNKNOWN, InputAction::NO_VALUE, + InputType::UNKNOWN, InputAction::NO_VALUE, + Input::GRP_DEFAULT, + &Actions::cleanFonts, + InputAction::NO_VALUE, 50, + InputCondition::INGAME, + "cleanfonts", false} }; diff --git a/src/input/pages/other.cpp b/src/input/pages/other.cpp index c12a24232..b36badd8e 100644 --- a/src/input/pages/other.cpp +++ b/src/input/pages/other.cpp @@ -219,6 +219,12 @@ SetupActionData setupActionDataOther[] = InputAction::CLEAN_GRAPHICS, "", }, + { + // TRANSLATORS: input action name + N_("Clean cached fonts"), + InputAction::CLEAN_FONTS, + "", + }, { "", InputAction::NO_VALUE, -- cgit v1.2.3-70-g09d2