summaryrefslogtreecommitdiff
path: root/core/src/kz/ilotterytea/maxon/pets
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2024-10-29 10:28:45 +0500
committerilotterytea <iltsu@alright.party>2024-10-29 10:28:45 +0500
commit730a41522c3be8cf8d5ac3b72d1d4d64b74018a6 (patch)
tree90acba41af10cc9732ee5686058b3c1e5989b180 /core/src/kz/ilotterytea/maxon/pets
parentb9050a21c0bcb988ac90a1d0082ab03277e490da (diff)
feat: show the amount of purchased pets
Diffstat (limited to 'core/src/kz/ilotterytea/maxon/pets')
-rw-r--r--core/src/kz/ilotterytea/maxon/pets/PetWidget.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/core/src/kz/ilotterytea/maxon/pets/PetWidget.java b/core/src/kz/ilotterytea/maxon/pets/PetWidget.java
index 70a0e94..c8b56fb 100644
--- a/core/src/kz/ilotterytea/maxon/pets/PetWidget.java
+++ b/core/src/kz/ilotterytea/maxon/pets/PetWidget.java
@@ -17,7 +17,7 @@ import kz.ilotterytea.maxon.utils.formatters.NumberFormatter;
public class PetWidget extends Table {
private double price;
private final Skin skin;
- private final Label priceLabel, nameLabel;
+ private final Label priceLabel, nameLabel, amountLabel;
private TextTooltip priceTooltip;
private final Pet pet;
@@ -98,6 +98,9 @@ public class PetWidget extends Table {
}
}
});
+
+ this.amountLabel = new Label("", skin, "store_item_amount");
+ super.add(amountLabel);
}
public void setPrice(double price) {
@@ -169,6 +172,11 @@ public class PetWidget extends Table {
this.nameLabel.addListener(tooltip);
}
+ public void setAmount(Integer amount) {
+ this.amountLabel.setVisible(amount > 0);
+ this.amountLabel.setText(amount);
+ }
+
public boolean isLocked() {
return isLocked;
}