summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-04-10 23:14:47 +0300
committerAndrei Karas <akaras@inbox.ru>2012-04-10 23:14:47 +0300
commita3475e987b0e642b2b9aa9c6cbf74762c6c77d23 (patch)
treed4d1e3b4640b98ae59ffb982114e708825114234 /src/game.cpp
parent3973b3175a1efdb0d47e93b93af6ae5f50cb62f8 (diff)
downloadManaVerse-a3475e987b0e642b2b9aa9c6cbf74762c6c77d23.tar.gz
ManaVerse-a3475e987b0e642b2b9aa9c6cbf74762c6c77d23.tar.bz2
ManaVerse-a3475e987b0e642b2b9aa9c6cbf74762c6c77d23.tar.xz
ManaVerse-a3475e987b0e642b2b9aa9c6cbf74762c6c77d23.zip
Add two default keys to input layout.
Add action type to default keys. Remove hardcoded joystick actions.
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp19
1 files changed, 3 insertions, 16 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 7e514c3fd..b05cd6d28 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -805,7 +805,7 @@ void Game::handleMoveAndAttack()
Being *target = nullptr;
bool newTarget = !inputManager.isActionActive(
- Input::KEY_TARGET);
+ Input::KEY_STOP_ATTACK);
// A set target has highest priority
if (!player_node->getTarget())
{
@@ -829,7 +829,7 @@ void Game::handleMoveAndAttack()
inputManager.isActionActive(Input::KEY_TARGET_CLOSEST) ||
inputManager.isActionActive(Input::KEY_TARGET_NPC) ||
(joystick && joystick->buttonPressed(3))) &&
- !inputManager.isActionActive(Input::KEY_TARGET) &&
+ !inputManager.isActionActive(Input::KEY_STOP_ATTACK) &&
!inputManager.isActionActive(Input::KEY_UNTARGET))
{
ActorSprite::Type currentTarget = ActorSprite::UNKNOWN;
@@ -867,23 +867,10 @@ void Game::handleMoveAndAttack()
if (!inputManager.isActionActive(Input::KEY_ATTACK)
&& !inputManager.isActionActive(Input::KEY_EMOTE))
{
- if (inputManager.isActionActive(Input::KEY_TARGET)
- || (joystick && joystick->buttonPressed(4)))
- {
+ if (inputManager.isActionActive(Input::KEY_STOP_ATTACK))
player_node->stopAttack();
- }
else if (inputManager.isActionActive(Input::KEY_UNTARGET))
- {
player_node->untarget();
- }
- }
-
- if (joystick)
- {
- if (joystick->buttonPressed(1))
- player_node->pickUpItems();
- else if (joystick->buttonPressed(2))
- player_node->toggleSit();
}
}
}