summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-25 23:07:02 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-25 23:07:02 +0300
commitb0ab41f03839163549de4344c027a69312458e77 (patch)
tree2e7d8ec9a61dd23c667f7967b52971cd297624ec
parent53fce496581e70f0d99bf91152cc6d7e802e0974 (diff)
downloadplus-b0ab41f03839163549de4344c027a69312458e77.tar.gz
plus-b0ab41f03839163549de4344c027a69312458e77.tar.bz2
plus-b0ab41f03839163549de4344c027a69312458e77.tar.xz
plus-b0ab41f03839163549de4344c027a69312458e77.zip
Move chat command /atkhuman into actions.
-rw-r--r--src/actions/actions.cpp18
-rw-r--r--src/actions/actions.h1
-rw-r--r--src/commands.cpp18
-rw-r--r--src/commands.h4
-rw-r--r--src/input/inputaction.h1
-rw-r--r--src/input/inputactionmap.h11
-rw-r--r--src/input/pages/basic.cpp8
7 files changed, 38 insertions, 23 deletions
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp
index 188a46ea1..2eda2b6f3 100644
--- a/src/actions/actions.cpp
+++ b/src/actions/actions.cpp
@@ -431,6 +431,24 @@ impHandler0(targetAttack)
return false;
}
+impHandler0(attackHuman)
+{
+ if (!actorManager || !localPlayer)
+ return false;
+
+ Being *const target = actorManager->findNearestLivingBeing(
+ localPlayer, 10, ActorType::PLAYER, true);
+ if (target)
+ {
+ if (localPlayer->checAttackPermissions(target))
+ {
+ localPlayer->setTarget(target);
+ localPlayer->attack2(target, true);
+ }
+ }
+ return true;
+}
+
impHandler0(safeVideoMode)
{
if (mainGraphics)
diff --git a/src/actions/actions.h b/src/actions/actions.h
index 9b9c148b8..92d293df4 100644
--- a/src/actions/actions.h
+++ b/src/actions/actions.h
@@ -59,6 +59,7 @@ namespace Actions
decHandler(who);
decHandler(cleanGraphics);
decHandler(cleanFonts);
+ decHandler(attackHuman);
} // namespace Actions
#undef decHandler
diff --git a/src/commands.cpp b/src/commands.cpp
index e06017b28..599db94e4 100644
--- a/src/commands.cpp
+++ b/src/commands.cpp
@@ -166,24 +166,6 @@ impHandler(navigate)
return true;
}
-impHandler0(attackHuman)
-{
- if (!actorManager || !localPlayer)
- return false;
-
- Being *const target = actorManager->findNearestLivingBeing(
- localPlayer, 10, ActorType::PLAYER, true);
- if (target)
- {
- if (localPlayer->checAttackPermissions(target))
- {
- localPlayer->setTarget(target);
- localPlayer->attack2(target, true);
- }
- }
- return true;
-}
-
impHandler(outfit)
{
if (outfitWindow)
diff --git a/src/commands.h b/src/commands.h
index 9973f3b38..222e60467 100644
--- a/src/commands.h
+++ b/src/commands.h
@@ -114,8 +114,7 @@ namespace Commands
enum
{
- COMMAND_ATKHUMAN = 0,
- COMMAND_OUTFIT,
+ COMMAND_OUTFIT = 0,
COMMAND_EMOTE,
COMMAND_EMOTEPET,
COMMAND_AWAY,
@@ -177,7 +176,6 @@ enum
static const CommandInfo commands[] =
{
- {"atkhuman", &Commands::attackHuman, -1, true},
{"outfit", &Commands::outfit, -1, true},
{"emote", &Commands::emote, -1, true},
{"emotepet", &Commands::emotePet, -1, true},
diff --git a/src/input/inputaction.h b/src/input/inputaction.h
index 7c552b908..32e40227f 100644
--- a/src/input/inputaction.h
+++ b/src/input/inputaction.h
@@ -369,6 +369,7 @@ namespace InputAction
PRINT_ALL,
MOVE,
TARGET,
+ ATTACK_HUMAN,
TOTAL
};
} // namespace InputAction
diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h
index 6e0dbd668..a2bdf214c 100644
--- a/src/input/inputactionmap.h
+++ b/src/input/inputactionmap.h
@@ -3090,7 +3090,16 @@ static const InputActionData inputActionData[InputAction::TOTAL] = {
InputAction::NO_VALUE, 50,
InputCondition::INGAME,
"target",
- true}
+ true},
+ {"keyAttackHuman",
+ InputType::UNKNOWN, InputAction::NO_VALUE,
+ InputType::UNKNOWN, InputAction::NO_VALUE,
+ Input::GRP_DEFAULT,
+ &Actions::attackHuman,
+ InputAction::NO_VALUE, 50,
+ InputCondition::INGAME,
+ "atkhuman",
+ false}
};
#endif // INPUT_INPUTACTIONMAP_H
diff --git a/src/input/pages/basic.cpp b/src/input/pages/basic.cpp
index 302cd495d..f91b495de 100644
--- a/src/input/pages/basic.cpp
+++ b/src/input/pages/basic.cpp
@@ -47,12 +47,18 @@ SetupActionData setupActionDataBasic[] =
},
{
// TRANSLATORS: input action name
- N_("Target & Attack"),
+ N_("Target & attack closest monster"),
InputAction::TARGET_ATTACK,
"",
},
{
// TRANSLATORS: input action name
+ N_("Target & attack closest player"),
+ InputAction::ATTACK_HUMAN,
+ "",
+ },
+ {
+ // TRANSLATORS: input action name
N_("Move to Target"),
InputAction::MOVE_TO_TARGET,
"",