From 1a882c234c8e2e352cad8c820567bbe140355675 Mon Sep 17 00:00:00 2001 From: DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> Date: Sun, 5 Jun 2022 18:12:19 +0200 Subject: hud options things --- .../java/cc/polyfrost/oneconfig/test/TestHud.java | 24 ++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'src/main/java/cc/polyfrost/oneconfig/test') diff --git a/src/main/java/cc/polyfrost/oneconfig/test/TestHud.java b/src/main/java/cc/polyfrost/oneconfig/test/TestHud.java index d11340c..930d827 100644 --- a/src/main/java/cc/polyfrost/oneconfig/test/TestHud.java +++ b/src/main/java/cc/polyfrost/oneconfig/test/TestHud.java @@ -1,15 +1,35 @@ package cc.polyfrost.oneconfig.test; +import cc.polyfrost.oneconfig.config.annotations.Option; +import cc.polyfrost.oneconfig.config.data.OptionType; import cc.polyfrost.oneconfig.hud.TextHud; import net.minecraft.client.Minecraft; +import java.util.ArrayList; +import java.util.List; + public class TestHud extends TextHud { public TestHud(boolean enabled, int x, int y) { super(enabled, x, y); } @Override - public String getText() { - return "FPS: " + Minecraft.getDebugFPS(); + public List getLines() { + ArrayList lines = new ArrayList<>(); + lines.add("FPS: " + Minecraft.getDebugFPS()); + if (hasSecondLine) lines.add(secondLine); + return lines; } + + @Option( + name = "Enable Second Line", + type = OptionType.SWITCH + ) + public boolean hasSecondLine = false; + + @Option( + name = "Second Line Text", + type = OptionType.TEXT + ) + public String secondLine = "Epic text"; } -- cgit