From 45b59881ebcc19510c7e36398232f057366eb41d Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Tue, 3 Feb 2015 08:37:31 -0500 Subject: STORM-2082 Reformat preset floaters. Remove Impostor checkbox. That control is now merged into the right side of the impostors slider. Maximum ARC still depends on impostors being enabled. Once that dependency is removed in llvoavatar then it will be necessary to reflect that change in the UI code. --- indra/newview/llfloaterpreference.cpp | 32 ++++++++++---- indra/newview/llfloaterpreference.h | 4 ++ .../default/xui/en/floater_delete_pref_preset.xml | 24 +++++------ .../default/xui/en/floater_load_pref_preset.xml | 26 +++++------ .../default/xui/en/floater_save_pref_preset.xml | 27 ++++++------ .../default/xui/en/panel_preferences_graphics1.xml | 50 +++++++++++----------- indra/newview/skins/default/xui/en/strings.xml | 2 +- 7 files changed, 93 insertions(+), 72 deletions(-) diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 17c93d792e..cbd9867107 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1229,7 +1229,6 @@ void LLFloaterPreference::refreshEnabledState() enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderUseImpostors") && gSavedSettings.getBOOL("RenderUseImpostors"); getChildView("MaximumARC")->setEnabled(enabled); maximum_arc_text->setEnabled(enabled); - getChildView("MaxNumberAvatarDrawn")->setEnabled(enabled); // Hardware settings F32 mem_multiplier = gSavedSettings.getF32("RenderTextureMemoryMultiple"); @@ -1304,10 +1303,8 @@ void LLFloaterPreference::disableUnavailableSettings() LLCheckBoxCtrl* ctrl_avatar_cloth = getChild("AvatarCloth"); LLCheckBoxCtrl* ctrl_shader_enable = getChild("BasicShaders"); LLCheckBoxCtrl* ctrl_wind_light = getChild("WindLightUseAtmosShaders"); - LLCheckBoxCtrl* ctrl_avatar_impostors = getChild("AvatarImpostors"); LLSliderCtrl* ctrl_maximum_arc = getChild("MaximumARC"); LLTextBox* maximum_arc_text = getChild("MaximumARCText"); - LLSliderCtrl* ctrl_max_visible = getChild("MaxNumberAvatarDrawn"); LLCheckBoxCtrl* ctrl_deferred = getChild("UseLightShaders"); LLCheckBoxCtrl* ctrl_deferred2 = getChild("UseLightShaders2"); LLComboBox* ctrl_shadows = getChild("ShadowDetail"); @@ -1460,11 +1457,8 @@ void LLFloaterPreference::disableUnavailableSettings() // disabled impostors if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderUseImpostors")) { - ctrl_avatar_impostors->setEnabled(FALSE); - ctrl_avatar_impostors->setValue(FALSE); ctrl_maximum_arc->setEnabled(FALSE); maximum_arc_text->setEnabled(FALSE); - ctrl_max_visible->setEnabled(FALSE); } } @@ -1474,8 +1468,6 @@ void LLFloaterPreference::refresh() getChild("fsaa")->setValue((LLSD::Integer) gSavedSettings.getU32("RenderFSAASamples")); - refreshEnabledState(); - // sliders and their text boxes // mPostProcess = gSavedSettings.getS32("RenderGlowResolutionPow"); // slider text boxes @@ -1488,7 +1480,10 @@ void LLFloaterPreference::refresh() updateSliderText(getChild("RenderPostProcess", true), getChild("PostProcessText", true)); updateSliderText(getChild("SkyMeshDetail", true), getChild("SkyMeshDetailText", true)); updateSliderText(getChild("TerrainDetail", true), getChild("TerrainDetailText", true)); + updateImpostorsText(getChild("MaxNumberAvatarDrawn", true), getChild("ImpostorsText", true)); updateMaximumArcText(getChild("MaximumARC", true), getChild("MaximumARCText", true)); + + refreshEnabledState(); } void LLFloaterPreference::onCommitWindowedMode() @@ -1769,6 +1764,25 @@ void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_b } } +void LLFloaterPreference::updateImpostorsText(LLSliderCtrl* ctrl, LLTextBox* text_box) +{ + F32 value = (F32)ctrl->getValue().asReal(); + + if (value < IMPOSTORS_OFF) + { + text_box->setText(llformat("%0.0f", value)); + if (!gSavedSettings.getBOOL("RenderUseImpostors")) + { + gSavedSettings.setBOOL("RenderUseImpostors", true); + } + } + else + { + text_box->setText(LLTrans::getString("no_limit")); + gSavedSettings.setBOOL("RenderUseImpostors", false); + } +} + void LLFloaterPreference::updateMaximumArcText(LLSliderCtrl* ctrl, LLTextBox* text_box) { F32 min_result = 20000.0f; @@ -1781,7 +1795,7 @@ void LLFloaterPreference::updateMaximumArcText(LLSliderCtrl* ctrl, LLTextBox* te // It has been decided that having the slider all the way to the right will be the off position, which // is a value of 101, so it is necessary to change value to 0 disable impostor generation. value = 0.0f; - text_box->setText(LLTrans::getString("Off")); + text_box->setText(LLTrans::getString("no_limit")); } else { diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 2810a1008b..10087f8aa3 100755 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -58,6 +58,9 @@ typedef enum } EGraphicsSettings; +// 65 is the maximum value for impostors set in the xml file. When the slider reaches this +// value impostors are turned off. +const U32 IMPOSTORS_OFF = 66; // Floater to control preferences (display, audio, bandwidth, general. class LLFloaterPreference : public LLFloater, public LLAvatarPropertiesObserver, public LLConversationLogObserver @@ -159,6 +162,7 @@ public: void onChangeQuality(const LLSD& data); void updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box); + void updateImpostorsText(LLSliderCtrl* ctrl, LLTextBox* text_box); void updateMaximumArcText(LLSliderCtrl* ctrl, LLTextBox* text_box); void refreshUI(); diff --git a/indra/newview/skins/default/xui/en/floater_delete_pref_preset.xml b/indra/newview/skins/default/xui/en/floater_delete_pref_preset.xml index cc3f9c5842..0688fdb42c 100644 --- a/indra/newview/skins/default/xui/en/floater_delete_pref_preset.xml +++ b/indra/newview/skins/default/xui/en/floater_delete_pref_preset.xml @@ -7,43 +7,43 @@ name="Delete Pref Preset" save_rect="true" title="DELETE PREF PRESET" - width="550"> + width="300"> Delete Graphic Preset Delete Camera Preset - Preset: + top="30" + width="200"> + Select a preset