From a3475e987b0e642b2b9aa9c6cbf74762c6c77d23 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 10 Apr 2012 23:14:47 +0300 Subject: Add two default keys to input layout. Add action type to default keys. Remove hardcoded joystick actions. --- src/game.cpp | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'src/game.cpp') 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(); } } } -- cgit v1.2.3-60-g2f50