summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-27 15:50:50 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-27 15:50:50 +0300
commitfda230f1a8a6399c2507c7e39cd714d8aefc712d (patch)
tree9d974937357862a1d5d9b4ec83fc97a90719f7b4
parentabdc57a4acfa490ee34985b56b2d985266ccc7e4 (diff)
downloadmanaplus-fda230f1a8a6399c2507c7e39cd714d8aefc712d.tar.gz
manaplus-fda230f1a8a6399c2507c7e39cd714d8aefc712d.tar.bz2
manaplus-fda230f1a8a6399c2507c7e39cd714d8aefc712d.tar.xz
manaplus-fda230f1a8a6399c2507c7e39cd714d8aefc712d.zip
Move chat command /testparticle into actions.
-rw-r--r--src/actions/commands.cpp10
-rw-r--r--src/actions/commands.h1
-rw-r--r--src/commands.cpp10
-rw-r--r--src/commands.h5
-rw-r--r--src/input/inputaction.h1
-rw-r--r--src/input/inputactionmap.h11
-rw-r--r--src/input/pages/other.cpp6
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
@@ -269,6 +269,12 @@ SetupActionData setupActionDataOther[] =
},
{
// TRANSLATORS: input action name
+ N_("Disable debug particle"),
+ InputAction::TEST_PARTICLE,
+ "",
+ },
+ {
+ // TRANSLATORS: input action name
N_("Print configured directories in chat"),
InputAction::DIRS,
"",