mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-14 05:26:32 +02:00
Un-wear things when trashing them if worn
This commit is contained in:
parent
46e00cf1b3
commit
d0998174ff
2 changed files with 32 additions and 8 deletions
|
@ -313,6 +313,10 @@ Item {
|
|||
Commerce.uninstallApp(root.itemHref);
|
||||
}
|
||||
}
|
||||
|
||||
onVisibleChanged: {
|
||||
trashButton.updateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
|
@ -342,6 +346,10 @@ Item {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
onVisibleChanged: {
|
||||
trashButton.updateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
|
@ -355,6 +363,20 @@ Item {
|
|||
|
||||
onLoaded: {
|
||||
item.buttonGlyphText = hifi.glyphs.trash;
|
||||
updateProperties();
|
||||
item.buttonClicked = function() {
|
||||
sendToPurchases({method: 'showTrashLightbox',
|
||||
isInstalled: root.isInstalled,
|
||||
itemHref: root.itemHref,
|
||||
itemName: root.itemName,
|
||||
certID: root.certificateId,
|
||||
itemType: root.itemType,
|
||||
wornEntityID: root.wornEntityID
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function updateProperties() {
|
||||
if (updateButton.visible && uninstallButton.visible) {
|
||||
item.buttonText = "";
|
||||
item.glyphSize = 20;
|
||||
|
@ -362,14 +384,6 @@ Item {
|
|||
item.buttonText = "Send to Trash";
|
||||
item.glyphSize = 30;
|
||||
}
|
||||
item.buttonClicked = function() {
|
||||
sendToPurchases({method: 'showTrashLightbox',
|
||||
isInstalled: root.isInstalled,
|
||||
itemHref: root.itemHref,
|
||||
itemName: root.itemName,
|
||||
certID: root.certificateId
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -664,6 +664,16 @@ Rectangle {
|
|||
if (msg.isInstalled) {
|
||||
Commerce.uninstallApp(msg.itemHref);
|
||||
}
|
||||
|
||||
if (MyAvatar.skeletonModelURL === msg.itemHref) {
|
||||
MyAvatar.useFullAvatarURL('');
|
||||
}
|
||||
|
||||
if (msg.itemType === "wearable" && msg.wornEntityID !== '') {
|
||||
Entities.deleteEntity(msg.wornEntityID);
|
||||
purchasesModel.setProperty(index, 'wornEntityID', '');
|
||||
}
|
||||
|
||||
Commerce.transferAssetToUsername("trashbot", msg.certID, 1, "Sent " + msg.itemName + " to trash.");
|
||||
|
||||
lightboxPopup.titleText = '"' + msg.itemName + '" Sent to Trash';
|
||||
|
|
Loading…
Reference in a new issue