aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/de/hysky/skyblocker/skyblock/tabhud
diff options
context:
space:
mode:
authorolim <bobq4582@gmail.com>2024-01-31 10:52:37 +0000
committerolim <bobq4582@gmail.com>2024-01-31 10:52:37 +0000
commit86035f311b28094daf1ab7dbda7c888259e56723 (patch)
tree1c53e15c03780135f783d88bc00e4ed62bda0482 /src/main/java/de/hysky/skyblocker/skyblock/tabhud
parentbc5cf9a37e4241096bd5ec1b2491ad71281593ff (diff)
downloadSkyblocker-86035f311b28094daf1ab7dbda7c888259e56723.tar.gz
Skyblocker-86035f311b28094daf1ab7dbda7c888259e56723.tar.bz2
Skyblocker-86035f311b28094daf1ab7dbda7c888259e56723.zip
added powder hud
added powder to the dwarven hud
Diffstat (limited to 'src/main/java/de/hysky/skyblocker/skyblock/tabhud')
-rw-r--r--src/main/java/de/hysky/skyblocker/skyblock/tabhud/widget/hud/HudPowderWidget.java47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/tabhud/widget/hud/HudPowderWidget.java b/src/main/java/de/hysky/skyblocker/skyblock/tabhud/widget/hud/HudPowderWidget.java
new file mode 100644
index 00000000..345794d8
--- /dev/null
+++ b/src/main/java/de/hysky/skyblocker/skyblock/tabhud/widget/hud/HudPowderWidget.java
@@ -0,0 +1,47 @@
+package de.hysky.skyblocker.skyblock.tabhud.widget.hud;
+
+import java.util.List;
+
+import de.hysky.skyblocker.skyblock.dwarven.DwarvenHud.Commission;
+import de.hysky.skyblocker.skyblock.tabhud.util.Colors;
+import de.hysky.skyblocker.skyblock.tabhud.util.Ico;
+import de.hysky.skyblocker.skyblock.tabhud.widget.Widget;
+import de.hysky.skyblocker.skyblock.tabhud.widget.component.Component;
+import de.hysky.skyblocker.skyblock.tabhud.widget.component.PlainTextComponent;
+import de.hysky.skyblocker.skyblock.tabhud.widget.component.ProgressComponent;
+import net.minecraft.text.MutableText;
+import net.minecraft.text.Text;
+import net.minecraft.util.Formatting;
+
+// this widget shows the status of the king's commissions.
+// (dwarven mines and crystal hollows)
+// USE ONLY WITH THE DWARVEN HUD!
+
+public class HudPowderWidget extends Widget {
+
+ private static final MutableText TITLE = Text.literal("Powders").formatted(Formatting.DARK_AQUA,
+ Formatting.BOLD);
+
+
+ // disgusting hack to get around text renderer issues.
+ // the ctor eventually tries to get the font's height, which doesn't work
+ // when called before the client window is created (roughly).
+ // the rebdering god 2 from the fabricord explained that detail, thanks!
+ //coppied from the HodCommsWidget to be used in the same place
+ public static final HudPowderWidget INSTANCE = new HudPowderWidget();
+ public static final HudPowderWidget INSTANCE_CFG = new HudPowderWidget();
+
+ // another repulsive hack to make this widget-like hud element work with the new widget class
+ // DON'T USE WITH THE WIDGET SYSTEM, ONLY USE FOR DWARVENHUD!
+ public HudPowderWidget() {
+ super(TITLE, Formatting.DARK_AQUA.getColorValue());
+ }
+
+
+ @Override
+ public void updateContent() {
+ this.addSimpleIcoText(Ico.MITHRIL, "Mithril:", Formatting.AQUA, 46);
+ this.addSimpleIcoText(Ico.AMETHYST_SHARD, "Gemstone:", Formatting.DARK_PURPLE, 47);
+ }
+
+}