diff options
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/newview/llfloaterenvironmentadjust.cpp | 24 | 
1 files changed, 13 insertions, 11 deletions
| diff --git a/indra/newview/llfloaterenvironmentadjust.cpp b/indra/newview/llfloaterenvironmentadjust.cpp index b137d71c22..58616995d3 100644 --- a/indra/newview/llfloaterenvironmentadjust.cpp +++ b/indra/newview/llfloaterenvironmentadjust.cpp @@ -455,26 +455,28 @@ void LLFloaterEnvironmentAdjust::onMoonAzimElevChanged()  void LLFloaterEnvironmentAdjust::onCloudMapChanged()  {      if (!mLiveSky) +    {          return; +    } -    // Get the texture picker control      LLTextureCtrl* picker_ctrl = getChild<LLTextureCtrl>(FIELD_SKY_CLOUD_MAP); -    if (!picker_ctrl) + +    LLUUID new_texture_id = picker_ctrl->getValue().asUUID(); + +    LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); + +    LLSettingsSky::ptr_t sky_to_set = mLiveSky->buildClone(); +    if (!sky_to_set)      { -         // Optional: Log an error if the control isn't found, though unlikely -         return; +        return;      } -    // Get the new texture ID selected by the user -    LLUUID new_texture_id = picker_ctrl->getValue().asUUID(); +    sky_to_set->setCloudNoiseTextureId(new_texture_id); -    // Update the internal sky settings object -    mLiveSky->setCloudNoiseTextureId(new_texture_id); +    LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, sky_to_set); -    // Trigger the update for the sky rendering -    mLiveSky->update(); +    LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_INSTANT, true); -    // Explicitly refresh the UI picker control to match the applied change      picker_ctrl->setValue(new_texture_id);  } | 
