diff options
author | andreykproductengine <andreykproductengine@lindenlab.com> | 2019-09-27 19:53:33 +0300 |
---|---|---|
committer | andreykproductengine <andreykproductengine@lindenlab.com> | 2019-09-27 19:53:33 +0300 |
commit | a8e56e67c3545cf857f80e81b3e98a278224f421 (patch) | |
tree | 0b4ee6c3c061ce23f47dbd2f237b68858f55bbf7 /indra/newview/llviewerinput.cpp | |
parent | f71cce50f26c197c1b2ce510b7a646d22a2eab26 (diff) |
SL-6109 Cleanup, run commands, and preparation for tooltip support
Diffstat (limited to 'indra/newview/llviewerinput.cpp')
-rw-r--r-- | indra/newview/llviewerinput.cpp | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/indra/newview/llviewerinput.cpp b/indra/newview/llviewerinput.cpp index 11f430cda3..eff578cf26 100644 --- a/indra/newview/llviewerinput.cpp +++ b/indra/newview/llviewerinput.cpp @@ -648,6 +648,78 @@ bool start_gesture( EKeystate s ) return true; } +bool run_forward(EKeystate s) +{ + if (KEYSTATE_DOWN == s) + { + gAgent.setAlwaysRun(); + gAgent.setRunning(); + gAgent.sendWalkRun(true); + } + else if(KEYSTATE_UP == s) + { + gAgent.clearAlwaysRun(); + gAgent.clearRunning(); + gAgent.sendWalkRun(false); + } + agent_push_forward(s); + return true; +} + +bool run_backward(EKeystate s) +{ + if (KEYSTATE_DOWN == s) + { + gAgent.setAlwaysRun(); + gAgent.setRunning(); + gAgent.sendWalkRun(true); + } + else if (KEYSTATE_UP == s) + { + gAgent.clearAlwaysRun(); + gAgent.clearRunning(); + gAgent.sendWalkRun(false); + } + agent_push_backward(s); + return true; +} + +bool run_left(EKeystate s) +{ + if (KEYSTATE_DOWN == s) + { + gAgent.setAlwaysRun(); + gAgent.setRunning(); + gAgent.sendWalkRun(true); + } + else if (KEYSTATE_UP == s) + { + gAgent.clearAlwaysRun(); + gAgent.clearRunning(); + gAgent.sendWalkRun(false); + } + agent_slide_left(s); + return true; +} + +bool run_right(EKeystate s) +{ + if (KEYSTATE_DOWN == s) + { + gAgent.setAlwaysRun(); + gAgent.setRunning(); + gAgent.sendWalkRun(true); + } + else if (KEYSTATE_UP == s) + { + gAgent.clearAlwaysRun(); + gAgent.clearRunning(); + gAgent.sendWalkRun(false); + } + agent_slide_right(s); + return true; +} + bool toggle_run(EKeystate s) { if (KEYSTATE_DOWN != s) return true; @@ -789,6 +861,10 @@ REGISTER_KEYBOARD_ACTION("edit_avatar_move_backward", edit_avatar_move_backward) REGISTER_KEYBOARD_ACTION("stop_moving", stop_moving); REGISTER_KEYBOARD_ACTION("start_chat", start_chat); REGISTER_KEYBOARD_ACTION("start_gesture", start_gesture); +REGISTER_KEYBOARD_ACTION("run_forward", run_forward); +REGISTER_KEYBOARD_ACTION("run_backward", run_backward); +REGISTER_KEYBOARD_ACTION("run_left", run_left); +REGISTER_KEYBOARD_ACTION("run_right", run_right); REGISTER_KEYBOARD_ACTION("toggle_run", toggle_run); REGISTER_KEYBOARD_ACTION("toggle_sit", toggle_sit); REGISTER_KEYBOARD_ACTION("toggle_pause_media", toggle_pause_media); |