From fda230f1a8a6399c2507c7e39cd714d8aefc712d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 27 Aug 2014 15:50:50 +0300 Subject: Move chat command /testparticle into actions. --- src/actions/commands.cpp | 10 ++++++++++ src/actions/commands.h | 1 + src/commands.cpp | 10 ---------- src/commands.h | 5 +---- src/input/inputaction.h | 1 + src/input/inputactionmap.h | 11 ++++++++++- src/input/pages/other.cpp | 6 ++++++ 7 files changed, 29 insertions(+), 15 deletions(-) diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp index 905d7a2fb..63939c1da 100644 --- a/src/actions/commands.cpp +++ b/src/actions/commands.cpp @@ -646,4 +646,14 @@ impHandler(enableAway) return false; } +impHandler(testParticle) +{ + if (localPlayer) + { + localPlayer->setTestParticle(event.args); + return true; + } + return false; +} + } // namespace Actions diff --git a/src/actions/commands.h b/src/actions/commands.h index 02514ece0..d74e8fef8 100644 --- a/src/actions/commands.h +++ b/src/actions/commands.h @@ -65,6 +65,7 @@ namespace Actions decHandler(removeName); decHandler(disableAway); decHandler(enableAway); + decHandler(testParticle); } // namespace Actions #undef decHandler diff --git a/src/commands.cpp b/src/commands.cpp index 50219ebde..fcc5eff26 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -106,16 +106,6 @@ impHandler(hack) return true; } -impHandler(testParticle) -{ - if (localPlayer) - { - localPlayer->setTestParticle(event.args); - return true; - } - return false; -} - impHandler0(createItems) { BuyDialog *const dialog = new BuyDialog(); diff --git a/src/commands.h b/src/commands.h index 42a466b07..d3a32d1c1 100644 --- a/src/commands.h +++ b/src/commands.h @@ -52,7 +52,6 @@ struct CommandInfo final namespace Commands { decHandler(hack); - decHandler(testParticle); decHandler(createItems); decHandler(talkRaw); decHandler(talkPet); @@ -67,8 +66,7 @@ namespace Commands enum { - COMMAND_TEST_PARTICLE = 0, - COMMAND_CREATEITEMS, + COMMAND_CREATEITEMS = 0, COMMAND_TALKRAW, COMMAND_TALKPET, COMMAND_UPLOADCONFIG, @@ -82,7 +80,6 @@ enum static const CommandInfo commands[] = { - {"testparticle", &Commands::testParticle, -1, true}, {"createitems", &Commands::createItems, -1, false}, {"talkraw", &Commands::talkRaw, -1, true}, {"talkpet", &Commands::talkPet, -1, true}, diff --git a/src/input/inputaction.h b/src/input/inputaction.h index 2cd802ce0..dcd1e2552 100644 --- a/src/input/inputaction.h +++ b/src/input/inputaction.h @@ -414,6 +414,7 @@ namespace InputAction REMOVE_NAME, DISABLE_AWAY, ENABLE_AWAY, + TEST_PARTICLE, TOTAL }; } // namespace InputAction diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h index f3ce27a76..56853f0c8 100644 --- a/src/input/inputactionmap.h +++ b/src/input/inputactionmap.h @@ -3503,7 +3503,16 @@ static const InputActionData inputActionData[InputAction::TOTAL] = { InputAction::NO_VALUE, 50, InputCondition::INGAME, "enableaway", - false} + false}, + {"keyTestParticle", + InputType::UNKNOWN, InputAction::NO_VALUE, + InputType::UNKNOWN, InputAction::NO_VALUE, + Input::GRP_DEFAULT, + &Actions::testParticle, + InputAction::NO_VALUE, 50, + InputCondition::INGAME, + "testparticle", + true} }; #endif // INPUT_INPUTACTIONMAP_H diff --git a/src/input/pages/other.cpp b/src/input/pages/other.cpp index 61c6a5a9f..aaa0067e0 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_("Disable debug particle"), + InputAction::TEST_PARTICLE, + "", + }, { // TRANSLATORS: input action name N_("Print configured directories in chat"), -- cgit v1.2.3-70-g09d2