diff options
author | Kevin <92656833+kevinthegreat1@users.noreply.github.com> | 2024-02-19 14:42:08 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-19 14:42:08 -0500 |
commit | 6c3dd6b662ec86b8b7a185de9778ee97d435f3d1 (patch) | |
tree | fa7e99764170e2d0d4e3f2cb328521c4b957c70f /src/main/java | |
parent | 7b6eac893985c42aa10d7596eb55eb6a72e8d185 (diff) | |
download | Skyblocker-6c3dd6b662ec86b8b7a185de9778ee97d435f3d1.tar.gz Skyblocker-6c3dd6b662ec86b8b7a185de9778ee97d435f3d1.tar.bz2 Skyblocker-6c3dd6b662ec86b8b7a185de9778ee97d435f3d1.zip |
Fix discoveries index (#557)
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/de/hysky/skyblocker/skyblock/tabhud/widget/DungeonSecretWidget.java | 18 |
1 files changed, 12 insertions, 6 deletions
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 6f40f5a8..309ba9ca 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,16 +1,19 @@ package de.hysky.skyblocker.skyblock.tabhud.widget; import de.hysky.skyblocker.skyblock.tabhud.util.Ico; +import de.hysky.skyblocker.skyblock.tabhud.util.PlayerListMgr; import net.minecraft.text.MutableText; import net.minecraft.text.Text; import net.minecraft.util.Formatting; +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 MutableText TITLE = Text.literal("Discoveries").formatted(Formatting.DARK_PURPLE, Formatting.BOLD); + private static final Pattern DISCOVERIES = Pattern.compile("Discoveries: (\\d+)"); public DungeonSecretWidget() { super(TITLE, Formatting.DARK_PURPLE.getColorValue()); @@ -18,9 +21,12 @@ public class DungeonSecretWidget extends Widget { @Override public void updateContent() { - this.addSimpleIcoText(Ico.CHEST, "Secrets:", Formatting.YELLOW, 31); - this.addSimpleIcoText(Ico.SKULL, "Crypts:", Formatting.YELLOW, 32); - + if (PlayerListMgr.regexAt(31, DISCOVERIES) != null) { + this.addSimpleIcoText(Ico.CHEST, "Secrets:", Formatting.YELLOW, 32); + this.addSimpleIcoText(Ico.SKULL, "Crypts:", Formatting.YELLOW, 33); + } else { + this.addSimpleIcoText(Ico.CHEST, "Secrets:", Formatting.YELLOW, 31); + this.addSimpleIcoText(Ico.SKULL, "Crypts:", Formatting.YELLOW, 32); + } } - } |