From bb128578cf4cc68f992a15446cb0c303e4d60262 Mon Sep 17 00:00:00 2001 From: Scribble Date: Fri, 2 May 2025 09:48:53 +0200 Subject: [PATCH] [InfoHud] Add current input size to the playback index Currently, the playback index only shows the current tick of the recording. Now a second variable is added to show the size of the recording with the format 0/0, with the second one being the size. To get the size, I use PlaybackController#size()-1 as the index is always one smaller than the size. And to not get negative numbers when no inputs are present, I use Math.max(size, 0) --- src/main/java/com/minecrafttas/tasmod/gui/InfoHud.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/minecrafttas/tasmod/gui/InfoHud.java b/src/main/java/com/minecrafttas/tasmod/gui/InfoHud.java index 4fc326fd..12e7a38e 100644 --- a/src/main/java/com/minecrafttas/tasmod/gui/InfoHud.java +++ b/src/main/java/com/minecrafttas/tasmod/gui/InfoHud.java @@ -454,7 +454,8 @@ public boolean checkInit() { + "_visible")), Boolean.parseBoolean(configuration.getProperty(title + "_rect")), () -> { if (Minecraft.getMinecraft().currentScreen == this) return "PlaybackIndex"; - return Long.toString(TASmodClient.controller.index()); + + return String.format("%s/%s", TASmodClient.controller.index(), Math.max(TASmodClient.controller.size() - 1, 0L)); })); y = height - 14;