From d1bc2fe292edcea60b49ce8111a495974e9415a2 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Wed, 14 Jan 2015 19:55:58 -0500 Subject: STORM-2082 Assorted UI tweaks, better MaximumARC formula, pulldowns disappear faster --- indra/newview/llfloaterpreference.cpp | 54 ++++++++------ indra/newview/llfloaterpreference.h | 1 + indra/newview/llpanelnearbymedia.cpp | 6 +- indra/newview/llpanelpresetspulldown.cpp | 8 +- indra/newview/llpanelvolumepulldown.cpp | 4 +- indra/newview/llpresetsmanager.cpp | 14 ++-- indra/newview/llpresetsmanager.h | 1 + .../default/xui/en/panel_preferences_graphics1.xml | 86 +++++++++++++--------- 8 files changed, 97 insertions(+), 77 deletions(-) diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 6e340864bc..4b83b104fd 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1475,7 +1475,7 @@ void LLFloaterPreference::refresh() updateSliderText(getChild("RenderPostProcess", true), getChild("PostProcessText", true)); updateSliderText(getChild("SkyMeshDetail", true), getChild("SkyMeshDetailText", true)); updateSliderText(getChild("TerrainDetail", true), getChild("TerrainDetailText", true)); - updateSliderText(getChild("MaximumARC", true), getChild("MaximumARCText", true)); + updateMaximumArcText(getChild("MaximumARC", true), getChild("MaximumARCText", true)); } void LLFloaterPreference::onCommitWindowedMode() @@ -1731,8 +1731,6 @@ void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_b { if (text_box == NULL || ctrl== NULL) return; - - std::string name = ctrl->getName(); // get range and points when text should change F32 value = (F32)ctrl->getValue().asReal(); @@ -1756,35 +1754,43 @@ void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_b { text_box->setText(LLTrans::getString("GraphicsQualityHigh")); } +} + +void LLFloaterPreference::updateMaximumArcText(LLSliderCtrl* ctrl, LLTextBox* text_box) +{ + F32 min_result = 20000.0f; + F32 max_result = 300000.0f; - if ("MaximumARC" == name) + F32 value = (F32)ctrl->getValue().asReal(); + + if (0.0f == value) + { + text_box->setText(LLTrans::getString("Off")); + } + else { - F32 control_value = value; - if (0.0f == control_value) - { - text_box->setText(LLTrans::getString("Off")); - } - else - { - // 100 is the maximum value of this control set in panel_preferences_graphics1.xml - F32 minp = 0.0f; - F32 maxp = 100.0f; - // The result should be between 20,000 and 500,000 - F32 minv = log(20000.0f); - F32 maxv = log(500000.0f); + // Invert value because a higher value on the slider control needs a decreasing final + // value in order to obtain larger numbers of imposters + value = 100.0f - value; - // calculate adjustment factor - F32 scale = (maxv - minv) / (maxp - minp); + // 100 is the maximum value of this control set in panel_preferences_graphics1.xml + F32 minp = 0.0f; + F32 maxp = 99.0f; - control_value = exp(minv + scale * (control_value - minp)); + // The result should be between min_result and max_result + F32 minv = log(min_result); + F32 maxv = log(max_result); - // Invert result - control_value = 500000.0f - control_value; - } + // calculate adjustment factor + F32 scale = (maxv - minv) / (maxp - minp); - gSavedSettings.setU32("RenderAutoMuteRenderWeightLimit", (U32)control_value); + value = exp(minv + scale * (value - minp)); + + text_box->setText(llformat("%0.0f", value)); } + + gSavedSettings.setU32("RenderAutoMuteRenderWeightLimit", (U32)value); } void LLFloaterPreference::onChangeMaturity() diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index f6b5f5229d..98b05cca03 100755 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -157,6 +157,7 @@ public: void onChangeQuality(const LLSD& data); void updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box); + void updateMaximumArcText(LLSliderCtrl* ctrl, LLTextBox* text_box); void refreshUI(); void onCommitParcelMediaAutoPlayEnable(); diff --git a/indra/newview/llpanelnearbymedia.cpp b/indra/newview/llpanelnearbymedia.cpp index 1cdd1b664e..737ae2e32d 100755 --- a/indra/newview/llpanelnearbymedia.cpp +++ b/indra/newview/llpanelnearbymedia.cpp @@ -65,6 +65,9 @@ extern LLControlGroup gSavedSettings; static const LLUUID PARCEL_MEDIA_LIST_ITEM_UUID = LLUUID("CAB5920F-E484-4233-8621-384CF373A321"); static const LLUUID PARCEL_AUDIO_LIST_ITEM_UUID = LLUUID("DF4B020D-8A24-4B95-AB5D-CA970D694822"); +const F32 AUTO_CLOSE_FADE_TIME_START= 2.0f; +const F32 AUTO_CLOSE_FADE_TIME_END = 3.0f; + // // LLPanelNearByMedia // @@ -227,9 +230,6 @@ void LLPanelNearByMedia::reshape(S32 width, S32 height, BOOL called_from_parent) } -const F32 AUTO_CLOSE_FADE_TIME_START= 4.0f; -const F32 AUTO_CLOSE_FADE_TIME_END = 5.0f; - /*virtual*/ void LLPanelNearByMedia::draw() { diff --git a/indra/newview/llpanelpresetspulldown.cpp b/indra/newview/llpanelpresetspulldown.cpp index 4756f3bd75..66f2f4c3f3 100644 --- a/indra/newview/llpanelpresetspulldown.cpp +++ b/indra/newview/llpanelpresetspulldown.cpp @@ -39,8 +39,8 @@ #include "llsliderctrl.h" #include "llscrolllistctrl.h" -/* static */ const F32 LLPanelPresetsPulldown::sAutoCloseFadeStartTimeSec = 4.0f; -/* static */ const F32 LLPanelPresetsPulldown::sAutoCloseTotalTimeSec = 5.0f; +/* static */ const F32 LLPanelPresetsPulldown::sAutoCloseFadeStartTimeSec = 2.0f; +/* static */ const F32 LLPanelPresetsPulldown::sAutoCloseTotalTimeSec = 3.0f; ///---------------------------------------------------------------------------- /// Class LLPanelPresetsPulldown @@ -71,7 +71,7 @@ BOOL LLPanelPresetsPulldown::postBuild() void LLPanelPresetsPulldown::populatePanel() { std::string presets_dir = LLPresetsManager::getInstance()->getPresetsDir(PRESETS_GRAPHIC); - LLPresetsManager::getInstance()->loadPresetNamesFromDir(presets_dir, mPresetNames, DEFAULT_SHOW); + LLPresetsManager::getInstance()->loadPresetNamesFromDir(presets_dir, mPresetNames, DEFAULT_TOP); LLScrollListCtrl* scroll = getChild("preset_list"); @@ -91,7 +91,7 @@ void LLPanelPresetsPulldown::populatePanel() { row["columns"][1]["column"] = "icon"; row["columns"][1]["type"] = "icon"; - row["columns"][1]["value"] = "Inv_Landmark"; + row["columns"][1]["value"] = "Checkbox_On"; } scroll->addElement(row); diff --git a/indra/newview/llpanelvolumepulldown.cpp b/indra/newview/llpanelvolumepulldown.cpp index cb00f742cc..6595da235c 100755 --- a/indra/newview/llpanelvolumepulldown.cpp +++ b/indra/newview/llpanelvolumepulldown.cpp @@ -40,8 +40,8 @@ #include "llfloaterpreference.h" #include "llsliderctrl.h" -/* static */ const F32 LLPanelVolumePulldown::sAutoCloseFadeStartTimeSec = 4.0f; -/* static */ const F32 LLPanelVolumePulldown::sAutoCloseTotalTimeSec = 5.0f; +/* static */ const F32 LLPanelVolumePulldown::sAutoCloseFadeStartTimeSec = 2.0f; +/* static */ const F32 LLPanelVolumePulldown::sAutoCloseTotalTimeSec = 3.0f; ///---------------------------------------------------------------------------- /// Class LLPanelVolumePulldown diff --git a/indra/newview/llpresetsmanager.cpp b/indra/newview/llpresetsmanager.cpp index 36a82db916..67d06ff5dd 100644 --- a/indra/newview/llpresetsmanager.cpp +++ b/indra/newview/llpresetsmanager.cpp @@ -106,14 +106,8 @@ void LLPresetsManager::loadPresetNamesFromDir(const std::string& dir, preset_nam // 2 - Possibly hide the default preset if (PRESETS_DEFAULT != name) { - if (name != gSavedSettings.getString("PresetGraphicActive")) - { - mPresetNames.push_back(name); - } - else - { - mPresetNames.insert(mPresetNames.begin(), name); - } + mPresetNames.push_back(name); + } else { @@ -123,6 +117,10 @@ void LLPresetsManager::loadPresetNamesFromDir(const std::string& dir, preset_nam mPresetNames.push_back(LLTrans::getString(PRESETS_DEFAULT)); break; + case DEFAULT_TOP: + mPresetNames.push_front(LLTrans::getString(PRESETS_DEFAULT)); + break; + case DEFAULT_HIDE: default: break; diff --git a/indra/newview/llpresetsmanager.h b/indra/newview/llpresetsmanager.h index bf6a531d48..e9ed164322 100644 --- a/indra/newview/llpresetsmanager.h +++ b/indra/newview/llpresetsmanager.h @@ -40,6 +40,7 @@ static const std::string PRESETS_CAMERA = "camera"; enum EDefaultOptions { DEFAULT_SHOW, + DEFAULT_TOP, DEFAULT_HIDE // Do not display "Default" in a list }; 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 40b359eb1d..c540000489 100755 --- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml @@ -244,7 +244,6 @@ top_delta="25" width="517"> - + + + + + @@ -457,40 +471,6 @@ Low - - - - - Low - - + + + + + Low + +