diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 5f979de31..d08bd8a36 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -2106,6 +2106,15 @@ void LLAgentCamera::handleScrollWheel(S32 clicks) } } +//----------------------------------------------------------------------------- +// resetPresetOffsets() - Sets the current preset back to its default state +//----------------------------------------------------------------------------- +void LLAgentCamera::resetPresetOffsets() +{ + mFocusOffsetInitial[mCameraPreset]->resetToDefault(); + mCameraOffsetInitial[mCameraPreset]->resetToDefault(); +} + //----------------------------------------------------------------------------- // getCameraMinOffGround() diff --git a/indra/newview/llagentcamera.h b/indra/newview/llagentcamera.h index 3a2ced058..8ba8a4f70 100644 --- a/indra/newview/llagentcamera.h +++ b/indra/newview/llagentcamera.h @@ -113,6 +113,9 @@ private: //-------------------------------------------------------------------- public: void switchCameraPreset(ECameraPreset preset); + + /** Sets the current preset back to its default state */ + void resetPresetOffsets(); private: /** Determines default camera offset depending on the current camera preset */ LLVector3 getCameraOffsetInitial(); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 272b17937..4e881c87e 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -4160,6 +4160,15 @@ void reset_view_final( BOOL proceed ) } +class LLViewResetPresetAngles : public view_listener_t +{ + bool handleEvent(LLPointer event, const LLSD& userdata) + { + gAgentCamera.resetPresetOffsets(); + return true; + } +}; + class LLViewLookAtLastChatter : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) @@ -9634,6 +9643,7 @@ void initialize_menus() addMenu(new LLViewJoystickFlycam(), "View.JoystickFlycam"); addMenu(new LLViewCommunicate(), "View.Communicate"); addMenu(new LLViewResetView(), "View.ResetView"); + addMenu(new LLViewResetPresetAngles(), "View.ResetPresetAngles"); addMenu(new LLViewLookAtLastChatter(), "View.LookAtLastChatter"); addMenu(new LLViewShowHoverTips(), "View.ShowHoverTips"); addMenu(new LLViewHighlightTransparent(), "View.HighlightTransparent"); diff --git a/indra/newview/skins/default/xui/en-us/menu_viewer.xml b/indra/newview/skins/default/xui/en-us/menu_viewer.xml index d72d44242..38744a6d3 100644 --- a/indra/newview/skins/default/xui/en-us/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en-us/menu_viewer.xml @@ -308,6 +308,9 @@ + + +