diff options
| -rw-r--r-- | indra/newview/llfloaterpreference.cpp | 47 | ||||
| -rw-r--r-- | indra/newview/llfloaterpreference.h | 14 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml | 35 | 
3 files changed, 83 insertions, 13 deletions
| diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 227d0eac77..36bdcf4d89 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -362,6 +362,7 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key)  	mCommitCallbackRegistrar.add("Pref.LogPath",				boost::bind(&LLFloaterPreference::onClickLogPath, this));  	mCommitCallbackRegistrar.add("Pref.HardwareDefaults",		boost::bind(&LLFloaterPreference::setHardwareDefaults, this));  	mCommitCallbackRegistrar.add("Pref.AvatarImpostorsEnable",	boost::bind(&LLFloaterPreference::onAvatarImpostorsEnable, this)); +	mCommitCallbackRegistrar.add("Pref.UpdateIndirectMaxComplexity",	boost::bind(&LLFloaterPreference::updateMaxComplexity, this));  	mCommitCallbackRegistrar.add("Pref.VertexShaderEnable",		boost::bind(&LLFloaterPreference::onVertexShaderEnable, this));  	mCommitCallbackRegistrar.add("Pref.WindowedMod",			boost::bind(&LLFloaterPreference::onCommitWindowedMode, this));  	mCommitCallbackRegistrar.add("Pref.UpdateSliderText",		boost::bind(&LLFloaterPreference::refreshUI,this)); @@ -838,7 +839,7 @@ void LLFloaterPreference::setHardwareDefaults()  	LLFeatureManager::getInstance()->applyRecommendedSettings();  	// reset indirects before refresh because we may have changed what they control -	LLFloaterPreferenceGraphicsAdvanced::setIndirectControls();  +	LLAvatarComplexityControls::setIndirectControls();   	refreshEnabledGraphics();  	gSavedSettings.setString("PresetGraphicActive", ""); @@ -1374,7 +1375,7 @@ void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState()  }  // static -void LLFloaterPreferenceGraphicsAdvanced::setIndirectControls() +void LLAvatarComplexityControls::setIndirectControls()  {  	/*  	 * We have controls that have an indirect relationship between the control @@ -1390,7 +1391,7 @@ void LLFloaterPreferenceGraphicsAdvanced::setIndirectControls()  }  // static -void LLFloaterPreferenceGraphicsAdvanced::setIndirectMaxNonImpostors() +void LLAvatarComplexityControls::setIndirectMaxNonImpostors()  {  	U32 max_non_impostors = gSavedSettings.getU32("RenderAvatarMaxNonImpostors");  	// for this one, we just need to make zero, which means off, the max value of the slider @@ -1398,7 +1399,7 @@ void LLFloaterPreferenceGraphicsAdvanced::setIndirectMaxNonImpostors()  	gSavedSettings.setU32("IndirectMaxNonImpostors", indirect_max_non_impostors);  } -void LLFloaterPreferenceGraphicsAdvanced::setIndirectMaxArc() +void LLAvatarComplexityControls::setIndirectMaxArc()  {  	U32 max_arc = gSavedSettings.getU32("RenderAvatarMaxComplexity");  	U32 indirect_max_arc; @@ -1567,6 +1568,9 @@ void LLFloaterPreferenceGraphicsAdvanced::disableUnavailableSettings()  void LLFloaterPreference::refresh()  {  	LLPanel::refresh(); +    LLAvatarComplexityControls::setText( +        gSavedSettings.getU32("RenderAvatarMaxComplexity"), +        getChild<LLTextBox>("IndirectMaxComplexityText", true));  	refreshEnabledState();  	LLFloater* advanced = LLFloaterReg::findTypedInstance<LLFloater>("prefs_graphics_advanced");  	if (advanced) @@ -1591,9 +1595,13 @@ void LLFloaterPreferenceGraphicsAdvanced::refresh()  	updateSliderText(getChild<LLSliderCtrl>("RenderPostProcess",	true), getChild<LLTextBox>("PostProcessText",			true));  	updateSliderText(getChild<LLSliderCtrl>("SkyMeshDetail",		true), getChild<LLTextBox>("SkyMeshDetailText",			true));  	updateSliderText(getChild<LLSliderCtrl>("TerrainDetail",		true), getChild<LLTextBox>("TerrainDetailText",			true));	 -	setIndirectControls(); -	setMaxNonImpostorsText(gSavedSettings.getU32("RenderAvatarMaxNonImpostors"),getChild<LLTextBox>("IndirectMaxNonImpostorsText", true)); -	setMaxComplexityText(gSavedSettings.getU32("RenderAvatarMaxComplexity"),getChild<LLTextBox>("IndirectMaxComplexityText", true)); +    LLAvatarComplexityControls::setIndirectControls(); +	setMaxNonImpostorsText( +        gSavedSettings.getU32("RenderAvatarMaxNonImpostors"), +        getChild<LLTextBox>("IndirectMaxNonImpostorsText", true)); +    LLAvatarComplexityControls::setText( +        gSavedSettings.getU32("RenderAvatarMaxComplexity"), +        getChild<LLTextBox>("IndirectMaxComplexityText", true));  	refreshEnabledState();  } @@ -1904,12 +1912,11 @@ void LLFloaterPreferenceGraphicsAdvanced::setMaxNonImpostorsText(U32 value, LLTe  	}  } -void LLFloaterPreferenceGraphicsAdvanced::updateMaxComplexity() +void LLAvatarComplexityControls::updateMax(LLSliderCtrl* slider, LLTextBox* value_label)  {  	// Called when the IndirectMaxComplexity control changes  	// Responsible for fixing the slider label (IndirectMaxComplexityText) and setting RenderAvatarMaxComplexity -	LLSliderCtrl* ctrl = getChild<LLSliderCtrl>("IndirectMaxComplexity"); -	U32 indirect_value = ctrl->getValue().asInteger(); +	U32 indirect_value = slider->getValue().asInteger();  	U32 max_arc;  	if (INDIRECT_MAX_ARC_OFF == indirect_value) @@ -1927,10 +1934,10 @@ void LLFloaterPreferenceGraphicsAdvanced::updateMaxComplexity()  	}  	gSavedSettings.setU32("RenderAvatarMaxComplexity", (U32)max_arc); -	setMaxComplexityText(max_arc, getChild<LLTextBox>("IndirectMaxComplexityText")); +	setText(max_arc, value_label);  } -void LLFloaterPreferenceGraphicsAdvanced::setMaxComplexityText(U32 value, LLTextBox* text_box) +void LLAvatarComplexityControls::setText(U32 value, LLTextBox* text_box)  {  	if (0 == value)  	{ @@ -1942,6 +1949,22 @@ void LLFloaterPreferenceGraphicsAdvanced::setMaxComplexityText(U32 value, LLText  	}  } +void LLFloaterPreference::updateMaxComplexity() +{ +	// Called when the IndirectMaxComplexity control changes +    LLAvatarComplexityControls::updateMax( +        getChild<LLSliderCtrl>("IndirectMaxComplexity"), +        getChild<LLTextBox>("IndirectMaxComplexityText")); +} + +void LLFloaterPreferenceGraphicsAdvanced::updateMaxComplexity() +{ +	// Called when the IndirectMaxComplexity control changes +    LLAvatarComplexityControls::updateMax( +        getChild<LLSliderCtrl>("IndirectMaxComplexity"), +        getChild<LLTextBox>("IndirectMaxComplexityText")); +} +  void LLFloaterPreference::onChangeMaturity()  {  	U8 sim_access = gSavedSettings.getU32("PreferredMaturity"); diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index ed692c903e..fa0c09e97a 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -181,6 +181,7 @@ private:  	void onDeleteTranscripts();  	void onDeleteTranscriptsResponse(const LLSD& notification, const LLSD& response);  	void updateDeleteTranscriptsButton(); +	void updateMaxComplexity();  	static std::string sSkin;  	notifications_map mNotificationOptions; @@ -267,7 +268,7 @@ private:  class LLFloaterPreferenceGraphicsAdvanced : public LLFloater  { -public:  +  public:   	LLFloaterPreferenceGraphicsAdvanced(const LLSD& key);  	~LLFloaterPreferenceGraphicsAdvanced();  	void onOpen(const LLSD& key); @@ -289,6 +290,17 @@ public:  	LOG_CLASS(LLFloaterPreferenceGraphicsAdvanced);  }; +class LLAvatarComplexityControls +{ +  public:  +	static void updateMax(LLSliderCtrl* slider, LLTextBox* value_label); +	static void setText(U32 value, LLTextBox* text_box); +	static void setIndirectControls(); +	static void setIndirectMaxNonImpostors(); +	static void setIndirectMaxArc(); +	LOG_CLASS(LLAvatarComplexityControls); +}; +  class LLFloaterPreferenceProxy : public LLFloater  {  public:  diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml index 6cf9045f2a..157668feb1 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml @@ -231,6 +231,41 @@       m    </text> +  <slider +    control_name="IndirectMaxComplexity" +    tool_tip="Controls at what point a visually complex avatar is drawn as a jelly doll" +    follows="left|top" +    height="16" +    initial_value="101" +    increment="1" +    label="Avatar Maximum Complexity:" +    label_width="165" +    layout="topleft" +    left="30" +    min_val="1" +    max_val="101" +    name="IndirectMaxComplexity" +    show_text="false" +    top_delta="20" +    width="300"> +    <slider.commit_callback +      function="Pref.UpdateIndirectMaxComplexity" +      parameter="IndirectMaxComlexityText" /> +  </slider> +  <text +    type="string" +    length="1" +    follows="left|top" +    height="16" +    layout="topleft" +    top_delta="0" +    left_delta="304" +    text_readonly_color="LabelDisabledColor" +    name="IndirectMaxComplexityText" +    width="65"> +       0 +  </text> +    <check_box      control_name="WindLightUseAtmosShaders"      height="16" | 
