Feature Request: Add an option to disable camera resetting upon motion
Adds View->Motion Resets Camera, and keyboard shortcut Alt-Shift-R Adds debug setting SinguMotionResetsCamera
This commit is contained in:
@@ -620,6 +620,17 @@
|
||||
<key>Value</key>
|
||||
<boolean>0</boolean>
|
||||
</map>
|
||||
<key>SinguMotionResetsCamera</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Allow camera to reset when moving.</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<boolean>1</boolean>
|
||||
</map>
|
||||
<key>UseWebProfiles</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
||||
@@ -131,6 +131,20 @@ const F32 MAX_FIDGET_TIME = 20.f; // seconds
|
||||
LLAgent gAgent;
|
||||
std::string gAuthString;
|
||||
|
||||
void camera_reset_on_motion()
|
||||
{
|
||||
static const LLCachedControl<bool> motion_resets_cam("SinguMotionResetsCamera");
|
||||
if (motion_resets_cam)
|
||||
{
|
||||
gAgentCamera.resetView();
|
||||
}
|
||||
else if (LLSelectMgr::getInstance()->getSelection()->isAttachment()) // If attachments are still selected during movement, bad things happen
|
||||
{
|
||||
LLSelectMgr::getInstance()->deselectAll();
|
||||
if (gMenuHolder) gMenuHolder->hideMenus(); // Attachments may be selected through menus, deselection will invalidate these menus
|
||||
}
|
||||
}
|
||||
|
||||
class LLTeleportRequest
|
||||
{
|
||||
public:
|
||||
@@ -540,7 +554,7 @@ void LLAgent::moveAt(S32 direction, bool reset)
|
||||
|
||||
if (reset)
|
||||
{
|
||||
gAgentCamera.resetView();
|
||||
camera_reset_on_motion();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -563,7 +577,7 @@ void LLAgent::moveAtNudge(S32 direction)
|
||||
setControlFlags(AGENT_CONTROL_NUDGE_AT_NEG);
|
||||
}
|
||||
|
||||
gAgentCamera.resetView();
|
||||
camera_reset_on_motion();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -585,7 +599,7 @@ void LLAgent::moveLeft(S32 direction)
|
||||
setControlFlags(AGENT_CONTROL_LEFT_NEG | AGENT_CONTROL_FAST_LEFT);
|
||||
}
|
||||
|
||||
gAgentCamera.resetView();
|
||||
camera_reset_on_motion();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -607,7 +621,7 @@ void LLAgent::moveLeftNudge(S32 direction)
|
||||
setControlFlags(AGENT_CONTROL_NUDGE_LEFT_NEG);
|
||||
}
|
||||
|
||||
gAgentCamera.resetView();
|
||||
camera_reset_on_motion();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -629,7 +643,7 @@ void LLAgent::moveUp(S32 direction)
|
||||
setControlFlags(AGENT_CONTROL_UP_NEG | AGENT_CONTROL_FAST_UP);
|
||||
}
|
||||
|
||||
if (!isCrouch) gAgentCamera.resetView();
|
||||
if (!isCrouch) camera_reset_on_motion();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -650,7 +664,7 @@ void LLAgent::moveYaw(F32 mag, bool reset_view)
|
||||
|
||||
if (reset_view)
|
||||
{
|
||||
gAgentCamera.resetView();
|
||||
camera_reset_on_motion();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -783,7 +797,7 @@ void LLAgent::toggleFlying()
|
||||
BOOL fly = !gAgent.getFlying();
|
||||
|
||||
gAgent.setFlying( fly );
|
||||
gAgentCamera.resetView();
|
||||
camera_reset_on_motion();
|
||||
}
|
||||
|
||||
// static
|
||||
|
||||
@@ -309,6 +309,10 @@
|
||||
mouse_opaque="true" name="Reset View" shortcut="Esc" width="211">
|
||||
<on_click function="View.ResetView" userdata="" />
|
||||
</menu_item_call>
|
||||
<menu_item_check label="Motion Resets Camera" name="Motion Resets Camera" shortcut="alt|shift|R">
|
||||
<on_click function="ToggleControl" userdata="SinguMotionResetsCamera"/>
|
||||
<on_check control="SinguMotionResetsCamera"/>
|
||||
</menu_item_check>
|
||||
<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