From 384ce96d60912b707d475a534c10096043d0308b Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 3 Dec 2015 17:59:23 +0200 Subject: MAINT-1274 FIXED Light texture picker snaps back to initial choice --- indra/newview/llpanelvolume.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpanelvolume.cpp') diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index f1f87e212d..7405f88fe7 100755 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -821,7 +821,12 @@ void LLPanelVolume::onCommitLight( LLUICtrl* ctrl, void* userdata ) self->getChild("Light Ambiance")->setValue(spot_params.mV[2]); } else - { //modifying existing params + { //modifying existing params, this time volobjp won't change params on its own. + if (volobjp->getLightTextureID() != id) + { + volobjp->setLightTextureID(id); + } + LLVector3 spot_params; spot_params.mV[0] = (F32) self->getChild("Light FOV")->getValue().asReal(); spot_params.mV[1] = (F32) self->getChild("Light Focus")->getValue().asReal(); -- cgit v1.2.3 From 91b4e9b24bd69ba1fe51dffc8c5148d5451ded6d Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 3 Dec 2015 21:58:42 +0200 Subject: MAINT-1274 FIXED Cancel in Light Texture Picker does not reverts texture. --- indra/newview/llpanelvolume.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'indra/newview/llpanelvolume.cpp') diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index 7405f88fe7..c9f8683e0e 100755 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -713,7 +713,7 @@ void LLPanelVolume::onLightCancelTexture(const LLSD& data) if (LightTextureCtrl) { - LightTextureCtrl->setImageAssetID(LLUUID::null); + LightTextureCtrl->setImageAssetID(mLightSavedTexture); } LLVOVolume *volobjp = (LLVOVolume *) mObject.get(); @@ -722,7 +722,16 @@ void LLPanelVolume::onLightCancelTexture(const LLSD& data) // Cancel the light texture as requested // NORSPEC-292 // - volobjp->setLightTextureID(LLUUID::null); + bool is_spotlight = volobjp->isLightSpotlight(); + volobjp->setLightTextureID(mLightSavedTexture); //updates spotlight + + if (!is_spotlight && mLightSavedTexture.notNull()) + { + LLVector3 spot_params = volobjp->getSpotLightParams(); + getChild("Light FOV")->setValue(spot_params.mV[0]); + getChild("Light Focus")->setValue(spot_params.mV[1]); + getChild("Light Ambiance")->setValue(spot_params.mV[2]); + } } } -- cgit v1.2.3