mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 05:37:17 +02:00
Various fixes
This commit is contained in:
parent
18aa95e0bb
commit
0b810c3aa8
3 changed files with 29 additions and 21 deletions
|
@ -31,6 +31,7 @@ Rectangle {
|
||||||
property bool ownershipStatusReceived: false;
|
property bool ownershipStatusReceived: false;
|
||||||
property bool balanceReceived: false;
|
property bool balanceReceived: false;
|
||||||
property bool availableUpdatesReceived: false;
|
property bool availableUpdatesReceived: false;
|
||||||
|
property string baseItemName: "";
|
||||||
property string itemName;
|
property string itemName;
|
||||||
property string itemId;
|
property string itemId;
|
||||||
property string itemHref;
|
property string itemHref;
|
||||||
|
@ -148,6 +149,7 @@ Rectangle {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
root.isUpdating = true;
|
root.isUpdating = true;
|
||||||
|
root.baseItemName = result.data.updates[i].base_item_title;
|
||||||
// This CertID is the one corresponding to the base item CertID that the user already owns
|
// This CertID is the one corresponding to the base item CertID that the user already owns
|
||||||
root.certificateId = result.data.updates[i].certificate_id;
|
root.certificateId = result.data.updates[i].certificate_id;
|
||||||
if (root.itemType === "app") {
|
if (root.itemType === "app") {
|
||||||
|
@ -460,7 +462,7 @@ Rectangle {
|
||||||
// "HFC" balance label
|
// "HFC" balance label
|
||||||
HiFiGlyphs {
|
HiFiGlyphs {
|
||||||
id: itemPriceTextLabel;
|
id: itemPriceTextLabel;
|
||||||
visible: !root.isUpdating;
|
visible: !(root.isUpdating && root.itemEdition > 0);
|
||||||
text: hifi.glyphs.hfc;
|
text: hifi.glyphs.hfc;
|
||||||
// Size
|
// Size
|
||||||
size: 30;
|
size: 30;
|
||||||
|
@ -476,9 +478,9 @@ Rectangle {
|
||||||
}
|
}
|
||||||
FiraSansSemiBold {
|
FiraSansSemiBold {
|
||||||
id: itemPriceText;
|
id: itemPriceText;
|
||||||
text: root.isUpdating ? "FREE\nUPGRADE" : ((root.itemPrice === -1) ? "--" : root.itemPrice);
|
text: (root.isUpdating && root.itemEdition > 0) ? "FREE\nUPDATE" : ((root.itemPrice === -1) ? "--" : root.itemPrice);
|
||||||
// Text size
|
// Text size
|
||||||
size: root.isUpdating ? 20 : 26;
|
size: (root.isUpdating && root.itemEdition > 0) ? 20 : 26;
|
||||||
// Anchors
|
// Anchors
|
||||||
anchors.top: parent.top;
|
anchors.top: parent.top;
|
||||||
anchors.right: parent.right;
|
anchors.right: parent.right;
|
||||||
|
@ -578,9 +580,13 @@ Rectangle {
|
||||||
height: 50;
|
height: 50;
|
||||||
anchors.left: parent.left;
|
anchors.left: parent.left;
|
||||||
anchors.right: parent.right;
|
anchors.right: parent.right;
|
||||||
text: "VIEW THIS ITEM IN MY PURCHASES";
|
text: root.isUpdating ? "UPDATE TO THIS ITEM FOR FREE" : "VIEW THIS ITEM IN MY PURCHASES";
|
||||||
onClicked: {
|
onClicked: {
|
||||||
sendToScript({method: 'checkout_goToPurchases', filterText: root.itemName});
|
if (root.isUpdating) {
|
||||||
|
sendToScript({method: 'checkout_goToPurchases', filterText: root.baseItemName});
|
||||||
|
} else {
|
||||||
|
sendToScript({method: 'checkout_goToPurchases', filterText: root.itemName});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -597,15 +603,17 @@ Rectangle {
|
||||||
height: 50;
|
height: 50;
|
||||||
anchors.left: parent.left;
|
anchors.left: parent.left;
|
||||||
anchors.right: parent.right;
|
anchors.right: parent.right;
|
||||||
text: root.isUpdating ? "CONFIRM UPDATE" : (((root.isCertified) ? ((ownershipStatusReceived && balanceReceived && availableUpdatesReceived) ?
|
text: (root.isUpdating && root.itemEdition > 0) ? "CONFIRM UPDATE" : (((root.isCertified) ? ((ownershipStatusReceived && balanceReceived && availableUpdatesReceived) ?
|
||||||
(viewInMyPurchasesButton.visible ? "Buy It Again" : "Confirm Purchase") : "--") : "Get Item"));
|
((viewInMyPurchasesButton.visible && !root.isUpdating) ? "Buy It Again" : "Confirm Purchase") : "--") : "Get Item"));
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (root.isUpdating) {
|
if (root.isUpdating && root.itemEdition > 0) {
|
||||||
// If we're updating an app, the existing app needs to be uninstalled.
|
// If we're updating an app, the existing app needs to be uninstalled.
|
||||||
// This call will fail/return `false` if the app isn't installed, but that's OK.
|
// This call will fail/return `false` if the app isn't installed, but that's OK.
|
||||||
if (root.itemType === "app") {
|
if (root.itemType === "app") {
|
||||||
Commerce.uninstallApp(root.baseAppURL);
|
Commerce.uninstallApp(root.baseAppURL);
|
||||||
}
|
}
|
||||||
|
buyButton.enabled = false;
|
||||||
|
loading.visible = true;
|
||||||
Commerce.updateItem(root.certificateId);
|
Commerce.updateItem(root.certificateId);
|
||||||
} else if (root.isCertified) {
|
} else if (root.isCertified) {
|
||||||
if (!root.shouldBuyWithControlledFailure) {
|
if (!root.shouldBuyWithControlledFailure) {
|
||||||
|
@ -1124,7 +1132,6 @@ Rectangle {
|
||||||
buyTextContainer.border.color = "#FFFFFF";
|
buyTextContainer.border.color = "#FFFFFF";
|
||||||
// Else if the user HAS NOT selected a specific edition to update...
|
// Else if the user HAS NOT selected a specific edition to update...
|
||||||
} else {
|
} else {
|
||||||
viewInMyPurchasesButton.text = "UPDATE TO THIS ITEM FOR FREE";
|
|
||||||
viewInMyPurchasesButton.visible = true;
|
viewInMyPurchasesButton.visible = true;
|
||||||
|
|
||||||
handleBuyAgainLogic();
|
handleBuyAgainLogic();
|
||||||
|
@ -1133,7 +1140,6 @@ Rectangle {
|
||||||
// (i.e. they are checking out an item "normally")
|
// (i.e. they are checking out an item "normally")
|
||||||
} else {
|
} else {
|
||||||
if (root.alreadyOwned) {
|
if (root.alreadyOwned) {
|
||||||
viewInMyPurchasesButton.text = "VIEW IN MY PURCHASES";
|
|
||||||
viewInMyPurchasesButton.visible = true;
|
viewInMyPurchasesButton.visible = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -119,17 +119,6 @@ Item {
|
||||||
anchors.right: securityImage.left;
|
anchors.right: securityImage.left;
|
||||||
anchors.rightMargin: 6;
|
anchors.rightMargin: 6;
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: messagesWaitingLight;
|
|
||||||
visible: root.messagesWaiting;
|
|
||||||
anchors.right: myPurchasesLink.left;
|
|
||||||
anchors.verticalCenter: parent.verticalCenter;
|
|
||||||
height: 10;
|
|
||||||
width: height;
|
|
||||||
radius: height/2;
|
|
||||||
color: "red";
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: myPurchasesLink;
|
id: myPurchasesLink;
|
||||||
anchors.right: myUsernameButton.left;
|
anchors.right: myUsernameButton.left;
|
||||||
|
@ -162,6 +151,18 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: messagesWaitingLight;
|
||||||
|
visible: root.messagesWaiting;
|
||||||
|
anchors.right: myPurchasesLink.left;
|
||||||
|
anchors.rightMargin: -2;
|
||||||
|
anchors.verticalCenter: parent.verticalCenter;
|
||||||
|
height: 10;
|
||||||
|
width: height;
|
||||||
|
radius: height/2;
|
||||||
|
color: "red";
|
||||||
|
}
|
||||||
|
|
||||||
TextMetrics {
|
TextMetrics {
|
||||||
id: textMetrics;
|
id: textMetrics;
|
||||||
font.family: "Raleway"
|
font.family: "Raleway"
|
||||||
|
|
|
@ -582,6 +582,7 @@ Rectangle {
|
||||||
height: 40;
|
height: 40;
|
||||||
text: "SHOW ME";
|
text: "SHOW ME";
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
filterBar.text = "";
|
||||||
filterBar.changeFilterByDisplayName("Updatable");
|
filterBar.changeFilterByDisplayName("Updatable");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue