From b538c410186d05e6ece1589a2babc0d2853aa19d Mon Sep 17 00:00:00 2001 From: Selo Date: Sun, 18 Sep 2011 15:25:54 +0200 Subject: [PATCH] Added NaCl version of rightclick-mousewheel-zoom for mouselook. From Charlice Yao, NaCl --- indra/newview/app_settings/settings.xml | 15 ++++++++++ indra/newview/lltoolcomp.cpp | 37 +++++++++++++++++++++++-- indra/newview/lltoolcomp.h | 6 ++++ 3 files changed, 56 insertions(+), 2 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index f4054e0923..ca933ad979 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -16408,5 +16408,20 @@ Change of this parameter will affect the layout of buttons in notification toast Value 1 + _NACL_MLFovValues + + Comment + NaCl Fov zoom values + Persist + 1 + Type + Vector3 + Value + + 1.047197551 + 1.047197551 + 0.0 + + diff --git a/indra/newview/lltoolcomp.cpp b/indra/newview/lltoolcomp.cpp index 923fbecb1a..165e07b52e 100644 --- a/indra/newview/lltoolcomp.cpp +++ b/indra/newview/lltoolcomp.cpp @@ -741,9 +741,30 @@ BOOL LLToolCompGun::handleRightMouseDown(S32 x, S32 y, MASK mask) */ // Returning true will suppress the context menu + // NaCl - Rightclick-mousewheel zoom + static LLCachedControl _NACL_MLFovValues(gSavedSettings,"_NACL_MLFovValues"); + static LLCachedControl CameraAngle(gSavedSettings,"CameraAngle"); + LLVector3 vTemp=_NACL_MLFovValues; + vTemp.mV[0]=CameraAngle; + vTemp.mV[2]=1.0f; + gSavedSettings.setVector3("_NACL_MLFovValues",vTemp); + gSavedSettings.setF32("CameraAngle",vTemp.mV[1]); + // NaCl End return TRUE; } - +// NaCl - Rightclick-mousewheel zoom +BOOL LLToolCompGun::handleRightMouseUp(S32 x, S32 y, MASK mask) +{ + static LLCachedControl _NACL_MLFovValues(gSavedSettings,"_NACL_MLFovValues"); + static LLCachedControl CameraAngle(gSavedSettings,"CameraAngle"); + LLVector3 vTemp=_NACL_MLFovValues; + vTemp.mV[1]=CameraAngle; + vTemp.mV[2]=0.0f; + gSavedSettings.setVector3("_NACL_MLFovValues",vTemp); + gSavedSettings.setF32("CameraAngle",vTemp.mV[0]); + return TRUE; +} +// NaCl End BOOL LLToolCompGun::handleMouseUp(S32 x, S32 y, MASK mask) { @@ -777,7 +798,19 @@ void LLToolCompGun::handleDeselect() BOOL LLToolCompGun::handleScrollWheel(S32 x, S32 y, S32 clicks) { - if (clicks > 0) + // NaCl - Rightclick-mousewheel zoom + static LLCachedControl _NACL_MLFovValues(gSavedSettings,"_NACL_MLFovValues"); + static LLCachedControl CameraAngle(gSavedSettings,"CameraAngle"); + LLVector3 vTemp=_NACL_MLFovValues; + vTemp.mV[1]=CameraAngle; + if(vTemp.mV[2] > 0.0f) + { + vTemp.mV[1]+=clicks*0.1; + gSavedSettings.setVector3("_NACL_MLFovValues",vTemp); + gSavedSettings.setF32("CameraAngle",vTemp.mV[1]); + } + else if (clicks > 0) + // NaCl End { gAgentCamera.changeCameraToDefault(); diff --git a/indra/newview/lltoolcomp.h b/indra/newview/lltoolcomp.h index bbb5ed5797..3721d9086c 100644 --- a/indra/newview/lltoolcomp.h +++ b/indra/newview/lltoolcomp.h @@ -53,6 +53,9 @@ public: virtual BOOL handleHover(S32 x, S32 y, MASK mask) { return mCur->handleHover( x, y, mask ); } virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks) { return mCur->handleScrollWheel( x, y, clicks ); } virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) { return mCur->handleRightMouseDown( x, y, mask ); } + // NaCl - Rightclick-mousewheel zoom + virtual BOOL handleRightMouseUp(S32 x, S32 y, MASK mask) { return mCur->handleRightMouseUp( x, y, mask ); } + // NaCl End virtual LLViewerObject* getEditingObject() { return mCur->getEditingObject(); } virtual LLVector3d getEditingPointGlobal() { return mCur->getEditingPointGlobal(); } @@ -218,6 +221,9 @@ public: virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask); virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); + // NaCl - Rightclick-mousewheel zoom + virtual BOOL handleRightMouseUp(S32 x, S32 y, MASK mask); + // NaCl End virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); virtual void onMouseCaptureLost();