summaryrefslogtreecommitdiff
path: root/src/gui/viewport.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-18 19:47:28 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-18 19:47:28 +0300
commit7da95c7f4da447876458a0b1a17736b9a2865844 (patch)
tree4b6ac0ab5bc32a11234a5363de95d0cfec8cb7d5 /src/gui/viewport.cpp
parent515ce6c1413b5e3da131f3e4997abdc39c003a2c (diff)
downloadManaVerse-7da95c7f4da447876458a0b1a17736b9a2865844.tar.gz
ManaVerse-7da95c7f4da447876458a0b1a17736b9a2865844.tar.bz2
ManaVerse-7da95c7f4da447876458a0b1a17736b9a2865844.tar.xz
ManaVerse-7da95c7f4da447876458a0b1a17736b9a2865844.zip
Move inputaction into separate file.
Diffstat (limited to 'src/gui/viewport.cpp')
-rw-r--r--src/gui/viewport.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index 89bf2fcd2..b6d805b11 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -441,19 +441,19 @@ bool Viewport::leftMouseAction()
{
if (player_node->withinAttackRange(mHoverBeing) ||
inputManager.isActionActive(static_cast<int>(
- Input::KEY_ATTACK)))
+ InputAction::ATTACK)))
{
validateSpeed();
if (!mStatsReUpdated && player_node != mHoverBeing)
{
player_node->attack(mHoverBeing,
!inputManager.isActionActive(
- static_cast<int>(Input::KEY_STOP_ATTACK)));
+ static_cast<int>(InputAction::STOP_ATTACK)));
return true;
}
}
else if (!inputManager.isActionActive(static_cast<int>(
- Input::KEY_ATTACK)))
+ InputAction::ATTACK)))
{
validateSpeed();
if (!mStatsReUpdated && player_node != mHoverBeing)
@@ -473,7 +473,7 @@ bool Viewport::leftMouseAction()
}
// Just walk around
else if (!inputManager.isActionActive(static_cast<int>(
- Input::KEY_ATTACK)))
+ InputAction::ATTACK)))
{
validateSpeed();
player_node->stopAttack();
@@ -552,8 +552,8 @@ void Viewport::walkByMouse(const MouseEvent &event)
if (!mMap || !player_node)
return;
if (mPlayerFollowMouse
- && !inputManager.isActionActive(Input::KEY_STOP_ATTACK)
- && !inputManager.isActionActive(Input::KEY_UNTARGET))
+ && !inputManager.isActionActive(InputAction::STOP_ATTACK)
+ && !inputManager.isActionActive(InputAction::UNTARGET))
{
if (!mMouseDirectionMove)
mPlayerFollowMouse = false;
@@ -1088,8 +1088,8 @@ void Viewport::returnCamera()
void Viewport::validateSpeed()
{
if (!inputManager.isActionActive(static_cast<int>(
- Input::KEY_TARGET_ATTACK)) && !inputManager.isActionActive(
- static_cast<int>(Input::KEY_ATTACK)))
+ InputAction::TARGET_ATTACK)) && !inputManager.isActionActive(
+ static_cast<int>(InputAction::ATTACK)))
{
if (Game::instance())
Game::instance()->setValidSpeed();