summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-12-25 16:44:35 +0300
committerAndrei Karas <akaras@inbox.ru>2012-12-25 16:48:32 +0300
commitfd6f7a8fec07920c5941c5010e086f4bb449404e (patch)
tree81c28be92e47f254347943b0b54395cd7f315faf /src
parent64dee3d773e380079f3abfd1dfaae04976de84e3 (diff)
downloadmanaverse-fd6f7a8fec07920c5941c5010e086f4bb449404e.tar.gz
manaverse-fd6f7a8fec07920c5941c5010e086f4bb449404e.tar.bz2
manaverse-fd6f7a8fec07920c5941c5010e086f4bb449404e.tar.xz
manaverse-fd6f7a8fec07920c5941c5010e086f4bb449404e.zip
Add new action "stop or sit"
Diffstat (limited to 'src')
-rw-r--r--src/actionmanager.cpp20
-rw-r--r--src/actionmanager.h1
-rw-r--r--src/gui/setupactiondata.h5
-rw-r--r--src/keyboarddata.h7
-rw-r--r--src/keydata.h1
-rw-r--r--src/touchactions.cpp10
6 files changed, 35 insertions, 9 deletions
diff --git a/src/actionmanager.cpp b/src/actionmanager.cpp
index f41a9269c..92087b6db 100644
--- a/src/actionmanager.cpp
+++ b/src/actionmanager.cpp
@@ -1045,4 +1045,24 @@ impHandler0(safeVideoMode)
return true;
}
+impHandler0(stopSit)
+{
+ if (player_node)
+ {
+ player_node->stopAttack();
+ // not consume if target attack key pressed
+ if (inputManager.isActionActive(Input::KEY_TARGET_ATTACK))
+ return false;
+ if (!player_node->getTarget())
+ {
+ if (inputManager.isActionActive(Input::KEY_EMOTE))
+ player_node->updateSit();
+ else
+ player_node->toggleSit();
+ }
+ return true;
+ }
+ return false;
+}
+
}
diff --git a/src/actionmanager.h b/src/actionmanager.h
index c04dceff5..380a156c7 100644
--- a/src/actionmanager.h
+++ b/src/actionmanager.h
@@ -94,6 +94,7 @@ namespace ActionManager
decHandler(targetMonster);
decHandler(targetNPC);
decHandler(safeVideoMode);
+ decHandler(stopSit);
decHandler(hideWindows);
decHandler(helpWindowShow);
diff --git a/src/gui/setupactiondata.h b/src/gui/setupactiondata.h
index 3fab79b61..2ca6aaa3c 100644
--- a/src/gui/setupactiondata.h
+++ b/src/gui/setupactiondata.h
@@ -160,6 +160,11 @@ static SetupActionData setupActionData0[] =
"",
},
{
+ N_("Stop or sit"),
+ Input::KEY_STOP_SIT,
+ "",
+ },
+ {
N_("Return to safe video mode"),
Input::KEY_SAFE_VIDEO,
"",
diff --git a/src/keyboarddata.h b/src/keyboarddata.h
index 155743aab..506594d7a 100644
--- a/src/keyboarddata.h
+++ b/src/keyboarddata.h
@@ -1922,6 +1922,13 @@ static const KeyData keyData[Input::KEY_TOTAL] = {
Input::GRP_DEFAULT,
&ActionManager::safeVideoMode,
Input::KEY_NO_VALUE, 50,
+ COND_DEFAULT},
+ {"keyStopSit",
+ INPUT_UNKNOWN, Input::KEY_NO_VALUE,
+ INPUT_UNKNOWN, Input::KEY_NO_VALUE,
+ Input::GRP_DEFAULT,
+ &ActionManager::stopSit,
+ Input::KEY_NO_VALUE, 50,
COND_DEFAULT}
};
diff --git a/src/keydata.h b/src/keydata.h
index b5107113e..5d3606d69 100644
--- a/src/keydata.h
+++ b/src/keydata.h
@@ -337,6 +337,7 @@ namespace Input
KEY_GUI_INSERT,
KEY_GUI_MOD,
KEY_SAFE_VIDEO,
+ KEY_STOP_SIT,
KEY_TOTAL
};
}
diff --git a/src/touchactions.cpp b/src/touchactions.cpp
index a12f54e99..2a6fbacaa 100644
--- a/src/touchactions.cpp
+++ b/src/touchactions.cpp
@@ -21,10 +21,7 @@
#include "touchactions.h"
#include "actionmanager.h"
-#include "being.h"
#include "game.h"
-#include "keydata.h"
-#include "localplayer.h"
#include "logger.h"
#include "mouseinput.h"
#include "touchmanager.h"
@@ -154,10 +151,5 @@ impHandler0(attackClick)
impHandler0(cancelClick)
{
- if (player_node)
- {
- ActionManager::stopAttack(tempEvent);
- if (!player_node->getTarget())
- ActionManager::sit(tempEvent);
- }
+ ActionManager::stopSit(tempEvent);
}