diff options
author | Wyvest <45589059+Wyvest@users.noreply.github.com> | 2022-06-24 23:44:58 +0700 |
---|---|---|
committer | Wyvest <45589059+Wyvest@users.noreply.github.com> | 2022-06-24 23:44:58 +0700 |
commit | f1830199d99b666f28c2b3b246f688f102adb427 (patch) | |
tree | 07fba5e7fce5e523223e8fc9da70f7783d7f15f9 /src/main/java/cc/polyfrost/oneconfig/test/TestHud_Test.java | |
parent | d4463b33342ccb5ea86c2a2c9da37b9b861b6674 (diff) | |
download | OneConfig-f1830199d99b666f28c2b3b246f688f102adb427.tar.gz OneConfig-f1830199d99b666f28c2b3b246f688f102adb427.tar.bz2 OneConfig-f1830199d99b666f28c2b3b246f688f102adb427.zip |
TextHud revamp
add docs to Hud
fix config not saving when exiting prematurely
some new events
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/test/TestHud_Test.java')
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/test/TestHud_Test.java | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/test/TestHud_Test.java b/src/main/java/cc/polyfrost/oneconfig/test/TestHud_Test.java index 0de9d65..9982e7d 100644 --- a/src/main/java/cc/polyfrost/oneconfig/test/TestHud_Test.java +++ b/src/main/java/cc/polyfrost/oneconfig/test/TestHud_Test.java @@ -1,33 +1,26 @@ package cc.polyfrost.oneconfig.test; import cc.polyfrost.oneconfig.config.annotations.Switch; -import cc.polyfrost.oneconfig.config.annotations.Text; -import cc.polyfrost.oneconfig.hud.TextHud; +import cc.polyfrost.oneconfig.hud.SingleTextHud; import net.minecraft.client.Minecraft; -import java.util.ArrayList; -import java.util.List; +public class TestHud_Test extends SingleTextHud { + @Switch( + name = "Custom Option" + ) + public boolean yes; -public class TestHud_Test extends TextHud { public TestHud_Test(boolean enabled, int x, int y) { super(enabled, x, y); } @Override - public List<String> getLines() { - ArrayList<String> lines = new ArrayList<>(); - lines.add("FPS: " + Minecraft.getDebugFPS()); - if (hasSecondLine) lines.add(secondLine); - return lines; + public String getDefaultTitle() { + return "FPS"; } - @Switch( - name = "Has Second Line" - ) - public boolean hasSecondLine = false; - - @Text( - name = "Second Line Text" - ) - public String secondLine = "Epic text"; + @Override + public String getText() { + return Integer.toString(Minecraft.getDebugFPS()); + } } |