diff options
author | Kadah_Coba <kadah.coba@gmail.com> | 2019-10-06 16:09:56 -0700 |
---|---|---|
committer | Kadah_Coba <kadah.coba@gmail.com> | 2019-10-06 16:09:56 -0700 |
commit | ce48cb4303c10dbc9d3044271035153569226040 (patch) | |
tree | 083078c1f71cdfabc65fbc02227568b689e11448 /indra/newview | |
parent | 733f799c4359d32778b5f345ae434152467334bc (diff) |
[Project Copy/Paste] Simplified texture copy check
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llpanelobject.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index 1a0c2c86eb..e53f03785f 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -2437,12 +2437,13 @@ bool LLPanelObject::pasteEnabletMenuItem(const LLSD& userdata) return true; } -// User is allowed to copy if they could otherwise recreate it manually -// ie. User has full perm copy of the sculpted texture in their inventory, -// or is a default texture or library asset. // Static bool LLPanelObject::canCopyTexture(LLUUID image_id) { + // User is allowed to copy a texture if: + // library asset or default texture, + // or full perm asset exists in user's inventory + // Library asset or default texture if (gInventory.isObjectDescendentOf(image_id, gInventory.getLibraryRootFolderID()) || image_id == LLUUID(gSavedSettings.getString( "DefaultObjectTexture" )) @@ -2452,8 +2453,8 @@ bool LLPanelObject::canCopyTexture(LLUUID image_id) { return true; } - - // LLUUID inventory_item_id; + + // Search for a full perm asset LLViewerInventoryCategory::cat_array_t cats; LLViewerInventoryItem::item_array_t items; LLAssetIDMatches asset_id_matches(image_id); @@ -2464,12 +2465,10 @@ bool LLPanelObject::canCopyTexture(LLUUID image_id) asset_id_matches); if (items.size()) { - // search for copyable version first for (S32 i = 0; i < items.size(); i++) { - LLInventoryItem* itemp = items[i]; - LLPermissions item_permissions = itemp->getPermissions(); - if (item_permissions.allowCopyBy(gAgent.getID())) + LLViewerInventoryItem* itemp = items[i]; + if (itemp->getIsFullPerm()) { return true; } |