diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2024-06-24 18:24:57 +0300 |
---|---|---|
committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2024-06-25 07:12:12 +0300 |
commit | 244566cc3fcde45e555011c520ed7107b591663d (patch) | |
tree | beed06a8044a2c83acdc8acb9db291904301f0a6 /indra/newview | |
parent | c13eba105f9dcdc4b946e8b5443abf9baf15b691 (diff) |
viewer#1506 The Dynamic probe checkbox wasn't working
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llpanelvolume.cpp | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index 16c38bf1f0..4e096ecc95 100644 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -151,6 +151,7 @@ bool LLPanelVolume::postBuild() { childSetCommitCallback("Reflection Probe", onCommitIsReflectionProbe, this); childSetCommitCallback("Probe Update Type", onCommitProbe, this); + childSetCommitCallback("Probe Dynamic", onCommitProbe, this); childSetCommitCallback("Probe Volume Type", onCommitProbe, this); childSetCommitCallback("Probe Ambiance", onCommitProbe, this); childSetCommitCallback("Probe Near Clip", onCommitProbe, this); @@ -412,6 +413,7 @@ void LLPanelVolume::getState( ) getChild<LLSpinCtrl>("Probe Ambiance", true)->clear(); getChild<LLSpinCtrl>("Probe Near Clip", true)->clear(); getChild<LLComboBox>("Probe Update Type", true)->clear(); + getChild<LLUICtrl>("Probe Dynamic")->setValue(false); } else { @@ -446,6 +448,7 @@ void LLPanelVolume::getState( ) getChild<LLSpinCtrl>("Probe Ambiance", true)->setValue(volobjp->getReflectionProbeAmbiance()); getChild<LLSpinCtrl>("Probe Near Clip", true)->setValue(volobjp->getReflectionProbeNearClip()); getChild<LLComboBox>("Probe Update Type", true)->setValue(update_type); + getChild<LLUICtrl>("Probe Dynamic")->setValue(volobjp->getReflectionProbeIsDynamic()); } // Animated Mesh @@ -733,6 +736,7 @@ void LLPanelVolume::clearCtrls() getChildView("Reflection Probe")->setEnabled(false);; getChildView("Probe Volume Type")->setEnabled(false); getChildView("Probe Update Type")->setEnabled(false); + getChildView("Probe Dynamic")->setEnabled(false); getChildView("Probe Ambiance")->setEnabled(false); getChildView("Probe Near Clip")->setEnabled(false); getChildView("Animated Mesh Checkbox Ctrl")->setEnabled(false); @@ -1428,15 +1432,26 @@ void LLPanelVolume::onCommitProbe(LLUICtrl* ctrl, void* userdata) volobjp->setReflectionProbeAmbiance((F32)self->getChild<LLUICtrl>("Probe Ambiance")->getValue().asReal()); volobjp->setReflectionProbeNearClip((F32)self->getChild<LLUICtrl>("Probe Near Clip")->getValue().asReal()); - std::string update_type = self->getChild<LLUICtrl>("Probe Update Type")->getValue().asString(); + bool mirrors_enabled = LLPipeline::RenderMirrors; + bool is_mirror = false; - bool is_mirror = update_type.find("Mirror") != std::string::npos; + if (mirrors_enabled) + { + std::string update_type = self->getChild<LLUICtrl>("Probe Update Type")->getValue().asString(); - self->getChildView("Probe Volume Type")->setEnabled(!is_mirror); + is_mirror = update_type.find("Mirror") != std::string::npos; - volobjp->setReflectionProbeIsDynamic(update_type.find("Dynamic") != std::string::npos); - volobjp->setReflectionProbeIsMirror(is_mirror); + volobjp->setReflectionProbeIsDynamic(update_type.find("Dynamic") != std::string::npos); + volobjp->setReflectionProbeIsMirror(is_mirror); + } + else + { + is_mirror = volobjp->getReflectionProbeIsMirror(); + bool is_dynamic = self->getChild<LLUICtrl>("Probe Dynamic")->getValue().asBoolean(); + volobjp->setReflectionProbeIsDynamic(is_dynamic); + } + self->getChildView("Probe Volume Type")->setEnabled(!is_mirror); self->getChildView("Probe Ambiance")->setEnabled(!is_mirror); self->getChildView("Probe Near Clip")->setEnabled(!is_mirror); |