From 730a41522c3be8cf8d5ac3b72d1d4d64b74018a6 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Tue, 29 Oct 2024 10:28:45 +0500 Subject: feat: show the amount of purchased pets --- core/src/kz/ilotterytea/maxon/pets/PetWidget.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'core/src/kz/ilotterytea/maxon/pets') 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; } -- cgit v1.2.3