diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2024-02-13 01:37:46 +0200 |
---|---|---|
committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2024-03-04 23:04:56 +0200 |
commit | 609831b5d244c52a21aef438785cd7c090d4b242 (patch) | |
tree | 335b00f605135ba60b58f45d7ccdec4c4d514c06 /indra/newview/llfloaterpreferencesgraphicsadvanced.cpp | |
parent | e160758b5c32f7b4b9622a5c25c7c53070395c7d (diff) |
secondlife/triage#59 Show 'Friends Only' rendering mode
Diffstat (limited to 'indra/newview/llfloaterpreferencesgraphicsadvanced.cpp')
-rw-r--r-- | indra/newview/llfloaterpreferencesgraphicsadvanced.cpp | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp b/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp index 77482fc75e..6741dbb7e4 100644 --- a/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp +++ b/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp @@ -51,14 +51,14 @@ LLFloaterPreferenceGraphicsAdvanced::LLFloaterPreferenceGraphicsAdvanced(const L mCommitCallbackRegistrar.add("Pref.Cancel", boost::bind(&LLFloaterPreferenceGraphicsAdvanced::onBtnCancel, this, _2)); mCommitCallbackRegistrar.add("Pref.OK", boost::bind(&LLFloaterPreferenceGraphicsAdvanced::onBtnOK, this, _2)); - - gSavedSettings.getControl("RenderAvatarMaxNonImpostors")->getSignal()->connect(boost::bind(&LLFloaterPreferenceGraphicsAdvanced::updateIndirectMaxNonImpostors, this, _2)); } LLFloaterPreferenceGraphicsAdvanced::~LLFloaterPreferenceGraphicsAdvanced() { mComplexityChangedSignal.disconnect(); + mComplexityModeChangedSignal.disconnect(); mLODFactorChangedSignal.disconnect(); + mNumImpostorsChangedSignal.disconnect(); } bool LLFloaterPreferenceGraphicsAdvanced::postBuild() @@ -78,8 +78,26 @@ bool LLFloaterPreferenceGraphicsAdvanced::postBuild() use_HiDPI->setVisible(false); #endif - mComplexityChangedSignal = gSavedSettings.getControl("RenderAvatarMaxComplexity")->getCommitSignal()->connect(boost::bind(&LLFloaterPreferenceGraphicsAdvanced::updateComplexityText, this)); - mLODFactorChangedSignal = gSavedSettings.getControl("RenderVolumeLODFactor")->getCommitSignal()->connect(boost::bind(&LLFloaterPreferenceGraphicsAdvanced::updateObjectMeshDetailText, this)); + mComplexityChangedSignal = gSavedSettings.getControl("RenderAvatarMaxComplexity")->getCommitSignal()->connect( + [this](LLControlVariable* control, const LLSD& new_val, const LLSD& old_val) + { + updateComplexityText(); + }); + mComplexityModeChangedSignal = gSavedSettings.getControl("RenderAvatarComplexityMode")->getSignal()->connect( + [this](LLControlVariable* control, const LLSD& new_val, const LLSD& old_val) + { + updateComplexityMode(new_val); + }); + mLODFactorChangedSignal = gSavedSettings.getControl("RenderVolumeLODFactor")->getCommitSignal()->connect( + [this](LLControlVariable* control, const LLSD& new_val, const LLSD& old_val) + { + updateObjectMeshDetailText(); + }); + mNumImpostorsChangedSignal = gSavedSettings.getControl("RenderAvatarMaxNonImpostors")->getSignal()->connect( + [this](LLControlVariable* control, const LLSD& new_val, const LLSD& old_val) + { + updateIndirectMaxNonImpostors(new_val); + }); return true; } @@ -144,6 +162,10 @@ void LLFloaterPreferenceGraphicsAdvanced::refresh() gSavedSettings.getU32("RenderAvatarMaxComplexity"), getChild<LLTextBox>("IndirectMaxComplexityText", true)); refreshEnabledState(); + + bool enable_complexity = gSavedSettings.getS32("RenderAvatarComplexityMode") != LLVOAvatar::AV_RENDER_ONLY_SHOW_FRIENDS; + getChild<LLSliderCtrl>("IndirectMaxComplexity")->setEnabled(enable_complexity); + getChild<LLSliderCtrl>("IndirectMaxNonImpostors")->setEnabled(enable_complexity); } void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledGraphics() @@ -159,6 +181,13 @@ void LLFloaterPreferenceGraphicsAdvanced::updateMaxComplexity() getChild<LLTextBox>("IndirectMaxComplexityText")); } +void LLFloaterPreferenceGraphicsAdvanced::updateComplexityMode(const LLSD& newvalue) +{ + bool enable_complexity = newvalue.asInteger() != LLVOAvatar::AV_RENDER_ONLY_SHOW_FRIENDS; + getChild<LLSliderCtrl>("IndirectMaxComplexity")->setEnabled(enable_complexity); + getChild<LLSliderCtrl>("IndirectMaxNonImpostors")->setEnabled(enable_complexity); +} + void LLFloaterPreferenceGraphicsAdvanced::updateComplexityText() { LLAvatarComplexityControls::setText(gSavedSettings.getU32("RenderAvatarMaxComplexity"), |