diff options
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/newview/llagent.cpp | 2 | ||||
-rwxr-xr-x | indra/newview/llagent.h | 4 | ||||
-rwxr-xr-x | indra/newview/llfloatercamera.cpp | 3 | ||||
-rwxr-xr-x | indra/newview/lljoystickbutton.cpp | 6 | ||||
-rwxr-xr-x | indra/newview/lljoystickbutton.h | 1 | ||||
-rwxr-xr-x | indra/newview/llviewerkeyboard.cpp | 10 |
6 files changed, 26 insertions, 0 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 5cb03cd2ae..99fa12fc32 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -398,6 +398,8 @@ LLAgent::LLAgent() : mAutoPilotFinishedCallback(NULL), mAutoPilotCallbackData(NULL), + mMovementKeysLocked(FALSE), + mEffectColor(new LLUIColor(LLColor4(0.f, 1.f, 1.f, 1.f))), mHaveHomePosition(FALSE), diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index a2e9cedd88..33088283da 100755 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -515,6 +515,9 @@ public: void moveYaw(F32 mag, bool reset_view = true); void movePitch(F32 mag); + BOOL isMovementLocked() const { return mMovementKeysLocked; } + void setMovementLocked(BOOL set_locked) { mMovementKeysLocked = set_locked; } + //-------------------------------------------------------------------- // Move the avatar's frame //-------------------------------------------------------------------- @@ -569,6 +572,7 @@ private: void (*mAutoPilotFinishedCallback)(BOOL, void *); void* mAutoPilotCallbackData; LLUUID mLeaderID; + BOOL mMovementKeysLocked; /** Movement ** ** diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp index d0939b3eee..ef08db3d33 100755 --- a/indra/newview/llfloatercamera.cpp +++ b/indra/newview/llfloatercamera.cpp @@ -32,6 +32,7 @@ #include "llfloaterreg.h" // Viewer includes +#include "llagent.h" #include "llagentcamera.h" #include "lljoystickbutton.h" #include "llviewercontrol.h" @@ -342,6 +343,8 @@ void LLFloaterCamera::onClose(bool app_quitting) switchMode(CAMERA_CTRL_MODE_PAN); mClosed = TRUE; + + gAgent.setMovementLocked(FALSE); } LLFloaterCamera::LLFloaterCamera(const LLSD& val) diff --git a/indra/newview/lljoystickbutton.cpp b/indra/newview/lljoystickbutton.cpp index d38f90015e..59e14e6cc0 100755 --- a/indra/newview/lljoystickbutton.cpp +++ b/indra/newview/lljoystickbutton.cpp @@ -424,6 +424,7 @@ void LLJoystickCameraRotate::updateSlop() BOOL LLJoystickCameraRotate::handleMouseDown(S32 x, S32 y, MASK mask) { + gAgent.setMovementLocked(TRUE); updateSlop(); // Set initial offset based on initial click location @@ -465,6 +466,11 @@ BOOL LLJoystickCameraRotate::handleMouseDown(S32 x, S32 y, MASK mask) return LLJoystick::handleMouseDown(x, y, mask); } +BOOL LLJoystickCameraRotate::handleMouseUp(S32 x, S32 y, MASK mask) +{ + gAgent.setMovementLocked(FALSE); + return LLJoystick::handleMouseUp(x, y, mask); +} void LLJoystickCameraRotate::onHeldDown() { diff --git a/indra/newview/lljoystickbutton.h b/indra/newview/lljoystickbutton.h index 8d76aa9531..4e6c774cad 100755 --- a/indra/newview/lljoystickbutton.h +++ b/indra/newview/lljoystickbutton.h @@ -146,6 +146,7 @@ public: virtual void setToggleState( BOOL left, BOOL top, BOOL right, BOOL bottom ); virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); + virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); virtual void onHeldDown(); virtual void draw(); diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp index 35b55029cc..9766a25521 100755 --- a/indra/newview/llviewerkeyboard.cpp +++ b/indra/newview/llviewerkeyboard.cpp @@ -149,6 +149,8 @@ void camera_move_forward( EKeystate s ); void agent_push_forward( EKeystate s ) { + if(gAgent.isMovementLocked()) return; + //in free camera control mode we need to intercept keyboard events for avatar movements if (LLFloaterCamera::inFreeCameraMode()) { @@ -164,6 +166,8 @@ void camera_move_backward( EKeystate s ); void agent_push_backward( EKeystate s ) { + if(gAgent.isMovementLocked()) return; + //in free camera control mode we need to intercept keyboard events for avatar movements if (LLFloaterCamera::inFreeCameraMode()) { @@ -199,12 +203,14 @@ static void agent_slide_leftright( EKeystate s, S32 direction, LLAgent::EDoubleT void agent_slide_left( EKeystate s ) { + if(gAgent.isMovementLocked()) return; agent_slide_leftright(s, 1, LLAgent::DOUBLETAP_SLIDELEFT); } void agent_slide_right( EKeystate s ) { + if(gAgent.isMovementLocked()) return; agent_slide_leftright(s, -1, LLAgent::DOUBLETAP_SLIDERIGHT); } @@ -219,6 +225,8 @@ void agent_turn_left( EKeystate s ) return; } + if(gAgent.isMovementLocked()) return; + if (LLToolCamera::getInstance()->mouseSteerMode()) { agent_slide_left(s); @@ -247,6 +255,8 @@ void agent_turn_right( EKeystate s ) return; } + if(gAgent.isMovementLocked()) return; + if (LLToolCamera::getInstance()->mouseSteerMode()) { agent_slide_right(s); |