From d67f67faa95fadea750439673d04736fa4c47c1e Mon Sep 17 00:00:00 2001 From: msg-programs Date: Mon, 30 Oct 2023 23:19:56 +0100 Subject: Add color to dungeon puzzle status on widget --- .../skyblocker/skyblock/tabhud/widget/DungeonPuzzleWidget.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/hysky/skyblocker/skyblock/tabhud/widget/DungeonPuzzleWidget.java b/src/main/java/de/hysky/skyblocker/skyblock/tabhud/widget/DungeonPuzzleWidget.java index 1b3b8644..01413733 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/tabhud/widget/DungeonPuzzleWidget.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/tabhud/widget/DungeonPuzzleWidget.java @@ -37,9 +37,16 @@ public class DungeonPuzzleWidget extends Widget { if (m == null) { break; } + + Formatting statcol = switch (m.group("status")) { + case "✔" -> Formatting.GREEN; + case "✖" -> Formatting.RED; + default -> Formatting.WHITE; + }; + Text t = Text.literal(m.group("name") + ": ") .append(Text.literal("[").formatted(Formatting.GRAY)) - .append(m.group("status")) + .append(Text.literal(m.group("status")).formatted(statcol)) .append(Text.literal("]").formatted(Formatting.GRAY)); IcoTextComponent itc = new IcoTextComponent(Ico.SIGN, t); this.addComponent(itc); @@ -47,6 +54,7 @@ public class DungeonPuzzleWidget extends Widget { // code points for puzzle status chars unsolved and solved: 10022, 10004 // not sure which one is which // still need to find out codepoint for the puzzle failed char + m.group("status").codePoints().forEach(System.out::println); } if (pos == 48) { this.addComponent( -- cgit