mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 18:50:00 +02:00
Merge pull request #13166 from zfox23/showInvalidItemsInPurchases
Show invalidated items in My Purchases
This commit is contained in:
commit
e15a800639
2 changed files with 13 additions and 18 deletions
|
@ -49,6 +49,7 @@ Item {
|
||||||
property string upgradeTitle;
|
property string upgradeTitle;
|
||||||
property bool updateAvailable: root.upgradeUrl !== "" && !root.isShowingMyItems;
|
property bool updateAvailable: root.upgradeUrl !== "" && !root.isShowingMyItems;
|
||||||
property bool isShowingMyItems;
|
property bool isShowingMyItems;
|
||||||
|
property bool valid;
|
||||||
|
|
||||||
property string originalStatusText;
|
property string originalStatusText;
|
||||||
property string originalStatusColor;
|
property string originalStatusColor;
|
||||||
|
@ -239,6 +240,7 @@ Item {
|
||||||
width: 62;
|
width: 62;
|
||||||
|
|
||||||
onLoaded: {
|
onLoaded: {
|
||||||
|
item.enabled = root.valid;
|
||||||
item.buttonGlyphText = hifi.glyphs.gift;
|
item.buttonGlyphText = hifi.glyphs.gift;
|
||||||
item.buttonText = "Gift";
|
item.buttonText = "Gift";
|
||||||
item.buttonClicked = function() {
|
item.buttonClicked = function() {
|
||||||
|
@ -463,7 +465,7 @@ Item {
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: statusContainer;
|
id: statusContainer;
|
||||||
visible: root.purchaseStatus === "pending" || root.purchaseStatus === "invalidated" || root.numberSold > -1;
|
visible: root.purchaseStatus === "pending" || !root.valid || root.numberSold > -1;
|
||||||
anchors.left: itemName.left;
|
anchors.left: itemName.left;
|
||||||
anchors.right: itemName.right;
|
anchors.right: itemName.right;
|
||||||
anchors.top: itemName.bottom;
|
anchors.top: itemName.bottom;
|
||||||
|
@ -480,7 +482,7 @@ Item {
|
||||||
text: {
|
text: {
|
||||||
if (root.purchaseStatus === "pending") {
|
if (root.purchaseStatus === "pending") {
|
||||||
"PENDING..."
|
"PENDING..."
|
||||||
} else if (root.purchaseStatus === "invalidated") {
|
} else if (!root.valid) {
|
||||||
"INVALIDATED"
|
"INVALIDATED"
|
||||||
} else if (root.numberSold > -1) {
|
} else if (root.numberSold > -1) {
|
||||||
("Sales: " + root.numberSold + "/" + (root.limitedRun === -1 ? "\u221e" : root.limitedRun))
|
("Sales: " + root.numberSold + "/" + (root.limitedRun === -1 ? "\u221e" : root.limitedRun))
|
||||||
|
@ -492,7 +494,7 @@ Item {
|
||||||
color: {
|
color: {
|
||||||
if (root.purchaseStatus === "pending") {
|
if (root.purchaseStatus === "pending") {
|
||||||
hifi.colors.blueAccent
|
hifi.colors.blueAccent
|
||||||
} else if (root.purchaseStatus === "invalidated") {
|
} else if (!root.valid) {
|
||||||
hifi.colors.redAccent
|
hifi.colors.redAccent
|
||||||
} else {
|
} else {
|
||||||
hifi.colors.baseGray
|
hifi.colors.baseGray
|
||||||
|
@ -506,7 +508,7 @@ Item {
|
||||||
text: {
|
text: {
|
||||||
if (root.purchaseStatus === "pending") {
|
if (root.purchaseStatus === "pending") {
|
||||||
hifi.glyphs.question
|
hifi.glyphs.question
|
||||||
} else if (root.purchaseStatus === "invalidated") {
|
} else if (!root.valid) {
|
||||||
hifi.glyphs.question
|
hifi.glyphs.question
|
||||||
} else {
|
} else {
|
||||||
""
|
""
|
||||||
|
@ -523,7 +525,7 @@ Item {
|
||||||
color: {
|
color: {
|
||||||
if (root.purchaseStatus === "pending") {
|
if (root.purchaseStatus === "pending") {
|
||||||
hifi.colors.blueAccent
|
hifi.colors.blueAccent
|
||||||
} else if (root.purchaseStatus === "invalidated") {
|
} else if (!root.valid) {
|
||||||
hifi.colors.redAccent
|
hifi.colors.redAccent
|
||||||
} else {
|
} else {
|
||||||
hifi.colors.baseGray
|
hifi.colors.baseGray
|
||||||
|
@ -538,7 +540,7 @@ Item {
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (root.purchaseStatus === "pending") {
|
if (root.purchaseStatus === "pending") {
|
||||||
sendToPurchases({method: 'showPendingLightbox'});
|
sendToPurchases({method: 'showPendingLightbox'});
|
||||||
} else if (root.purchaseStatus === "invalidated") {
|
} else if (!root.valid) {
|
||||||
sendToPurchases({method: 'showInvalidatedLightbox'});
|
sendToPurchases({method: 'showInvalidatedLightbox'});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -546,7 +548,7 @@ Item {
|
||||||
if (root.purchaseStatus === "pending") {
|
if (root.purchaseStatus === "pending") {
|
||||||
statusText.color = hifi.colors.blueHighlight;
|
statusText.color = hifi.colors.blueHighlight;
|
||||||
statusIcon.color = hifi.colors.blueHighlight;
|
statusIcon.color = hifi.colors.blueHighlight;
|
||||||
} else if (root.purchaseStatus === "invalidated") {
|
} else if (!root.valid) {
|
||||||
statusText.color = hifi.colors.redAccent;
|
statusText.color = hifi.colors.redAccent;
|
||||||
statusIcon.color = hifi.colors.redAccent;
|
statusIcon.color = hifi.colors.redAccent;
|
||||||
}
|
}
|
||||||
|
@ -555,7 +557,7 @@ Item {
|
||||||
if (root.purchaseStatus === "pending") {
|
if (root.purchaseStatus === "pending") {
|
||||||
statusText.color = hifi.colors.blueAccent;
|
statusText.color = hifi.colors.blueAccent;
|
||||||
statusIcon.color = hifi.colors.blueAccent;
|
statusIcon.color = hifi.colors.blueAccent;
|
||||||
} else if (root.purchaseStatus === "invalidated") {
|
} else if (!root.valid) {
|
||||||
statusText.color = hifi.colors.redHighlight;
|
statusText.color = hifi.colors.redHighlight;
|
||||||
statusIcon.color = hifi.colors.redHighlight;
|
statusIcon.color = hifi.colors.redHighlight;
|
||||||
}
|
}
|
||||||
|
@ -645,8 +647,8 @@ Item {
|
||||||
width: 160;
|
width: 160;
|
||||||
height: 40;
|
height: 40;
|
||||||
enabled: root.hasPermissionToRezThis &&
|
enabled: root.hasPermissionToRezThis &&
|
||||||
root.purchaseStatus !== "invalidated" &&
|
MyAvatar.skeletonModelURL !== root.itemHref &&
|
||||||
MyAvatar.skeletonModelURL !== root.itemHref;
|
root.valid;
|
||||||
|
|
||||||
onHoveredChanged: {
|
onHoveredChanged: {
|
||||||
if (hovered) {
|
if (hovered) {
|
||||||
|
|
|
@ -616,6 +616,7 @@ Rectangle {
|
||||||
upgradeTitle: model.upgrade_title;
|
upgradeTitle: model.upgrade_title;
|
||||||
itemType: model.itemType;
|
itemType: model.itemType;
|
||||||
isShowingMyItems: root.isShowingMyItems;
|
isShowingMyItems: root.isShowingMyItems;
|
||||||
|
valid: model.valid;
|
||||||
anchors.topMargin: 10;
|
anchors.topMargin: 10;
|
||||||
anchors.bottomMargin: 10;
|
anchors.bottomMargin: 10;
|
||||||
|
|
||||||
|
@ -995,10 +996,6 @@ Rectangle {
|
||||||
|
|
||||||
for (var i = 0; i < purchasesModel.count; i++) {
|
for (var i = 0; i < purchasesModel.count; i++) {
|
||||||
if (purchasesModel.get(i).title.toLowerCase().indexOf(filterBar.text.toLowerCase()) !== -1) {
|
if (purchasesModel.get(i).title.toLowerCase().indexOf(filterBar.text.toLowerCase()) !== -1) {
|
||||||
if (!purchasesModel.get(i).valid) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (purchasesModel.get(i).status !== "confirmed" && !root.isShowingMyItems) {
|
if (purchasesModel.get(i).status !== "confirmed" && !root.isShowingMyItems) {
|
||||||
tempPurchasesModel.insert(0, purchasesModel.get(i));
|
tempPurchasesModel.insert(0, purchasesModel.get(i));
|
||||||
} else if ((root.isShowingMyItems && purchasesModel.get(i).edition_number === "0") ||
|
} else if ((root.isShowingMyItems && purchasesModel.get(i).edition_number === "0") ||
|
||||||
|
@ -1055,10 +1052,6 @@ Rectangle {
|
||||||
var currentId;
|
var currentId;
|
||||||
for (var i = 0; i < tempPurchasesModel.count; i++) {
|
for (var i = 0; i < tempPurchasesModel.count; i++) {
|
||||||
currentId = tempPurchasesModel.get(i).id;
|
currentId = tempPurchasesModel.get(i).id;
|
||||||
|
|
||||||
if (!purchasesModel.get(i).valid) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
filteredPurchasesModel.append(tempPurchasesModel.get(i));
|
filteredPurchasesModel.append(tempPurchasesModel.get(i));
|
||||||
filteredPurchasesModel.setProperty(i, 'cardBackVisible', false);
|
filteredPurchasesModel.setProperty(i, 'cardBackVisible', false);
|
||||||
filteredPurchasesModel.setProperty(i, 'isInstalled', ((root.installedApps).indexOf(currentId) > -1));
|
filteredPurchasesModel.setProperty(i, 'isInstalled', ((root.installedApps).indexOf(currentId) > -1));
|
||||||
|
|
Loading…
Reference in a new issue