summaryrefslogtreecommitdiff
path: root/core/src/com/ilotterytea/maxoning/ui
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/com/ilotterytea/maxoning/ui')
-rw-r--r--core/src/com/ilotterytea/maxoning/ui/SaveGameWidget.java30
1 files changed, 17 insertions, 13 deletions
diff --git a/core/src/com/ilotterytea/maxoning/ui/SaveGameWidget.java b/core/src/com/ilotterytea/maxoning/ui/SaveGameWidget.java
index cd6fa72..aa9fa85 100644
--- a/core/src/com/ilotterytea/maxoning/ui/SaveGameWidget.java
+++ b/core/src/com/ilotterytea/maxoning/ui/SaveGameWidget.java
@@ -3,15 +3,18 @@ package com.ilotterytea.maxoning.ui;
import com.badlogic.gdx.scenes.scene2d.ui.*;
import com.badlogic.gdx.utils.Align;
-import com.ilotterytea.maxoning.player.MaxonPlayer;
+import com.badlogic.gdx.utils.Null;
+import com.ilotterytea.maxoning.player.MaxonSavegame;
import com.ilotterytea.maxoning.utils.formatters.NumberFormatter;
+import java.util.Date;
+
public class SaveGameWidget extends Button {
public SaveGameWidget(
Skin skin,
Skin widgetSkin,
- MaxonPlayer sav
+ @Null MaxonSavegame sav
) {
// Setting the stack:
super(widgetSkin, "slot");
@@ -20,14 +23,15 @@ public class SaveGameWidget extends Button {
// // Info row:
Table infoTable = new Table();
- // Top left label:
- Label topleftLabel = new Label(String.format("%s Squish Points", (sav != null) ? NumberFormatter.format((long) sav.points) : "---"), skin);
+ // Top left label (name):
+ Label topleftLabel = new Label((sav != null) ? sav.name : "[EMPTY]", skin);
topleftLabel.setAlignment(Align.left);
infoTable.add(topleftLabel).width(256f);
- // Top right label:
+ // Top right label (elapsed time):
+ Date date = new Date((sav != null) ? sav.elapsedTime : 0);
Label toprightLabel = new Label(
- String.format("%s purchased items", (sav != null) ? sav.purchasedItems.size() : "---"),
+ String.format("%s:%s", date.getHours(), date.getMinutes()),
skin
);
toprightLabel.setAlignment(Align.right);
@@ -36,28 +40,28 @@ public class SaveGameWidget extends Button {
// // Description row:
Table descTable = new Table();
- // Bottom left label:
+ // Bottom left label (purchased items):
Label bottomleftLabel = new Label(
String.format(
- "x%s",
- (sav != null) ? NumberFormatter.format((long) sav.multiplier) : "?"
+ "%s purchased items",
+ (sav != null) ? sav.inv.size() : "?"
),
skin
);
bottomleftLabel.setAlignment(Align.left);
descTable.add(bottomleftLabel).width(256f);
- /* NOT IN USE. Bottom right label:
+ // Bottom right label (points/multiplier):
Label pointsLabel = new Label(
String.format(
"%s$/x%s",
- NumberFormatter.format(points),
- NumberFormatter.format(multiplier)
+ (sav != null) ? NumberFormatter.format(sav.points) : "---",
+ (sav != null) ? NumberFormatter.format(sav.multiplier) : "0"
),
skin
);
pointsLabel.setAlignment(Align.right);
- descTable.add(pointsLabel).width(256f);*/
+ descTable.add(pointsLabel).width(256f);
// Adding the tables to main table:
Table summaryTable = new Table();