aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/de/hysky/skyblocker/skyblock/tabhud/widget
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/hysky/skyblocker/skyblock/tabhud/widget')
-rw-r--r--src/main/java/de/hysky/skyblocker/skyblock/tabhud/widget/hud/HudPowderWidget.java40
1 files changed, 40 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..1d11c2a6
--- /dev/null
+++ b/src/main/java/de/hysky/skyblocker/skyblock/tabhud/widget/hud/HudPowderWidget.java
@@ -0,0 +1,40 @@
+package de.hysky.skyblocker.skyblock.tabhud.widget.hud;
+
+import de.hysky.skyblocker.skyblock.tabhud.util.Ico;
+import de.hysky.skyblocker.skyblock.tabhud.widget.Widget;
+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);
+ }
+
+}