summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2019-10-28 19:34:40 +0200
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2020-06-23 14:50:03 +0300
commit57bf6eafc1d0dc612971ca0ef523cc41c21bec95 (patch)
treeed3bc24f65661dbb0c3a56b1560ddffbd00dbae7 /indra
parent62214b53f09c453dc410465ba6e64a772562e6db (diff)
SL-6109 Better running
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llviewerinput.cpp68
1 files changed, 48 insertions, 20 deletions
diff --git a/indra/newview/llviewerinput.cpp b/indra/newview/llviewerinput.cpp
index b847923c9c..3ff4e4eb9d 100644
--- a/indra/newview/llviewerinput.cpp
+++ b/indra/newview/llviewerinput.cpp
@@ -652,15 +652,22 @@ bool start_gesture( EKeystate s )
bool run_forward(EKeystate s)
{
- if (KEYSTATE_DOWN == s)
+ if (KEYSTATE_UP != s)
{
- gAgent.setAlwaysRun();
- gAgent.setRunning();
- gAgent.sendWalkRun(true);
+ if (gAgent.mDoubleTapRunMode != LLAgent::DOUBLETAP_FORWARD)
+ {
+ gAgent.mDoubleTapRunMode = LLAgent::DOUBLETAP_FORWARD;
+ }
+ if (!gAgent.getRunning())
+ {
+ gAgent.setRunning();
+ gAgent.sendWalkRun(true);
+ }
}
else if(KEYSTATE_UP == s)
{
- gAgent.clearAlwaysRun();
+ if (gAgent.mDoubleTapRunMode == LLAgent::DOUBLETAP_FORWARD)
+ gAgent.mDoubleTapRunMode = LLAgent::DOUBLETAP_NONE;
gAgent.clearRunning();
gAgent.sendWalkRun(false);
}
@@ -670,15 +677,22 @@ bool run_forward(EKeystate s)
bool run_backward(EKeystate s)
{
- if (KEYSTATE_DOWN == s)
+ if (KEYSTATE_UP != s)
{
- gAgent.setAlwaysRun();
- gAgent.setRunning();
- gAgent.sendWalkRun(true);
+ if (gAgent.mDoubleTapRunMode != LLAgent::DOUBLETAP_BACKWARD)
+ {
+ gAgent.mDoubleTapRunMode = LLAgent::DOUBLETAP_BACKWARD;
+ }
+ if (!gAgent.getRunning())
+ {
+ gAgent.setRunning();
+ gAgent.sendWalkRun(true);
+ }
}
else if (KEYSTATE_UP == s)
{
- gAgent.clearAlwaysRun();
+ if (gAgent.mDoubleTapRunMode == LLAgent::DOUBLETAP_BACKWARD)
+ gAgent.mDoubleTapRunMode = LLAgent::DOUBLETAP_NONE;
gAgent.clearRunning();
gAgent.sendWalkRun(false);
}
@@ -688,15 +702,22 @@ bool run_backward(EKeystate s)
bool run_left(EKeystate s)
{
- if (KEYSTATE_DOWN == s)
+ if (KEYSTATE_UP != s)
{
- gAgent.setAlwaysRun();
- gAgent.setRunning();
- gAgent.sendWalkRun(true);
+ if (gAgent.mDoubleTapRunMode != LLAgent::DOUBLETAP_SLIDELEFT)
+ {
+ gAgent.mDoubleTapRunMode = LLAgent::DOUBLETAP_SLIDELEFT;
+ }
+ if (!gAgent.getRunning())
+ {
+ gAgent.setRunning();
+ gAgent.sendWalkRun(true);
+ }
}
else if (KEYSTATE_UP == s)
{
- gAgent.clearAlwaysRun();
+ if (gAgent.mDoubleTapRunMode == LLAgent::DOUBLETAP_SLIDELEFT)
+ gAgent.mDoubleTapRunMode = LLAgent::DOUBLETAP_NONE;
gAgent.clearRunning();
gAgent.sendWalkRun(false);
}
@@ -706,15 +727,22 @@ bool run_left(EKeystate s)
bool run_right(EKeystate s)
{
- if (KEYSTATE_DOWN == s)
+ if (KEYSTATE_UP != s)
{
- gAgent.setAlwaysRun();
- gAgent.setRunning();
- gAgent.sendWalkRun(true);
+ if (gAgent.mDoubleTapRunMode != LLAgent::DOUBLETAP_SLIDERIGHT)
+ {
+ gAgent.mDoubleTapRunMode = LLAgent::DOUBLETAP_SLIDERIGHT;
+ if (!gAgent.getRunning())
+ {
+ gAgent.setRunning();
+ gAgent.sendWalkRun(true);
+ }
+ }
}
else if (KEYSTATE_UP == s)
{
- gAgent.clearAlwaysRun();
+ if (gAgent.mDoubleTapRunMode == LLAgent::DOUBLETAP_SLIDERIGHT)
+ gAgent.mDoubleTapRunMode = LLAgent::DOUBLETAP_NONE;
gAgent.clearRunning();
gAgent.sendWalkRun(false);
}