mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-22 07:20:51 +02:00
Merge pull request #13682 from zfox23/MS16704_removeWearableAvatar
Fix MS16704: Remove worn Avatar/Wearable before updating
This commit is contained in:
commit
89e7e3b938
2 changed files with 37 additions and 1 deletions
|
@ -335,7 +335,8 @@ Item {
|
||||||
upgradeUrl: root.upgradeUrl,
|
upgradeUrl: root.upgradeUrl,
|
||||||
itemHref: root.itemHref,
|
itemHref: root.itemHref,
|
||||||
itemType: root.itemType,
|
itemType: root.itemType,
|
||||||
isInstalled: root.isInstalled
|
isInstalled: root.isInstalled,
|
||||||
|
wornEntityID: root.wornEntityID
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -707,6 +707,12 @@ Rectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (msg.method === "updateItemClicked") {
|
} else if (msg.method === "updateItemClicked") {
|
||||||
|
// These three cases are very similar to the conditionals below, under
|
||||||
|
// "if msg.method === "giftAsset". They differ in their popup's wording
|
||||||
|
// and the actions to take when continuing.
|
||||||
|
// I could see an argument for DRYing up this code, but I think the
|
||||||
|
// actions are different enough now and potentially moving forward such that I'm
|
||||||
|
// OK with "somewhat repeating myself".
|
||||||
if (msg.itemType === "app" && msg.isInstalled) {
|
if (msg.itemType === "app" && msg.isInstalled) {
|
||||||
lightboxPopup.titleText = "Uninstall App";
|
lightboxPopup.titleText = "Uninstall App";
|
||||||
lightboxPopup.bodyText = "The app that you are trying to update is installed.<br><br>" +
|
lightboxPopup.bodyText = "The app that you are trying to update is installed.<br><br>" +
|
||||||
|
@ -721,6 +727,35 @@ Rectangle {
|
||||||
sendToScript(msg);
|
sendToScript(msg);
|
||||||
};
|
};
|
||||||
lightboxPopup.visible = true;
|
lightboxPopup.visible = true;
|
||||||
|
} else if (msg.itemType === "wearable" && msg.wornEntityID !== '') {
|
||||||
|
lightboxPopup.titleText = "Remove Wearable";
|
||||||
|
lightboxPopup.bodyText = "You are currently wearing the wearable that you are trying to update.<br><br>" +
|
||||||
|
"If you proceed, this wearable will be removed.";
|
||||||
|
lightboxPopup.button1text = "CANCEL";
|
||||||
|
lightboxPopup.button1method = function() {
|
||||||
|
lightboxPopup.visible = false;
|
||||||
|
}
|
||||||
|
lightboxPopup.button2text = "CONFIRM";
|
||||||
|
lightboxPopup.button2method = function() {
|
||||||
|
Entities.deleteEntity(msg.wornEntityID);
|
||||||
|
purchasesModel.setProperty(index, 'wornEntityID', '');
|
||||||
|
sendToScript(msg);
|
||||||
|
};
|
||||||
|
lightboxPopup.visible = true;
|
||||||
|
} else if (msg.itemType === "avatar" && MyAvatar.skeletonModelURL === msg.itemHref) {
|
||||||
|
lightboxPopup.titleText = "Change Avatar to Default";
|
||||||
|
lightboxPopup.bodyText = "You are currently wearing the avatar that you are trying to update.<br><br>" +
|
||||||
|
"If you proceed, your avatar will be changed to the default avatar.";
|
||||||
|
lightboxPopup.button1text = "CANCEL";
|
||||||
|
lightboxPopup.button1method = function() {
|
||||||
|
lightboxPopup.visible = false;
|
||||||
|
}
|
||||||
|
lightboxPopup.button2text = "CONFIRM";
|
||||||
|
lightboxPopup.button2method = function() {
|
||||||
|
MyAvatar.useFullAvatarURL('');
|
||||||
|
sendToScript(msg);
|
||||||
|
};
|
||||||
|
lightboxPopup.visible = true;
|
||||||
} else {
|
} else {
|
||||||
sendToScript(msg);
|
sendToScript(msg);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue