diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp
index 1ffc544900..9c0981ca7f 100644
--- a/indra/newview/lltexturectrl.cpp
+++ b/indra/newview/lltexturectrl.cpp
@@ -157,11 +157,32 @@ void LLFloaterTexturePicker::setImageID(const LLUUID& image_id, bool set_selecti
else
{
LLInventoryItem* itemp = gInventory.getItem(image_id);
- if (itemp && !itemp->getPermissions().allowCopyBy(gAgent.getID()))
+ // Texture UUID picker
+ //if (itemp && !itemp->getPermissions().allowCopyBy(gAgent.getID()))
+ if (itemp)
{
- // no copy texture
- getChild("apply_immediate_check")->setValue(FALSE);
- mNoCopyTextureSelected = TRUE;
+ BOOL copy = itemp->getPermissions().allowCopyBy(gAgent.getID());
+ BOOL mod = itemp->getPermissions().allowModifyBy(gAgent.getID());
+ BOOL xfer = itemp->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID());
+
+ if(!copy)
+ {
+ // no copy texture
+ getChild("apply_immediate_check")->setValue(FALSE);
+ mNoCopyTextureSelected = TRUE;
+ }
+
+ //Verify permissions before revealing UUID.
+ //Replicates behaviour of "Copy UUID" on inventory. If you can't copy it there, you can't copy it here.
+ if(copy&&mod&&xfer)
+ {
+ getChild("TextureKey")->setText(image_id.asString());
+ }
+ else
+ {
+ getChild("TextureKey")->setText(LLUUID::null.asString());
+ }
+ //
}
}
@@ -420,6 +441,9 @@ BOOL LLFloaterTexturePicker::postBuild()
}
getChild("Pipette")->setCommitCallback( boost::bind(&LLFloaterTexturePicker::onBtnPipette, this));
+ // UUID picker
+ childSetAction("TextureKeyApply", LLFloaterTexturePicker::onBtnApplyTexture,this);
+ //
childSetAction("Cancel", LLFloaterTexturePicker::onBtnCancel,this);
childSetAction("Select", LLFloaterTexturePicker::onBtnSelect,this);
@@ -736,6 +760,17 @@ void LLFloaterTexturePicker::onBtnRevert(void* userdata)
self->mViewModel->resetDirty();
}*/
+// UUID texture picker
+// static
+void LLFloaterTexturePicker::onBtnApplyTexture(void* userdata)
+{
+ LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
+ self->setCanApply(true, true);
+ self->setImageID(LLUUID(self->getChild("TextureKey")->getText()));
+ self->commitIfImmediateSet();
+}
+//
+
// static
void LLFloaterTexturePicker::onBtnCancel(void* userdata)
{
@@ -796,16 +831,39 @@ void LLFloaterTexturePicker::onSelectionChange(const std::dequegetPermissions().allowCopyBy(gAgent.getID()))
+ // UUID texture picker uses extra permissions, so we do all the fancy stuff here
+
+ BOOL copy = itemp->getPermissions().allowCopyBy(gAgent.getID());
+ BOOL mod = itemp->getPermissions().allowModifyBy(gAgent.getID());
+ BOOL xfer = itemp->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID());
+
+ //if (!itemp->getPermissions().allowCopyBy(gAgent.getID()))
+ if (!copy)
{
mNoCopyTextureSelected = TRUE;
}
+ //
// FIRE-8298: Apply now checkbox has no effect
setCanApply(true, true);
//
setImageID(itemp->getAssetUUID(),false);
+
+ // UUID texture picker permissions continued
+ //We also have to set this here because above passes the asset ID, not the inventory ID.
+ //Verify permissions before revealing UUID.
+ //Replicates behaviour of "Copy UUID" on inventory. If you can't copy it there, you can't copy it here.
+ if(copy&&mod&&xfer)
+ {
+ getChild("TextureKey")->setText(itemp->getAssetUUID().asString());
+ }
+ else
+ {
+ getChild("TextureKey")->setText(LLUUID::null.asString());
+ }
+ //
+
mViewModel->setDirty(); // *TODO: shouldn't we be using setValue() here?
-
+
if(!mPreviewSettingChanged)
{
mCanPreview = gSavedSettings.getBOOL("TextureLivePreview");
diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h
index 24dc42cf48..612110aa1f 100644
--- a/indra/newview/lltexturectrl.h
+++ b/indra/newview/lltexturectrl.h
@@ -319,6 +319,9 @@ public:
const LLUUID& getBlankImageAssetID() { return mBlankImageAssetID; }
static void onBtnSetToDefault(void* userdata);
+ // UUID texture picker
+ static void onBtnApplyTexture(void* userdata);
+ //
static void onBtnSelect(void* userdata);
static void onBtnCancel(void* userdata);
void onBtnPipette();
diff --git a/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml b/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml
index 2ecb8fed7d..6ce61d062b 100644
--- a/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml
+++ b/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml
@@ -3,7 +3,7 @@
legacy_header_height="18"
can_minimize="false"
can_resize="true"
- height="330"
+ height="360"
layout="topleft"
min_height="330"
min_width="410"
@@ -239,6 +239,28 @@
+
+
diff --git a/indra/newview/skins/vintage/xui/en/floater_texture_ctrl.xml b/indra/newview/skins/vintage/xui/en/floater_texture_ctrl.xml
index f0b87f24a3..56a74029d9 100644
--- a/indra/newview/skins/vintage/xui/en/floater_texture_ctrl.xml
+++ b/indra/newview/skins/vintage/xui/en/floater_texture_ctrl.xml
@@ -3,7 +3,7 @@
legacy_header_height="18"
can_minimize="false"
can_resize="true"
- height="330"
+ height="360"
layout="topleft"
min_height="330"
min_width="410"
@@ -248,6 +248,28 @@
+
+