mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 14:02:57 +02:00
More progress
This commit is contained in:
parent
bdc1f7b236
commit
8d3c394d00
1 changed files with 179 additions and 87 deletions
|
@ -39,16 +39,14 @@ Rectangle {
|
||||||
id: commerce;
|
id: commerce;
|
||||||
|
|
||||||
onSecurityImageResult: {
|
onSecurityImageResult: {
|
||||||
if (!exists) { // "If security image is not set up"
|
if (!exists && root.activeView !== "notSetUp") { // "If security image is not set up"
|
||||||
if (root.activeView !== "notSetUp") {
|
root.activeView = "notSetUp";
|
||||||
notSetUp.visible = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onKeyFilePathResult: {
|
onKeyFilePathResult: {
|
||||||
if (path === "" && root.activeView !== "notSetUp") {
|
if (path === "" && root.activeView !== "notSetUp") {
|
||||||
notSetUp.visible = true;
|
root.activeView = "notSetUp";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,21 +59,22 @@ Rectangle {
|
||||||
root.activeView = "checkoutSuccess";
|
root.activeView = "checkoutSuccess";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onBalanceResult: {
|
onBalanceResult: {
|
||||||
if (result.status !== 'success') {
|
if (result.status !== 'success') {
|
||||||
console.log("Failed to get balance", result.data.message);
|
console.log("Failed to get balance", result.data.message);
|
||||||
} else {
|
} else {
|
||||||
balanceReceived = true;
|
balanceReceived = true;
|
||||||
hfcBalanceText.text = parseFloat(result.data.balance/100).toFixed(2);
|
hfcBalanceText.text = (parseFloat(result.data.balance/100).toFixed(2)) + " HFC";
|
||||||
balanceAfterPurchase = parseFloat(result.data.balance/100) - parseFloat(root.itemPriceFull/100).toFixed(2);
|
balanceAfterPurchase = parseFloat(result.data.balance/100) - parseFloat(root.itemPriceFull/100).toFixed(2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onInventoryResult: {
|
onInventoryResult: {
|
||||||
if (result.status !== 'success') {
|
if (result.status !== 'success') {
|
||||||
console.log("Failed to get inventory", result.data.message);
|
console.log("Failed to get inventory", result.data.message);
|
||||||
} else {
|
} else {
|
||||||
inventoryReceived = true;
|
inventoryReceived = true;
|
||||||
console.log('inventory fixme', JSON.stringify(result));
|
|
||||||
if (inventoryContains(result.data.assets, itemId)) {
|
if (inventoryContains(result.data.assets, itemId)) {
|
||||||
alreadyOwned = true;
|
alreadyOwned = true;
|
||||||
} else {
|
} else {
|
||||||
|
@ -139,7 +138,7 @@ Rectangle {
|
||||||
|
|
||||||
RalewayRegular {
|
RalewayRegular {
|
||||||
id: notSetUpText;
|
id: notSetUpText;
|
||||||
text: "Set up your Wallet (no credit card necessary) to claim your free <b>100 HFC</b> " +
|
text: "Set up your Wallet (no credit card necessary) to claim your <b>free HFC</b> " +
|
||||||
"and get items from the Marketplace.";
|
"and get items from the Marketplace.";
|
||||||
// Text size
|
// Text size
|
||||||
size: 18;
|
size: 18;
|
||||||
|
@ -225,18 +224,68 @@ Rectangle {
|
||||||
Item {
|
Item {
|
||||||
id: itemDescriptionContainer;
|
id: itemDescriptionContainer;
|
||||||
// Size
|
// Size
|
||||||
width: parent.width;
|
|
||||||
height: childrenRect.height + 20;
|
height: childrenRect.height + 20;
|
||||||
// Anchors
|
// Anchors
|
||||||
anchors.left: parent.left;
|
anchors.left: parent.left;
|
||||||
|
anchors.leftMargin: 32;
|
||||||
|
anchors.right: parent.right;
|
||||||
|
anchors.rightMargin: 32;
|
||||||
anchors.top: titleBarContainer.bottom;
|
anchors.top: titleBarContainer.bottom;
|
||||||
|
|
||||||
|
// HFC Balance text
|
||||||
|
Item {
|
||||||
|
id: hfcBalanceContainer;
|
||||||
|
// Anchors
|
||||||
|
anchors.top: parent.top;
|
||||||
|
anchors.topMargin: 30;
|
||||||
|
anchors.left: parent.left;
|
||||||
|
anchors.leftMargin: 16;
|
||||||
|
anchors.right: parent.right;
|
||||||
|
anchors.rightMargin: 16;
|
||||||
|
height: childrenRect.height;
|
||||||
|
|
||||||
|
RalewaySemiBold {
|
||||||
|
id: hfcBalanceTextLabel;
|
||||||
|
text: "Balance:";
|
||||||
|
// Anchors
|
||||||
|
anchors.top: parent.top;
|
||||||
|
anchors.left: parent.left;
|
||||||
|
width: paintedWidth;
|
||||||
|
height: paintedHeight;
|
||||||
|
// Text size
|
||||||
|
size: 30;
|
||||||
|
// Style
|
||||||
|
color: hifi.colors.lightGrayText;
|
||||||
|
// Alignment
|
||||||
|
horizontalAlignment: Text.AlignLeft;
|
||||||
|
verticalAlignment: Text.AlignVCenter;
|
||||||
|
}
|
||||||
|
RalewayRegular {
|
||||||
|
id: hfcBalanceText;
|
||||||
|
text: "-- HFC";
|
||||||
|
// Text size
|
||||||
|
size: hfcBalanceTextLabel.size;
|
||||||
|
// Anchors
|
||||||
|
anchors.top: parent.top;
|
||||||
|
anchors.left: hfcBalanceTextLabel.right;
|
||||||
|
anchors.leftMargin: 16;
|
||||||
|
anchors.right: parent.right;
|
||||||
|
anchors.rightMargin: 16;
|
||||||
|
height: paintedHeight;
|
||||||
|
// Style
|
||||||
|
color: hifi.colors.lightGrayText;
|
||||||
|
// Alignment
|
||||||
|
horizontalAlignment: Text.AlignRight;
|
||||||
|
verticalAlignment: Text.AlignVCenter;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Item Name text
|
// Item Name text
|
||||||
Item {
|
Item {
|
||||||
id: itemNameContainer;
|
id: itemNameContainer;
|
||||||
// Anchors
|
// Anchors
|
||||||
anchors.top: parent.top;
|
anchors.top: hfcBalanceContainer.bottom;
|
||||||
anchors.topMargin: 4;
|
anchors.topMargin: 32;
|
||||||
anchors.left: parent.left;
|
anchors.left: parent.left;
|
||||||
anchors.leftMargin: 16;
|
anchors.leftMargin: 16;
|
||||||
anchors.right: parent.right;
|
anchors.right: parent.right;
|
||||||
|
@ -245,17 +294,19 @@ Rectangle {
|
||||||
|
|
||||||
RalewaySemiBold {
|
RalewaySemiBold {
|
||||||
id: itemNameTextLabel;
|
id: itemNameTextLabel;
|
||||||
text: "Item Name:";
|
text: "Item:";
|
||||||
// Anchors
|
// Anchors
|
||||||
anchors.top: parent.top;
|
anchors.top: hfcBalanceContainer.bottom;
|
||||||
|
anchors.topMargin: 20;
|
||||||
anchors.left: parent.left;
|
anchors.left: parent.left;
|
||||||
width: paintedWidth;
|
width: paintedWidth;
|
||||||
|
height: paintedHeight;
|
||||||
// Text size
|
// Text size
|
||||||
size: 16;
|
size: 20;
|
||||||
// Style
|
// Style
|
||||||
color: hifi.colors.lightGrayText;
|
color: hifi.colors.lightGrayText;
|
||||||
// Alignment
|
// Alignment
|
||||||
horizontalAlignment: Text.AlignHLeft;
|
horizontalAlignment: Text.AlignLeft;
|
||||||
verticalAlignment: Text.AlignVCenter;
|
verticalAlignment: Text.AlignVCenter;
|
||||||
}
|
}
|
||||||
RalewayRegular {
|
RalewayRegular {
|
||||||
|
@ -266,11 +317,14 @@ Rectangle {
|
||||||
anchors.top: parent.top;
|
anchors.top: parent.top;
|
||||||
anchors.left: itemNameTextLabel.right;
|
anchors.left: itemNameTextLabel.right;
|
||||||
anchors.leftMargin: 16;
|
anchors.leftMargin: 16;
|
||||||
width: paintedWidth;
|
anchors.right: parent.right;
|
||||||
|
anchors.rightMargin: 16;
|
||||||
|
height: paintedHeight;
|
||||||
// Style
|
// Style
|
||||||
color: hifi.colors.lightGrayText;
|
color: hifi.colors.lightGrayText;
|
||||||
|
elide: Text.ElideRight;
|
||||||
// Alignment
|
// Alignment
|
||||||
horizontalAlignment: Text.AlignHLeft;
|
horizontalAlignment: Text.AlignRight;
|
||||||
verticalAlignment: Text.AlignVCenter;
|
verticalAlignment: Text.AlignVCenter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -290,17 +344,18 @@ Rectangle {
|
||||||
|
|
||||||
RalewaySemiBold {
|
RalewaySemiBold {
|
||||||
id: itemAuthorTextLabel;
|
id: itemAuthorTextLabel;
|
||||||
text: "Item Author:";
|
text: "Author:";
|
||||||
// Anchors
|
// Anchors
|
||||||
anchors.top: parent.top;
|
anchors.top: parent.top;
|
||||||
anchors.left: parent.left;
|
anchors.left: parent.left;
|
||||||
width: paintedWidth;
|
width: paintedWidth;
|
||||||
|
height: paintedHeight;
|
||||||
// Text size
|
// Text size
|
||||||
size: 16;
|
size: 20;
|
||||||
// Style
|
// Style
|
||||||
color: hifi.colors.lightGrayText;
|
color: hifi.colors.lightGrayText;
|
||||||
// Alignment
|
// Alignment
|
||||||
horizontalAlignment: Text.AlignHLeft;
|
horizontalAlignment: Text.AlignLeft;
|
||||||
verticalAlignment: Text.AlignVCenter;
|
verticalAlignment: Text.AlignVCenter;
|
||||||
}
|
}
|
||||||
RalewayRegular {
|
RalewayRegular {
|
||||||
|
@ -311,56 +366,14 @@ Rectangle {
|
||||||
anchors.top: parent.top;
|
anchors.top: parent.top;
|
||||||
anchors.left: itemAuthorTextLabel.right;
|
anchors.left: itemAuthorTextLabel.right;
|
||||||
anchors.leftMargin: 16;
|
anchors.leftMargin: 16;
|
||||||
width: paintedWidth;
|
anchors.right: parent.right;
|
||||||
|
anchors.rightMargin: 16;
|
||||||
|
height: paintedHeight;
|
||||||
// Style
|
// Style
|
||||||
color: hifi.colors.lightGrayText;
|
color: hifi.colors.lightGrayText;
|
||||||
|
elide: Text.ElideRight;
|
||||||
// Alignment
|
// Alignment
|
||||||
horizontalAlignment: Text.AlignHLeft;
|
horizontalAlignment: Text.AlignRight;
|
||||||
verticalAlignment: Text.AlignVCenter;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// HFC Balance text
|
|
||||||
Item {
|
|
||||||
id: hfcBalanceContainer;
|
|
||||||
// Anchors
|
|
||||||
anchors.top: itemAuthorContainer.bottom;
|
|
||||||
anchors.topMargin: 16;
|
|
||||||
anchors.left: parent.left;
|
|
||||||
anchors.leftMargin: 16;
|
|
||||||
anchors.right: parent.right;
|
|
||||||
anchors.rightMargin: 16;
|
|
||||||
height: childrenRect.height;
|
|
||||||
|
|
||||||
RalewaySemiBold {
|
|
||||||
id: hfcBalanceTextLabel;
|
|
||||||
text: "HFC Balance:";
|
|
||||||
// Anchors
|
|
||||||
anchors.top: parent.top;
|
|
||||||
anchors.left: parent.left;
|
|
||||||
width: paintedWidth;
|
|
||||||
// Text size
|
|
||||||
size: 20;
|
|
||||||
// Style
|
|
||||||
color: hifi.colors.lightGrayText;
|
|
||||||
// Alignment
|
|
||||||
horizontalAlignment: Text.AlignHLeft;
|
|
||||||
verticalAlignment: Text.AlignVCenter;
|
|
||||||
}
|
|
||||||
RalewayRegular {
|
|
||||||
id: hfcBalanceText;
|
|
||||||
text: "--";
|
|
||||||
// Text size
|
|
||||||
size: hfcBalanceTextLabel.size;
|
|
||||||
// Anchors
|
|
||||||
anchors.top: parent.top;
|
|
||||||
anchors.left: hfcBalanceTextLabel.right;
|
|
||||||
anchors.leftMargin: 16;
|
|
||||||
width: paintedWidth;
|
|
||||||
// Style
|
|
||||||
color: hifi.colors.lightGrayText;
|
|
||||||
// Alignment
|
|
||||||
horizontalAlignment: Text.AlignHLeft;
|
|
||||||
verticalAlignment: Text.AlignVCenter;
|
verticalAlignment: Text.AlignVCenter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -369,7 +382,7 @@ Rectangle {
|
||||||
Item {
|
Item {
|
||||||
id: itemPriceContainer;
|
id: itemPriceContainer;
|
||||||
// Anchors
|
// Anchors
|
||||||
anchors.top: hfcBalanceContainer.bottom;
|
anchors.top: itemAuthorContainer.bottom;
|
||||||
anchors.topMargin: 4;
|
anchors.topMargin: 4;
|
||||||
anchors.left: parent.left;
|
anchors.left: parent.left;
|
||||||
anchors.leftMargin: 16;
|
anchors.leftMargin: 16;
|
||||||
|
@ -379,39 +392,43 @@ Rectangle {
|
||||||
|
|
||||||
RalewaySemiBold {
|
RalewaySemiBold {
|
||||||
id: itemPriceTextLabel;
|
id: itemPriceTextLabel;
|
||||||
text: "Item Price:";
|
text: "Price:";
|
||||||
// Anchors
|
// Anchors
|
||||||
anchors.top: parent.top;
|
anchors.top: parent.top;
|
||||||
anchors.left: parent.left;
|
anchors.left: parent.left;
|
||||||
width: paintedWidth;
|
width: paintedWidth;
|
||||||
|
height: paintedHeight;
|
||||||
// Text size
|
// Text size
|
||||||
size: 20;
|
size: 20;
|
||||||
// Style
|
// Style
|
||||||
color: hifi.colors.lightGrayText;
|
color: hifi.colors.lightGrayText;
|
||||||
// Alignment
|
// Alignment
|
||||||
horizontalAlignment: Text.AlignHLeft;
|
horizontalAlignment: Text.AlignLeft;
|
||||||
verticalAlignment: Text.AlignVCenter;
|
verticalAlignment: Text.AlignVCenter;
|
||||||
}
|
}
|
||||||
RalewayRegular {
|
RalewayRegular {
|
||||||
id: itemPriceText;
|
id: itemPriceText;
|
||||||
|
text: "-- HFC";
|
||||||
// Text size
|
// Text size
|
||||||
size: itemPriceTextLabel.size;
|
size: itemPriceTextLabel.size;
|
||||||
// Anchors
|
// Anchors
|
||||||
anchors.top: parent.top;
|
anchors.top: parent.top;
|
||||||
anchors.left: itemPriceTextLabel.right;
|
anchors.left: itemPriceTextLabel.right;
|
||||||
anchors.leftMargin: 16;
|
anchors.leftMargin: 16;
|
||||||
width: paintedWidth;
|
anchors.right: parent.right;
|
||||||
|
anchors.rightMargin: 16;
|
||||||
|
height: paintedHeight;
|
||||||
// Style
|
// Style
|
||||||
color: hifi.colors.lightGrayText;
|
color: hifi.colors.lightGrayText;
|
||||||
// Alignment
|
// Alignment
|
||||||
horizontalAlignment: Text.AlignHLeft;
|
horizontalAlignment: Text.AlignRight;
|
||||||
verticalAlignment: Text.AlignVCenter;
|
verticalAlignment: Text.AlignVCenter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// HFC "Balance After Purchase" text
|
// "Quantity" container
|
||||||
Item {
|
Item {
|
||||||
id: hfcBalanceAfterPurchaseContainer;
|
id: quantityContainer;
|
||||||
// Anchors
|
// Anchors
|
||||||
anchors.top: itemPriceContainer.bottom;
|
anchors.top: itemPriceContainer.bottom;
|
||||||
anchors.topMargin: 4;
|
anchors.topMargin: 4;
|
||||||
|
@ -422,34 +439,86 @@ Rectangle {
|
||||||
height: childrenRect.height;
|
height: childrenRect.height;
|
||||||
|
|
||||||
RalewaySemiBold {
|
RalewaySemiBold {
|
||||||
id: hfcBalanceAfterPurchaseTextLabel;
|
id: quantityTextLabel;
|
||||||
text: "HFC Balance After Purchase:";
|
text: "Quantity:";
|
||||||
// Anchors
|
// Anchors
|
||||||
anchors.top: parent.top;
|
anchors.top: parent.top;
|
||||||
anchors.left: parent.left;
|
anchors.left: parent.left;
|
||||||
width: paintedWidth;
|
width: paintedWidth;
|
||||||
|
height: paintedHeight;
|
||||||
// Text size
|
// Text size
|
||||||
size: 20;
|
size: 20;
|
||||||
// Style
|
// Style
|
||||||
color: hifi.colors.lightGrayText;
|
color: hifi.colors.lightGrayText;
|
||||||
// Alignment
|
// Alignment
|
||||||
horizontalAlignment: Text.AlignHLeft;
|
horizontalAlignment: Text.AlignLeft;
|
||||||
|
verticalAlignment: Text.AlignVCenter;
|
||||||
|
}
|
||||||
|
// ZRF FIXME: MAKE DROPDOWN
|
||||||
|
RalewayRegular {
|
||||||
|
id: quantityText;
|
||||||
|
text: "1";
|
||||||
|
// Text size
|
||||||
|
size: quantityTextLabel.size;
|
||||||
|
// Anchors
|
||||||
|
anchors.top: parent.top;
|
||||||
|
anchors.left: quantityTextLabel.right;
|
||||||
|
anchors.leftMargin: 16;
|
||||||
|
anchors.right: parent.right;
|
||||||
|
anchors.rightMargin: 16;
|
||||||
|
height: paintedHeight;
|
||||||
|
// Style
|
||||||
|
color: hifi.colors.lightGrayText;
|
||||||
|
// Alignment
|
||||||
|
horizontalAlignment: Text.AlignRight;
|
||||||
|
verticalAlignment: Text.AlignVCenter;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// "Total Cost" container
|
||||||
|
Item {
|
||||||
|
id: totalCostContainer;
|
||||||
|
// Anchors
|
||||||
|
anchors.top: quantityContainer.bottom;
|
||||||
|
anchors.topMargin: 32;
|
||||||
|
anchors.left: parent.left;
|
||||||
|
anchors.leftMargin: 16;
|
||||||
|
anchors.right: parent.right;
|
||||||
|
anchors.rightMargin: 16;
|
||||||
|
height: childrenRect.height;
|
||||||
|
|
||||||
|
RalewaySemiBold {
|
||||||
|
id: totalCostTextLabel;
|
||||||
|
text: "Total Cost:";
|
||||||
|
// Anchors
|
||||||
|
anchors.top: parent.top;
|
||||||
|
anchors.left: parent.left;
|
||||||
|
width: paintedWidth;
|
||||||
|
height: paintedHeight;
|
||||||
|
// Text size
|
||||||
|
size: 30;
|
||||||
|
// Style
|
||||||
|
color: hifi.colors.lightGrayText;
|
||||||
|
// Alignment
|
||||||
|
horizontalAlignment: Text.AlignLeft;
|
||||||
verticalAlignment: Text.AlignVCenter;
|
verticalAlignment: Text.AlignVCenter;
|
||||||
}
|
}
|
||||||
RalewayRegular {
|
RalewayRegular {
|
||||||
id: hfcBalanceAfterPurchaseText;
|
id:totalCostText;
|
||||||
text: balanceAfterPurchase;
|
text: "-- HFC";
|
||||||
// Text size
|
// Text size
|
||||||
size: hfcBalanceAfterPurchaseTextLabel.size;
|
size: totalCostTextLabel.size;
|
||||||
// Anchors
|
// Anchors
|
||||||
anchors.top: parent.top;
|
anchors.top: parent.top;
|
||||||
anchors.left: hfcBalanceAfterPurchaseTextLabel.right;
|
anchors.left: totalCostTextLabel.right;
|
||||||
anchors.leftMargin: 16;
|
anchors.leftMargin: 16;
|
||||||
width: paintedWidth;
|
anchors.right: parent.right;
|
||||||
|
anchors.rightMargin: 16;
|
||||||
|
height: paintedHeight;
|
||||||
// Style
|
// Style
|
||||||
color: (balanceAfterPurchase >= 0) ? hifi.colors.lightGrayText : hifi.colors.redHighlight;
|
color: (balanceAfterPurchase >= 0) ? hifi.colors.lightGrayText : hifi.colors.redHighlight;
|
||||||
// Alignment
|
// Alignment
|
||||||
horizontalAlignment: Text.AlignHLeft;
|
horizontalAlignment: Text.AlignRight;
|
||||||
verticalAlignment: Text.AlignVCenter;
|
verticalAlignment: Text.AlignVCenter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -466,11 +535,31 @@ Rectangle {
|
||||||
id: checkoutActionButtonsContainer;
|
id: checkoutActionButtonsContainer;
|
||||||
// Size
|
// Size
|
||||||
width: root.width;
|
width: root.width;
|
||||||
height: 130;
|
height: root.alreadyOwned ? 180 : 130;
|
||||||
// Anchors
|
// Anchors
|
||||||
anchors.left: parent.left;
|
anchors.left: parent.left;
|
||||||
anchors.bottom: parent.bottom;
|
anchors.bottom: parent.bottom;
|
||||||
anchors.bottomMargin: 8;
|
anchors.bottomMargin: 8;
|
||||||
|
|
||||||
|
|
||||||
|
// "Inventory" button
|
||||||
|
HifiControlsUit.Button {
|
||||||
|
id: goToInventoryButton;
|
||||||
|
visible: root.alreadyOwned;
|
||||||
|
color: hifi.buttons.black;
|
||||||
|
colorScheme: hifi.colorSchemes.dark;
|
||||||
|
anchors.top: parent.top;
|
||||||
|
anchors.topMargin: 3;
|
||||||
|
anchors.bottomMargin: 7;
|
||||||
|
height: 40;
|
||||||
|
anchors.left: parent.left;
|
||||||
|
anchors.leftMargin: 20;
|
||||||
|
width: parent.width - anchors.leftMargin*2;
|
||||||
|
text: "View Inventory"
|
||||||
|
onClicked: {
|
||||||
|
sendToScript({method: 'checkout_goToInventory'});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// "Cancel" button
|
// "Cancel" button
|
||||||
HifiControlsUit.Button {
|
HifiControlsUit.Button {
|
||||||
|
@ -501,7 +590,7 @@ Rectangle {
|
||||||
anchors.right: parent.right;
|
anchors.right: parent.right;
|
||||||
anchors.rightMargin: 20;
|
anchors.rightMargin: 20;
|
||||||
width: parent.width/2 - anchors.rightMargin*2;
|
width: parent.width/2 - anchors.rightMargin*2;
|
||||||
text: (inventoryReceived && balanceReceived) ? ("Buy") : "--";
|
text: (inventoryReceived && balanceReceived) ? (root.alreadyOwned ? "Buy Again" : "Buy"): "--";
|
||||||
onClicked: {
|
onClicked: {
|
||||||
buyButton.enabled = false;
|
buyButton.enabled = false;
|
||||||
commerce.buy(itemId, itemPriceFull);
|
commerce.buy(itemId, itemPriceFull);
|
||||||
|
@ -510,7 +599,9 @@ Rectangle {
|
||||||
|
|
||||||
RalewayRegular {
|
RalewayRegular {
|
||||||
id: buyText;
|
id: buyText;
|
||||||
text: (balanceAfterPurchase >= 0) ? "This item will be added to your <b>Inventory</b>, which can be accessed from <b>Marketplace</b>." : "OUT OF MONEY LOL";
|
text: (inventoryReceived && balanceReceived) ? ((balanceAfterPurchase < 0) ? "You do not have enough HFC to purchase this item." :
|
||||||
|
(root.alreadyOwned ? "<b>You already own this item.</b> If you buy it again, you'll be able to use multiple copies of it at once." :
|
||||||
|
"This item will be added to your <b>Inventory</b>, which can be accessed from <b>Marketplace</b>.")) : "";
|
||||||
// Text size
|
// Text size
|
||||||
size: 20;
|
size: 20;
|
||||||
// Anchors
|
// Anchors
|
||||||
|
@ -752,7 +843,8 @@ Rectangle {
|
||||||
itemNameText.text = message.params.itemName;
|
itemNameText.text = message.params.itemName;
|
||||||
itemAuthorText.text = message.params.itemAuthor;
|
itemAuthorText.text = message.params.itemAuthor;
|
||||||
root.itemPriceFull = message.params.itemPrice;
|
root.itemPriceFull = message.params.itemPrice;
|
||||||
itemPriceText.text = parseFloat(root.itemPriceFull/100).toFixed(2);
|
itemPriceText.text = (parseFloat(root.itemPriceFull/100).toFixed(2)) + " HFC";
|
||||||
|
totalCostText.text = (parseFloat(root.itemPriceFull/100).toFixed(2)) + " HFC";
|
||||||
itemHref = message.params.itemHref;
|
itemHref = message.params.itemHref;
|
||||||
commerce.balance();
|
commerce.balance();
|
||||||
commerce.inventory();
|
commerce.inventory();
|
||||||
|
|
Loading…
Reference in a new issue