Merge pull request #13682 from zfox23/MS16704_removeWearableAvatar

Fix MS16704: Remove worn Avatar/Wearable before updating
This commit is contained in:
John Conklin II 2018-07-25 12:12:50 -07:00 committed by GitHub
commit 89e7e3b938
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 37 additions and 1 deletions

View file

@ -335,7 +335,8 @@ Item {
upgradeUrl: root.upgradeUrl,
itemHref: root.itemHref,
itemType: root.itemType,
isInstalled: root.isInstalled
isInstalled: root.isInstalled,
wornEntityID: root.wornEntityID
});
}
}

View file

@ -707,6 +707,12 @@ Rectangle {
}
}
} 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) {
lightboxPopup.titleText = "Uninstall App";
lightboxPopup.bodyText = "The app that you are trying to update is installed.<br><br>" +
@ -721,6 +727,35 @@ Rectangle {
sendToScript(msg);
};
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 {
sendToScript(msg);
}