Feature Request from friti: Add a reset button to Depth of Field tab of graphics.
Actually should've committed this last night. X3
This commit is contained in:
@@ -97,8 +97,21 @@ const F32 MIN_USER_FAR_CLIP = 64.f;
|
||||
|
||||
const S32 ASPECT_RATIO_STR_LEN = 100;
|
||||
|
||||
void reset_all_to_default(const LLView* panel)
|
||||
{
|
||||
LLView::child_list_const_iter_t end(panel->endChild());
|
||||
for (LLView::child_list_const_iter_t i = panel->beginChild(); i != end; ++i)
|
||||
{
|
||||
const std::string& control_name((*i)->getControlName());
|
||||
if (control_name.empty()) continue;
|
||||
if (control_name == "RenderDepthOfField") continue; // Don't touch render settings *sigh* hack
|
||||
LLUI::getControlControlGroup(control_name).getControl(control_name)->resetToDefault(true);
|
||||
}
|
||||
}
|
||||
|
||||
LLPanelDisplay::LLPanelDisplay()
|
||||
{
|
||||
mCommitCallbackRegistrar.add("Graphics.ResetTab", boost::bind(reset_all_to_default, boost::bind(&LLView::getChildView, this, _2, true, false)));
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_graphics1.xml");
|
||||
}
|
||||
|
||||
|
||||
@@ -145,6 +145,9 @@ when the Atmospheric Shaders are enabled.
|
||||
<slider bottom_delta="-18" follows="top|left" height="16" width="298" control_name="CameraMaxCoF" can_edit_text="true" decimal_digits="1" increment="0.1" label_width="110" max_val="100" min_val="0" name="CameraCoF" label="Circle of Confusion:" tool_tip="Set the Camera circle of confusion"/>
|
||||
<slider bottom_delta="-18" follows="top|left" height="16" width="298" control_name="CameraFocusTransitionTime" can_edit_text="true" decimal_digits="2" increment="0.01" label_width="110" max_val="20" min_val="0.01" name="CameraFocusTrans" label="Transition Time(secs):" tool_tip="Time taken to alter focus from one place to the next"/>
|
||||
<slider bottom_delta="-18" follows="top|left" height="16" width="298" control_name="CameraDoFResScale" can_edit_text="true" decimal_digits="2" increment="0.01" label_width="110" val_width="35" max_val="1" min_val="0.25" name="CameraDoFRes" label="Resolution:" tool_tip="Set the Resolution (Quality) of each DoF pixel"/>
|
||||
<button bottom_delta="-24" follows="top|left" height="20" width="298" name="reset_dof" label="Reset Depth of Field Settings">
|
||||
<button.commit_callback function="Graphics.ResetTab" parameter="DoF"/>
|
||||
</button>
|
||||
</panel>
|
||||
</tab_container>
|
||||
<string name="resolution_format">[RES_X] x [RES_Y]</string>
|
||||
|
||||
Reference in New Issue
Block a user