STORM-2082 Assorted UI tweaks, better MaximumARC formula, pulldowns disappear faster

meow-7.2.2
Jonathan Yap 2015-01-14 19:55:58 -05:00
parent f6a1980c25
commit d1bc2fe292
8 changed files with 102 additions and 82 deletions

View File

@ -1475,7 +1475,7 @@ void LLFloaterPreference::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));
updateSliderText(getChild<LLSliderCtrl>("MaximumARC", true), getChild<LLTextBox>("MaximumARCText", true));
updateMaximumArcText(getChild<LLSliderCtrl>("MaximumARC", true), getChild<LLTextBox>("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"));
}
}
if ("MaximumARC" == name)
void LLFloaterPreference::updateMaximumArcText(LLSliderCtrl* ctrl, LLTextBox* text_box)
{
F32 min_result = 20000.0f;
F32 max_result = 300000.0f;
F32 value = (F32)ctrl->getValue().asReal();
if (0.0f == value)
{
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);
// calculate adjustment factor
F32 scale = (maxv - minv) / (maxp - minp);
control_value = exp(minv + scale * (control_value - minp));
// Invert result
control_value = 500000.0f - control_value;
}
gSavedSettings.setU32("RenderAutoMuteRenderWeightLimit", (U32)control_value);
text_box->setText(LLTrans::getString("Off"));
}
else
{
// 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;
// 100 is the maximum value of this control set in panel_preferences_graphics1.xml
F32 minp = 0.0f;
F32 maxp = 99.0f;
// The result should be between min_result and max_result
F32 minv = log(min_result);
F32 maxv = log(max_result);
// calculate adjustment factor
F32 scale = (maxv - minv) / (maxp - minp);
value = exp(minv + scale * (value - minp));
text_box->setText(llformat("%0.0f", value));
}
gSavedSettings.setU32("RenderAutoMuteRenderWeightLimit", (U32)value);
}
void LLFloaterPreference::onChangeMaturity()

View File

@ -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();

View File

@ -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()
{

View File

@ -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<LLScrollListCtrl>("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);

View File

@ -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

View File

@ -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;

View File

@ -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
};

View File

@ -244,7 +244,6 @@
top_delta="25"
width="517">
<!-- This block shows Basic Settings -->
<panel
border="false"
@ -316,19 +315,34 @@
Low
</text>
<check_box
control_name="WindLightUseAtmosShaders"
height="16"
initial_value="true"
label="Atmospheric shaders"
layout="topleft"
left="30"
name="WindLightUseAtmosShaders"
top_delta="20"
width="280">
<check_box.commit_callback
function="Pref.VertexShaderEnable" />
</check_box>
<check_box
control_name="RenderDeferred"
height="16"
initial_value="true"
label="Advanced Lighting Model"
layout="topleft"
left="30"
left="50"
name="UseLightShaders2"
top_delta="20"
width="256">
<check_box.commit_callback
function="Pref.VertexShaderEnable" />
</check_box>
</panel>
<!-- End of Basic Settings block -->
@ -457,40 +471,6 @@
Low
</text>
<slider
control_name="RenderTerrainDetail"
follows="left|top"
height="16"
label="Terrain Detail:"
label_width="185"
layout="topleft"
left="30"
show_text="false"
initial_value="0"
increment="1"
min_val="0"
max_val="1"
name="TerrainDetail"
top_delta="16"
width="300" >
<slider.commit_callback
function="Pref.UpdateSliderText"
parameter="TerrainDetail" />
</slider>
<text
type="string"
length="1"
follows="left|top"
height="16"
layout="topleft"
top_delta="0"
left_delta="304"
name="TerrainDetailText"
text_readonly_color="LabelDisabledColor"
width="128">
Low
</text>
<text
type="string"
length="1"
@ -691,6 +671,40 @@
function="Pref.VertexShaderEnable" />
</check_box>
<slider
control_name="RenderTerrainDetail"
follows="left|top"
height="16"
label="Terrain Detail:"
label_width="165"
layout="topleft"
left="50"
show_text="false"
initial_value="0"
increment="1"
min_val="0"
max_val="1"
name="TerrainDetail"
top_delta="16"
width="280" >
<slider.commit_callback
function="Pref.UpdateSliderText"
parameter="TerrainDetail" />
</slider>
<text
type="string"
length="1"
follows="left|top"
height="16"
layout="topleft"
top_delta="0"
left_delta="284"
name="TerrainDetailText"
text_readonly_color="LabelDisabledColor"
width="128">
Low
</text>
<check_box
control_name="RenderAvatarVP"
height="16"