diff options
Diffstat (limited to 'indra/newview/llselectmgr.cpp')
-rw-r--r-- | indra/newview/llselectmgr.cpp | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 5bbdeb1f98..b0a566755f 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -1936,7 +1936,7 @@ BOOL LLSelectMgr::selectionRevertTextures() return revert_successful; } -void LLSelectMgr::selectionSetBumpmap(U8 bumpmap) +void LLSelectMgr::selectionSetBumpmap(U8 bumpmap, const LLUUID &image_id) { struct f : public LLSelectedTEFunctor { @@ -1952,7 +1952,22 @@ void LLSelectMgr::selectionSetBumpmap(U8 bumpmap) return true; } } setfunc(bumpmap); - getSelection()->applyToTEs(&setfunc); + + LLViewerInventoryItem* item = gInventory.getItem(image_id); + if(item + && !item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID()) + && (mSelectedObjects->getNumNodes() > 1) ) + { + LL_WARNS() << "Attempted to apply no-copy texture to multiple objects" << LL_ENDL; + return; + } + if (item && !item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID())) + { + LLViewerObject *object = mSelectedObjects->getFirstRootObject(); + if (!object) return; + LLToolDragAndDrop::handleDropTextureProtections(object, item, LLToolDragAndDrop::SOURCE_AGENT, LLUUID::null); + } + getSelection()->applyToTEs(&setfunc); LLSelectMgrSendFunctor sendfunc; getSelection()->applyToObjects(&sendfunc); @@ -1981,7 +1996,7 @@ void LLSelectMgr::selectionSetTexGen(U8 texgen) } -void LLSelectMgr::selectionSetShiny(U8 shiny) +void LLSelectMgr::selectionSetShiny(U8 shiny, const LLUUID &image_id) { struct f : public LLSelectedTEFunctor { @@ -1997,7 +2012,22 @@ void LLSelectMgr::selectionSetShiny(U8 shiny) return true; } } setfunc(shiny); - getSelection()->applyToTEs(&setfunc); + + LLViewerInventoryItem* item = gInventory.getItem(image_id); + if(item + && !item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID()) + && (mSelectedObjects->getNumNodes() > 1) ) + { + LL_WARNS() << "Attempted to apply no-copy texture to multiple objects" << LL_ENDL; + return; + } + if (item && !item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID())) + { + LLViewerObject *object = mSelectedObjects->getFirstRootObject(); + if (!object) return; + LLToolDragAndDrop::handleDropTextureProtections(object, item, LLToolDragAndDrop::SOURCE_AGENT, LLUUID::null); + } + getSelection()->applyToTEs(&setfunc); LLSelectMgrSendFunctor sendfunc; getSelection()->applyToObjects(&sendfunc); |