summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelvolume.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2021-11-16 01:21:05 +0200
committerAndrey Lihatskiy <alihatskiy@productengine.com>2021-11-16 01:21:05 +0200
commit0bffd3d365023fea504b1070480e7b2f72080129 (patch)
treee11a931c690abe94ca1d7201a9375ea2ed8e1158 /indra/newview/llpanelvolume.cpp
parent3c2ccd879cb59ac0fdcacfab1fe68bc4dcefc68b (diff)
parent9957c28ddc5e5c129af2db662da7d69f1509af65 (diff)
Merge branch 'master' into DRTVWR-519
# Conflicts: # README.md
Diffstat (limited to 'indra/newview/llpanelvolume.cpp')
-rw-r--r--indra/newview/llpanelvolume.cpp26
1 files changed, 21 insertions, 5 deletions
diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp
index 05d9346f89..89c558e4f8 100644
--- a/indra/newview/llpanelvolume.cpp
+++ b/indra/newview/llpanelvolume.cpp
@@ -50,6 +50,7 @@
//#include "llfirstuse.h"
#include "llfocusmgr.h"
#include "llmanipscale.h"
+#include "llinventorymodel.h"
#include "llpreviewscript.h"
#include "llresmgr.h"
#include "llselectmgr.h"
@@ -57,6 +58,7 @@
#include "lltextbox.h"
#include "lltool.h"
#include "lltoolcomp.h"
+#include "lltooldraganddrop.h"
#include "lltoolmgr.h"
#include "lltrans.h"
#include "llui.h"
@@ -780,7 +782,7 @@ void LLPanelVolume::onLightCancelTexture(const LLSD& data)
// selection of "None" texture.
LLUUID tex_id = LightTextureCtrl->getImageAssetID();
bool is_spotlight = volobjp->isLightSpotlight();
- volobjp->setLightTextureID(tex_id); //updates spotlight
+ setLightTextureID(tex_id, LightTextureCtrl->getImageItemID(), volobjp); //updates spotlight
if (!is_spotlight && tex_id.notNull())
{
@@ -825,7 +827,7 @@ void LLPanelVolume::onLightSelectTexture(const LLSD& data)
if(LightTextureCtrl)
{
LLUUID id = LightTextureCtrl->getImageAssetID();
- volobjp->setLightTextureID(id);
+ setLightTextureID(id, LightTextureCtrl->getImageItemID(), volobjp);
}
}
@@ -888,11 +890,12 @@ void LLPanelVolume::onCommitLight( LLUICtrl* ctrl, void* userdata )
if(LightTextureCtrl)
{
LLUUID id = LightTextureCtrl->getImageAssetID();
+ LLUUID item_id = LightTextureCtrl->getImageItemID();
if (id.notNull())
{
if (!volobjp->isLightSpotlight())
{ //this commit is making this a spot light, set UI to default params
- volobjp->setLightTextureID(id);
+ setLightTextureID(id, item_id, volobjp);
LLVector3 spot_params = volobjp->getSpotLightParams();
self->getChild<LLUICtrl>("Light FOV")->setValue(spot_params.mV[0]);
self->getChild<LLUICtrl>("Light Focus")->setValue(spot_params.mV[1]);
@@ -902,7 +905,7 @@ void LLPanelVolume::onCommitLight( LLUICtrl* ctrl, void* userdata )
{ //modifying existing params, this time volobjp won't change params on its own.
if (volobjp->getLightTextureID() != id)
{
- volobjp->setLightTextureID(id);
+ setLightTextureID(id, item_id, volobjp);
}
LLVector3 spot_params;
@@ -914,7 +917,7 @@ void LLPanelVolume::onCommitLight( LLUICtrl* ctrl, void* userdata )
}
else if (volobjp->isLightSpotlight())
{ //no longer a spot light
- volobjp->setLightTextureID(id);
+ setLightTextureID(id, item_id, volobjp);
//self->getChildView("Light FOV")->setEnabled(FALSE);
//self->getChildView("Light Focus")->setEnabled(FALSE);
//self->getChildView("Light Ambiance")->setEnabled(FALSE);
@@ -931,6 +934,19 @@ void LLPanelVolume::onCommitIsLight( LLUICtrl* ctrl, void* userdata )
self->sendIsLight();
}
+// static
+void LLPanelVolume::setLightTextureID(const LLUUID &asset_id, const LLUUID &item_id, LLVOVolume* volobjp)
+{
+ if (volobjp)
+ {
+ LLViewerInventoryItem* item = gInventory.getItem(item_id);
+ if (item && !item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID()))
+ {
+ LLToolDragAndDrop::handleDropTextureProtections(volobjp, item, LLToolDragAndDrop::SOURCE_AGENT, LLUUID::null);
+ }
+ volobjp->setLightTextureID(asset_id);
+ }
+}
//----------------------------------------------------------------------------
// static