From b92dd27878c73d23dec9859b317babfde749b33b Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Sun, 23 Nov 2014 12:11:51 -0500 Subject: STORM-2082 Allow saving and loading of graphic settings --- indra/newview/app_settings/settings.xml | 4 +- indra/newview/llfloaterpreference.cpp | 43 +- indra/newview/llfloaterpreference.h | 2 + .../skins/default/xui/en/floater_preferences.xml | 10 +- .../xui/en/menu_preferences_graphics_gear.xml | 21 + .../default/xui/en/panel_preferences_graphics1.xml | 1764 ++++++++++---------- 6 files changed, 968 insertions(+), 876 deletions(-) create mode 100644 indra/newview/skins/default/xui/en/menu_preferences_graphics_gear.xml diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index f2fb9e854f..2e8737f0d7 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -9737,13 +9737,13 @@ RenderTerrainDetail Comment - Detail applied to terrain texturing (0 = none, 1 or 2 = full) + Detail applied to terrain texturing (0 = none, 1 = full) Persist 1 Type S32 Value - 2 + 1 RenderTerrainLODFactor diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index d3773767d0..3b64ffcf4c 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1099,8 +1099,7 @@ void LLFloaterPreference::buildPopupLists() void LLFloaterPreference::refreshEnabledState() { - LLComboBox* ctrl_reflections = getChild("Reflections"); - LLRadioGroup* radio_reflection_detail = getChild("ReflectionDetailRadio"); + LLUICtrl* ctrl_reflections = getChild("Reflections"); // Reflections BOOL reflections = gSavedSettings.getBOOL("VertexShaderEnable") @@ -1113,8 +1112,6 @@ void LLFloaterPreference::refreshEnabledState() bool bumpshiny = gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps && LLFeatureManager::getInstance()->isFeatureAvailable("RenderObjectBump"); bumpshiny_ctrl->setEnabled(bumpshiny ? TRUE : FALSE); - radio_reflection_detail->setEnabled(reflections); - // Avatar Mode // Enable Avatar Shaders LLCheckBoxCtrl* ctrl_avatar_vp = getChild("AvatarVertexProgram"); @@ -1143,20 +1140,19 @@ void LLFloaterPreference::refreshEnabledState() // Vertex Shaders // Global Shader Enable LLCheckBoxCtrl* ctrl_shader_enable = getChild("BasicShaders"); - // radio set for terrain detail mode - LLRadioGroup* mRadioTerrainDetail = getChild("TerrainDetailRadio"); // can be linked with control var + LLSliderCtrl* terrain_detail = getChild("TerrainDetail"); // can be linked with control var ctrl_shader_enable->setEnabled(LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable")); BOOL shaders = ctrl_shader_enable->get(); if (shaders) { - mRadioTerrainDetail->setValue(1); - mRadioTerrainDetail->setEnabled(FALSE); + terrain_detail->setValue(1); + terrain_detail->setEnabled(FALSE); } else { - mRadioTerrainDetail->setEnabled(TRUE); + terrain_detail->setEnabled(TRUE); } // WindLight @@ -1209,7 +1205,7 @@ void LLFloaterPreference::refreshEnabledState() void LLFloaterPreference::disableUnavailableSettings() { - LLComboBox* ctrl_reflections = getChild("Reflections"); + LLUICtrl* ctrl_reflections = getChild("Reflections"); LLCheckBoxCtrl* ctrl_avatar_vp = getChild("AvatarVertexProgram"); LLCheckBoxCtrl* ctrl_avatar_cloth = getChild("AvatarCloth"); LLCheckBoxCtrl* ctrl_shader_enable = getChild("BasicShaders"); @@ -1360,6 +1356,8 @@ void LLFloaterPreference::refresh() { LLPanel::refresh(); + refreshEnabledState(); + // sliders and their text boxes // mPostProcess = gSavedSettings.getS32("RenderGlowResolutionPow"); // slider text boxes @@ -1372,8 +1370,9 @@ void LLFloaterPreference::refresh() updateSliderText(getChild("TerrainMeshDetail", true), getChild("TerrainMeshDetailText", true)); updateSliderText(getChild("RenderPostProcess", true), getChild("PostProcessText", true)); updateSliderText(getChild("SkyMeshDetail", true), getChild("SkyMeshDetailText", true)); - - refreshEnabledState(); + updateSliderText(getChild("TerrainDetail", true), getChild("TerrainDetailText", true)); + updateReflectionsText(getChild("Reflections", true), getChild("ReflectionsText", true)); + updateRenderShadowDetailText(getChild("RenderShadowDetail", true), getChild("RenderShadowDetailText", true)); } void LLFloaterPreference::onCommitWindowedMode() @@ -1625,6 +1624,23 @@ void LLFloaterPreference::refreshUI() refresh(); } +void LLFloaterPreference::updateReflectionsText(LLSliderCtrl* ctrl, LLTextBox* text_box) +{ + if (text_box == NULL || ctrl== NULL) + return; + + U32 value = (U32)ctrl->getValue().asInteger(); + text_box->setText(getString("Reflections" + llformat("%d", value))); +} +void LLFloaterPreference::updateRenderShadowDetailText(LLSliderCtrl* ctrl, LLTextBox* text_box) +{ + if (text_box == NULL || ctrl== NULL) + return; + + U32 value = (U32)ctrl->getValue().asInteger(); + text_box->setText(getString("RenderShadowDetail" + llformat("%d", value))); +} + void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box) { if (text_box == NULL || ctrl== NULL) @@ -2093,6 +2109,9 @@ static LLPanelInjector t_pref_privacy("panel_preferenc BOOL LLPanelPreferenceGraphics::postBuild() { + LLComboBox* graphic_preset = getChild("graphic_preset_combo"); + graphic_preset->setLabel(getString("graphic_preset_combo_label")); + return LLPanelPreference::postBuild(); } void LLPanelPreferenceGraphics::draw() diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 7bf6ae7d79..3ac5b2ad81 100755 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -157,6 +157,8 @@ public: void onChangeQuality(const LLSD& data); void updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box); + void updateReflectionsText(LLSliderCtrl* ctrl, LLTextBox* text_box); + void updateRenderShadowDetailText(LLSliderCtrl* ctrl, LLTextBox* text_box); void refreshUI(); void onCommitParcelMediaAutoPlayEnable(); diff --git a/indra/newview/skins/default/xui/en/floater_preferences.xml b/indra/newview/skins/default/xui/en/floater_preferences.xml index bd6faf4ed8..edc205927c 100755 --- a/indra/newview/skins/default/xui/en/floater_preferences.xml +++ b/indra/newview/skins/default/xui/en/floater_preferences.xml @@ -11,7 +11,15 @@ single_instance="true" title="PREFERENCES" width="658"> - - - + + + + + + + -- cgit v1.2.3