From 39e8c7f9328056d755cf6f5c1a52816e1f86b345 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Sun, 9 Jun 2024 16:45:30 +0500 Subject: upd: use HashMap for purchased pets + fix --- core/src/kz/ilotterytea/maxon/ui/SavegameWidget.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'core/src/kz/ilotterytea/maxon/ui') diff --git a/core/src/kz/ilotterytea/maxon/ui/SavegameWidget.java b/core/src/kz/ilotterytea/maxon/ui/SavegameWidget.java index c6d2434..fb22122 100644 --- a/core/src/kz/ilotterytea/maxon/ui/SavegameWidget.java +++ b/core/src/kz/ilotterytea/maxon/ui/SavegameWidget.java @@ -124,7 +124,11 @@ public class SavegameWidget extends Table implements Disposable { data.add(points).padRight(32f); // Unit - long amount = savegame.getPurchasedPets().size(); + int amount = 0; + + for (int a : savegame.getPurchasedPets().values()) { + amount += a; + } Image unitIcon = new Image(atlas.findRegion("pets")); data.add(unitIcon).size(32f, 32f).padRight(8f); -- cgit v1.2.3