mirror of
https://github.com/JulianGro/overte.git
synced 2025-08-10 03:53:15 +02:00
Avatar support
This commit is contained in:
parent
5a8b8d4ac8
commit
b8fb08dc74
2 changed files with 12 additions and 5 deletions
|
@ -40,8 +40,9 @@ Rectangle {
|
||||||
property bool isCertified;
|
property bool isCertified;
|
||||||
property string itemType;
|
property string itemType;
|
||||||
property var itemTypesArray: ["entity", "wearable", "contentSet", "app", "avatar"];
|
property var itemTypesArray: ["entity", "wearable", "contentSet", "app", "avatar"];
|
||||||
property var buttonTextNormal: ["REZ IT", "WEAR IT", "REPLACE CONTENT SET", "INSTALL IT", "WEAR IT"];
|
property var itemTypesText: ["entity", "wearable", "content set", "app", "avatar"];
|
||||||
property var buttonTextClicked: ["REZZED", "WORN", "CONTENT SET REPLACED!", "INSTALLED", "WORN"]
|
property var buttonTextNormal: ["REZ", "WEAR", "REPLACE CONTENT SET", "INSTALL", "WEAR"];
|
||||||
|
property var buttonTextClicked: ["REZZED!", "WORN!", "CONTENT SET REPLACED!", "INSTALLED!", "AVATAR CHANGED!"]
|
||||||
property var buttonGlyph: [hifi.glyphs.wand, hifi.glyphs.hat, hifi.glyphs.globe, hifi.glyphs.install, hifi.glyphs.avatar];
|
property var buttonGlyph: [hifi.glyphs.wand, hifi.glyphs.hat, hifi.glyphs.globe, hifi.glyphs.install, hifi.glyphs.avatar];
|
||||||
property bool shouldBuyWithControlledFailure: false;
|
property bool shouldBuyWithControlledFailure: false;
|
||||||
property bool debugCheckoutSuccess: false;
|
property bool debugCheckoutSuccess: false;
|
||||||
|
@ -529,6 +530,7 @@ Rectangle {
|
||||||
// "Buy" button
|
// "Buy" button
|
||||||
HifiControlsUit.Button {
|
HifiControlsUit.Button {
|
||||||
id: buyButton;
|
id: buyButton;
|
||||||
|
visible: !(root.itemType === "avatar" && viewInMyPurchasesButton.visible)
|
||||||
enabled: (root.balanceAfterPurchase >= 0 && ownershipStatusReceived && balanceReceived) || (!root.isCertified);
|
enabled: (root.balanceAfterPurchase >= 0 && ownershipStatusReceived && balanceReceived) || (!root.isCertified);
|
||||||
color: viewInMyPurchasesButton.visible ? hifi.buttons.white : hifi.buttons.blue;
|
color: viewInMyPurchasesButton.visible ? hifi.buttons.white : hifi.buttons.blue;
|
||||||
colorScheme: hifi.colorSchemes.light;
|
colorScheme: hifi.colorSchemes.light;
|
||||||
|
@ -576,7 +578,7 @@ Rectangle {
|
||||||
id: cancelPurchaseButton;
|
id: cancelPurchaseButton;
|
||||||
color: hifi.buttons.noneBorderlessGray;
|
color: hifi.buttons.noneBorderlessGray;
|
||||||
colorScheme: hifi.colorSchemes.light;
|
colorScheme: hifi.colorSchemes.light;
|
||||||
anchors.top: buyButton.bottom;
|
anchors.top: buyButton.visible ? buyButton.bottom : viewInMyPurchasesButton.bottom;
|
||||||
anchors.topMargin: 16;
|
anchors.topMargin: 16;
|
||||||
height: 40;
|
height: 40;
|
||||||
anchors.left: parent.left;
|
anchors.left: parent.left;
|
||||||
|
@ -622,8 +624,9 @@ Rectangle {
|
||||||
|
|
||||||
RalewaySemiBold {
|
RalewaySemiBold {
|
||||||
id: completeText2;
|
id: completeText2;
|
||||||
text: "The item " + '<font color="' + hifi.colors.blueAccent + '"><a href="#">' + root.itemName + '</a></font>' +
|
text: "The " + (root.itemTypesText)[itemTypesArray.indexOf(root.itemType)] +
|
||||||
" has been added to your Purchases and a receipt will appear in your Wallet's transaction history.";
|
'<font color="' + hifi.colors.blueAccent + '"><a href="#">' + root.itemName + '</a></font>' +
|
||||||
|
" has been added to your Purchases and a receipt will appear in your Wallet's transaction history.";
|
||||||
// Text size
|
// Text size
|
||||||
size: 20;
|
size: 20;
|
||||||
// Anchors
|
// Anchors
|
||||||
|
@ -701,6 +704,8 @@ Rectangle {
|
||||||
"root.visible = false;rezzedNotifContainer.visible = true; rezzedNotifContainerTimer.start();" +
|
"root.visible = false;rezzedNotifContainer.visible = true; rezzedNotifContainerTimer.start();" +
|
||||||
"UserActivityLogger.commerceEntityRezzed('" + root.itemId + "', 'checkout', '" + root.itemType + "');";
|
"UserActivityLogger.commerceEntityRezzed('" + root.itemId + "', 'checkout', '" + root.itemType + "');";
|
||||||
lightboxPopup.visible = true;
|
lightboxPopup.visible = true;
|
||||||
|
} else if (root.itemType === "avatar") {
|
||||||
|
Avatar.skeletonModelURL = root.itemHref;
|
||||||
} else {
|
} else {
|
||||||
sendToScript({method: 'checkout_rezClicked', itemHref: root.itemHref, itemType: root.itemType});
|
sendToScript({method: 'checkout_rezClicked', itemHref: root.itemHref, itemType: root.itemType});
|
||||||
rezzedNotifContainer.visible = true;
|
rezzedNotifContainer.visible = true;
|
||||||
|
|
|
@ -476,6 +476,8 @@ Item {
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (root.itemType === "contentSet") {
|
if (root.itemType === "contentSet") {
|
||||||
sendToPurchases({method: 'showReplaceContentLightbox', itemId: root.itemId, itemHref: root.itemHref});
|
sendToPurchases({method: 'showReplaceContentLightbox', itemId: root.itemId, itemHref: root.itemHref});
|
||||||
|
} else if (root.itemType === "avatar") {
|
||||||
|
Avatar.skeletonModelURL = root.itemHref;
|
||||||
} else {
|
} else {
|
||||||
sendToPurchases({method: 'purchases_rezClicked', itemHref: root.itemHref, itemType: root.itemType});
|
sendToPurchases({method: 'purchases_rezClicked', itemHref: root.itemHref, itemType: root.itemType});
|
||||||
root.showConfirmation = true;
|
root.showConfirmation = true;
|
||||||
|
|
Loading…
Reference in a new issue