Feature Request: Add option to reset angles/offsets adjustments made to current camera preset.
Adds "Reset Camera Preset Angle to Default" to view menu Wasn't quite sure where to hook this up, menu seemed the best for the moment, but really it's more of a preferences button function.
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -4160,6 +4160,15 @@ void reset_view_final( BOOL proceed )
|
||||
|
||||
}
|
||||
|
||||
class LLViewResetPresetAngles : public view_listener_t
|
||||
{
|
||||
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
||||
{
|
||||
gAgentCamera.resetPresetOffsets();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class LLViewLookAtLastChatter : public view_listener_t
|
||||
{
|
||||
bool handleEvent(LLPointer<LLEvent> 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");
|
||||
|
||||
@@ -308,6 +308,9 @@
|
||||
<on_click function="ToggleControl" userdata="SinguMotionResetsCamera"/>
|
||||
<on_check control="SinguMotionResetsCamera"/>
|
||||
</menu_item_check>
|
||||
<menu_item_call label="Reset Camera Preset Angle to Default" name="Reset Camera Preset Angle">
|
||||
<on_click function="View.ResetPresetAngles" userdata="" />
|
||||
</menu_item_call>
|
||||
<menu_item_call bottom="-86" enabled="false" height="19" label="Look at Last Chatter" left="0"
|
||||
mouse_opaque="true" name="Look at Last Chatter" shortcut="control|\"
|
||||
width="211">
|
||||
|
||||
Reference in New Issue
Block a user