summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-25 23:21:41 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-25 23:22:35 +0300
commit81b70110b56fb44b913ad58e1640909c9a7a6d3c (patch)
treef9d7012a01b9c5e7c5e1634fa16f74a1daaf1eca
parentb0ab41f03839163549de4344c027a69312458e77 (diff)
downloadmv-81b70110b56fb44b913ad58e1640909c9a7a6d3c.tar.gz
mv-81b70110b56fb44b913ad58e1640909c9a7a6d3c.tar.bz2
mv-81b70110b56fb44b913ad58e1640909c9a7a6d3c.tar.xz
mv-81b70110b56fb44b913ad58e1640909c9a7a6d3c.zip
Move chat command /outfit into actions.
-rw-r--r--src/actions/commands.cpp31
-rw-r--r--src/actions/commands.h1
-rw-r--r--src/commands.cpp23
-rw-r--r--src/commands.h6
-rw-r--r--src/input/inputaction.h1
-rw-r--r--src/input/inputactionmap.h11
6 files changed, 44 insertions, 29 deletions
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp
index 4ae5d0f49..a6d9d56a2 100644
--- a/src/actions/commands.cpp
+++ b/src/actions/commands.cpp
@@ -297,4 +297,35 @@ impHandler(setTarget)
return true;
}
+impHandler(commandOutfit)
+{
+ if (outfitWindow)
+ {
+ if (!event.args.empty())
+ {
+ const std::string op = event.args.substr(0, 1);
+ if (op == "n")
+ {
+ outfitWindow->wearNextOutfit(true);
+ }
+ else if (op == "p")
+ {
+ outfitWindow->wearPreviousOutfit(true);
+ }
+ else
+ {
+ outfitWindow->wearOutfit(atoi(event.args.c_str()) - 1,
+ false, true);
+ }
+ }
+ else
+ {
+ outfitWindow->wearOutfit(atoi(event.args.c_str()) - 1,
+ false, true);
+ }
+ return true;
+ }
+ return false;
+}
+
} // namespace Actions
diff --git a/src/actions/commands.h b/src/actions/commands.h
index 8ff28cd00..3face961f 100644
--- a/src/actions/commands.h
+++ b/src/actions/commands.h
@@ -40,6 +40,7 @@ namespace Actions
decHandler(printAll);
decHandler(move);
decHandler(setTarget);
+ decHandler(commandOutfit);
} // namespace Actions
#undef decHandler
diff --git a/src/commands.cpp b/src/commands.cpp
index 599db94e4..c5bc1e75e 100644
--- a/src/commands.cpp
+++ b/src/commands.cpp
@@ -166,29 +166,6 @@ impHandler(navigate)
return true;
}
-impHandler(outfit)
-{
- if (outfitWindow)
- {
- if (!event.args.empty())
- {
- const std::string op = event.args.substr(0, 1);
- if (op == "n")
- outfitWindow->wearNextOutfit(true);
- else if (op == "p")
- outfitWindow->wearPreviousOutfit(true);
- else
- outfitWindow->wearOutfit(atoi(event.args.c_str()) - 1, false, true);
- }
- else
- {
- outfitWindow->wearOutfit(atoi(event.args.c_str()) - 1, false, true);
- }
- return true;
- }
- return false;
-}
-
impHandler(emote)
{
if (localPlayer)
diff --git a/src/commands.h b/src/commands.h
index 222e60467..60d759050 100644
--- a/src/commands.h
+++ b/src/commands.h
@@ -51,8 +51,6 @@ struct CommandInfo final
namespace Commands
{
- decHandler(attackHuman);
- decHandler(outfit);
decHandler(emote);
decHandler(emotePet);
decHandler(away);
@@ -114,8 +112,7 @@ namespace Commands
enum
{
- COMMAND_OUTFIT = 0,
- COMMAND_EMOTE,
+ COMMAND_EMOTE = 0,
COMMAND_EMOTEPET,
COMMAND_AWAY,
COMMAND_PSEUDOAWAY,
@@ -176,7 +173,6 @@ enum
static const CommandInfo commands[] =
{
- {"outfit", &Commands::outfit, -1, true},
{"emote", &Commands::emote, -1, true},
{"emotepet", &Commands::emotePet, -1, true},
{"away", &Commands::away, -1, true},
diff --git a/src/input/inputaction.h b/src/input/inputaction.h
index 32e40227f..bb150b867 100644
--- a/src/input/inputaction.h
+++ b/src/input/inputaction.h
@@ -370,6 +370,7 @@ namespace InputAction
MOVE,
TARGET,
ATTACK_HUMAN,
+ COMMAMD_OUTFIT,
TOTAL
};
} // namespace InputAction
diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h
index a2bdf214c..8c76e65d8 100644
--- a/src/input/inputactionmap.h
+++ b/src/input/inputactionmap.h
@@ -3099,7 +3099,16 @@ static const InputActionData inputActionData[InputAction::TOTAL] = {
InputAction::NO_VALUE, 50,
InputCondition::INGAME,
"atkhuman",
- false}
+ false},
+ {"keyOutfit",
+ InputType::UNKNOWN, InputAction::NO_VALUE,
+ InputType::UNKNOWN, InputAction::NO_VALUE,
+ Input::GRP_DEFAULT,
+ &Actions::commandOutfit,
+ InputAction::NO_VALUE, 50,
+ InputCondition::INGAME,
+ "outfit",
+ true}
};
#endif // INPUT_INPUTACTIONMAP_H