From fd1122105b68dea4b4ef02d67fcc4a47c00db465 Mon Sep 17 00:00:00 2001 From: Rime <81419447+Emirlol@users.noreply.github.com> Date: Sun, 14 Jul 2024 16:42:36 +0300 Subject: Add a case for when the dungeon hasn't started yet (#843) --- .../skyblocker/skyblock/tabhud/widget/DungeonSecretWidget.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main/java/de/hysky/skyblocker/skyblock/tabhud/widget/DungeonSecretWidget.java b/src/main/java/de/hysky/skyblocker/skyblock/tabhud/widget/DungeonSecretWidget.java index 309ba9ca..359e9ef2 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/tabhud/widget/DungeonSecretWidget.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/tabhud/widget/DungeonSecretWidget.java @@ -1,5 +1,6 @@ package de.hysky.skyblocker.skyblock.tabhud.widget; +import de.hysky.skyblocker.skyblock.dungeon.DungeonScore; import de.hysky.skyblocker.skyblock.tabhud.util.Ico; import de.hysky.skyblocker.skyblock.tabhud.util.PlayerListMgr; import net.minecraft.text.MutableText; @@ -11,7 +12,6 @@ import java.util.regex.Pattern; // this widget shows info about the secrets of the dungeon public class DungeonSecretWidget extends Widget { - private static final MutableText TITLE = Text.literal("Discoveries").formatted(Formatting.DARK_PURPLE, Formatting.BOLD); private static final Pattern DISCOVERIES = Pattern.compile("Discoveries: (\\d+)"); @@ -21,7 +21,10 @@ public class DungeonSecretWidget extends Widget { @Override public void updateContent() { - if (PlayerListMgr.regexAt(31, DISCOVERIES) != null) { + if (!DungeonScore.isDungeonStarted()) { + this.addSimpleIcoText(Ico.CHEST, "Secrets:", Formatting.YELLOW, 30); + this.addSimpleIcoText(Ico.SKULL, "Crypts:", Formatting.YELLOW, 31); + } else if (PlayerListMgr.regexAt(31, DISCOVERIES) != null) { this.addSimpleIcoText(Ico.CHEST, "Secrets:", Formatting.YELLOW, 32); this.addSimpleIcoText(Ico.SKULL, "Crypts:", Formatting.YELLOW, 33); } else { -- cgit