diff --git a/indra/newview/lltoolfocus.cpp b/indra/newview/lltoolfocus.cpp index 568d20c23..0065a7f28 100644 --- a/indra/newview/lltoolfocus.cpp +++ b/indra/newview/lltoolfocus.cpp @@ -45,6 +45,7 @@ #include "llagentcamera.h" #include "llbutton.h" #include "llviewercontrol.h" +#include "llviewerkeyboard.h" #include "lldrawable.h" #include "llhoverview.h" #include "llhudmanager.h" @@ -312,9 +313,15 @@ BOOL LLToolCamera::handleMouseUp(S32 x, S32 y, MASK mask) return TRUE; } +static bool right_hold_mouse_walk=false; BOOL LLToolCamera::handleHover(S32 x, S32 y, MASK mask) { + if(right_hold_mouse_walk) + { + agent_push_forward(KEYSTATE_LEVEL); + } + S32 dx = gViewerWindow->getCurrentMouseDX(); S32 dy = gViewerWindow->getCurrentMouseDY(); @@ -449,8 +456,36 @@ BOOL LLToolCamera::handleHover(S32 x, S32 y, MASK mask) return TRUE; } +BOOL LLToolCamera::handleRightMouseDown(S32 x, S32 y, MASK mask) +{ + if(mMouseSteering) + { + agent_push_forward(KEYSTATE_DOWN); + right_hold_mouse_walk = true; + return TRUE; + } + else + { + return FALSE; + } +} + +BOOL LLToolCamera::handleRightMouseUp(S32 x, S32 y, MASK mask) +{ + if(mMouseSteering || right_hold_mouse_walk) + { + agent_push_forward(KEYSTATE_UP); + right_hold_mouse_walk = false; + return TRUE; + } + else + { + return FALSE; + } +} void LLToolCamera::onMouseCaptureLost() { releaseMouse(); + handleRightMouseUp(0,0,0); } diff --git a/indra/newview/lltoolfocus.h b/indra/newview/lltoolfocus.h index 023cc2638..96a58bb4e 100644 --- a/indra/newview/lltoolfocus.h +++ b/indra/newview/lltoolfocus.h @@ -47,6 +47,8 @@ public: virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); virtual BOOL handleHover(S32 x, S32 y, MASK mask); + virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); + virtual BOOL handleRightMouseUp(S32 x, S32 y, MASK mask); virtual void onMouseCaptureLost(); diff --git a/indra/newview/llviewerkeyboard.h b/indra/newview/llviewerkeyboard.h index b52b738bd..e3ef315b5 100644 --- a/indra/newview/llviewerkeyboard.h +++ b/indra/newview/llviewerkeyboard.h @@ -94,4 +94,5 @@ protected: extern LLViewerKeyboard gViewerKeyboard; extern bool isCrouch; +void agent_push_forward(EKeystate s); #endif // LL_LLVIEWERKEYBOARD_H diff --git a/indra/newview/skins/default/xui/en-us/floater_live_lsleditor.xml b/indra/newview/skins/default/xui/en-us/floater_live_lsleditor.xml index 2e91a82f9..ca25e51b9 100644 --- a/indra/newview/skins/default/xui/en-us/floater_live_lsleditor.xml +++ b/indra/newview/skins/default/xui/en-us/floater_live_lsleditor.xml @@ -3,13 +3,13 @@ can_resize="true" enabled="true" follows="left|top" height="550" left="306" min_height="271" min_width="290" mouse_opaque="true" name="script ed float" rect_control="FloaterOpenObjectRect" title="Script: New Script" width="500" border_drop_shadow_visible="false" border_visible="false" bevel_style="none" border_style="line" border_thickness="0"> -