summaryrefslogtreecommitdiff
path: root/src/gui/viewport.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-04-08 19:41:19 +0300
committerAndrei Karas <akaras@inbox.ru>2012-04-08 19:41:19 +0300
commit30ef016b0a14f36dc480284e2d775295b5501dd4 (patch)
treea269c0983efb8dc9160bfe10b1dba26a302aff0c /src/gui/viewport.cpp
parent25a6eae7f4fb561bbf930be28ee09510b40ebc80 (diff)
downloadmv-30ef016b0a14f36dc480284e2d775295b5501dd4.tar.gz
mv-30ef016b0a14f36dc480284e2d775295b5501dd4.tar.bz2
mv-30ef016b0a14f36dc480284e2d775295b5501dd4.tar.xz
mv-30ef016b0a14f36dc480284e2d775295b5501dd4.zip
Move most input code from keyboardconfig to inputmanager.
Diffstat (limited to 'src/gui/viewport.cpp')
-rw-r--r--src/gui/viewport.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index 6c6580f21..59b7377f4 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -28,6 +28,7 @@
#include "configuration.h"
#include "graphics.h"
#include "itemshortcut.h"
+#include "inputmanager.h"
#include "keyboardconfig.h"
#include "localplayer.h"
#include "map.h"
@@ -504,17 +505,17 @@ void Viewport::mousePressed(gcn::MouseEvent &event)
}
}
else if (player_node->withinAttackRange(mHoverBeing) ||
- keyboard.isActionActive(Input::KEY_ATTACK))
+ inputManager.isActionActive(Input::KEY_ATTACK))
{
validateSpeed();
if (player_node != mHoverBeing)
{
player_node->attack(mHoverBeing,
- !keyboard.isActionActive(Input::KEY_TARGET));
+ !inputManager.isActionActive(Input::KEY_TARGET));
return;
}
}
- else if (!keyboard.isActionActive(Input::KEY_ATTACK))
+ else if (!inputManager.isActionActive(Input::KEY_ATTACK))
{
validateSpeed();
if (player_node != mHoverBeing)
@@ -532,7 +533,7 @@ void Viewport::mousePressed(gcn::MouseEvent &event)
player_node->pickUp(mHoverItem);
}
// Just walk around
- else if (!keyboard.isActionActive(Input::KEY_ATTACK))
+ else if (!inputManager.isActionActive(Input::KEY_ATTACK))
{
validateSpeed();
player_node->stopAttack();
@@ -933,8 +934,8 @@ void Viewport::returnCamera()
void Viewport::validateSpeed()
{
- if (!keyboard.isActionActive(Input::KEY_TARGET_ATTACK)
- && !keyboard.isActionActive(Input::KEY_ATTACK))
+ if (!inputManager.isActionActive(Input::KEY_TARGET_ATTACK)
+ && !inputManager.isActionActive(Input::KEY_ATTACK))
{
if (Game::instance())
Game::instance()->setValidSpeed();