diff options
-rw-r--r-- | src/actionmanager.cpp | 7 | ||||
-rw-r--r-- | src/actionmanager.h | 1 | ||||
-rw-r--r-- | src/game.cpp | 6 | ||||
-rw-r--r-- | src/gui/setupactiondata.h | 6 | ||||
-rw-r--r-- | src/input/keyboarddata.h | 7 | ||||
-rw-r--r-- | src/input/keydata.h | 1 |
6 files changed, 28 insertions, 0 deletions
diff --git a/src/actionmanager.cpp b/src/actionmanager.cpp index e34482c13..7d3b653a8 100644 --- a/src/actionmanager.cpp +++ b/src/actionmanager.cpp @@ -139,6 +139,13 @@ impHandler(moveRight) return false; } +impHandler(moveForward) +{ + if (inputManager.isActionActive(Input::KEY_EMOTE)) + return directRight(event); + return false; +} + impHandler(emote) { const int emotion = 1 + event.action - Input::KEY_EMOTE_1; diff --git a/src/actionmanager.h b/src/actionmanager.h index 8f15e4442..2088eddf7 100644 --- a/src/actionmanager.h +++ b/src/actionmanager.h @@ -31,6 +31,7 @@ namespace ActionManager decHandler(moveDown); decHandler(moveLeft); decHandler(moveRight); + decHandler(moveForward); decHandler(emote); decHandler(outfit); decHandler(moveToPoint); diff --git a/src/game.cpp b/src/game.cpp index 73cafad69..80d27a4a1 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -851,6 +851,12 @@ void Game::handleMove() setValidSpeed(); player_node->cancelFollow(); } + else if (inputManager.isActionActive(Input::KEY_MOVE_FORWARD)) + { + direction = player_node->getDirection(); + setValidSpeed(); + player_node->cancelFollow(); + } if (!inputManager.isActionActive(Input::KEY_EMOTE) || direction == 0) moveInDirection(direction); diff --git a/src/gui/setupactiondata.h b/src/gui/setupactiondata.h index 6fa33f673..45ff55e83 100644 --- a/src/gui/setupactiondata.h +++ b/src/gui/setupactiondata.h @@ -1419,6 +1419,12 @@ static SetupActionData setupActionData7[] = }, { // TRANSLATORS: input action name + N_("Move Forward"), + Input::KEY_MOVE_FORWARD, + "", + }, + { + // TRANSLATORS: input action name N_("Move to navigation point shortcuts"), Input::KEY_NO_VALUE, "" diff --git a/src/input/keyboarddata.h b/src/input/keyboarddata.h index e9703eac7..ed8aefe17 100644 --- a/src/input/keyboarddata.h +++ b/src/input/keyboarddata.h @@ -62,6 +62,13 @@ static const KeyData keyData[Input::KEY_TOTAL] = { &ActionManager::moveRight, Input::KEY_NO_VALUE, 50, COND_GAME}, + {"keyMoveForward", + INPUT_UNKNOWN, Input::KEY_NO_VALUE, + INPUT_UNKNOWN, Input::KEY_NO_VALUE, + Input::GRP_DEFAULT, + &ActionManager::moveForward, + Input::KEY_NO_VALUE, 50, + COND_GAME}, {"keyAttack", INPUT_KEYBOARD, SDLK_LCTRL, INPUT_UNKNOWN, Input::KEY_NO_VALUE, diff --git a/src/input/keydata.h b/src/input/keydata.h index bb5d27fd1..562c15208 100644 --- a/src/input/keydata.h +++ b/src/input/keydata.h @@ -71,6 +71,7 @@ namespace Input KEY_MOVE_DOWN, KEY_MOVE_LEFT, KEY_MOVE_RIGHT, + KEY_MOVE_FORWARD, KEY_ATTACK, KEY_TARGET_ATTACK, KEY_MOVE_TO_TARGET, |