diff options
| author | ilotterytea <iltsu@alright.party> | 2024-10-29 10:28:45 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2024-10-29 10:28:45 +0500 |
| commit | 730a41522c3be8cf8d5ac3b72d1d4d64b74018a6 (patch) | |
| tree | 90acba41af10cc9732ee5686058b3c1e5989b180 /core/src/kz/ilotterytea/maxon/pets | |
| parent | b9050a21c0bcb988ac90a1d0082ab03277e490da (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.java | 10 |
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; } |
