diff options
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/test')
4 files changed, 221 insertions, 0 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/test/TestConfig.java b/src/main/java/cc/polyfrost/oneconfig/test/TestConfig.java new file mode 100644 index 0000000..b072f4c --- /dev/null +++ b/src/main/java/cc/polyfrost/oneconfig/test/TestConfig.java @@ -0,0 +1,128 @@ +package cc.polyfrost.oneconfig.test; + +import cc.polyfrost.oneconfig.config.annotations.ConfigPage; +import cc.polyfrost.oneconfig.config.annotations.Option; +import cc.polyfrost.oneconfig.config.data.Mod; +import cc.polyfrost.oneconfig.config.data.ModType; +import cc.polyfrost.oneconfig.config.data.OptionType; +import cc.polyfrost.oneconfig.config.data.PageLocation; +import cc.polyfrost.oneconfig.config.interfaces.Config; + +public class TestConfig extends Config { + + @Option( + name = "Test dual thing", + subcategory = "Test", + min = 3f, max = 127f, + type = OptionType.SLIDER + ) + public static float sliderText; + + @Option( + name = "Test string", + subcategory = "Test", + options = {"NO", "YES"}, + type = OptionType.DUAL_OPTION + ) + public static boolean switchTest1; + + @Option( + name = "Test dual option", + subcategory = "Test", + options = {"HI", "BYE"}, + type = OptionType.DUAL_OPTION + ) + public static boolean switchTest2; + + + @Option( + name = "Test option", + subcategory = "Test", + options = {"Hello", "World", "Fish", "Cat"}, + type = OptionType.UNI_SELECTOR + ) + public static int switchTest3; + + @ConfigPage( + name = "Test Page", + location = PageLocation.TOP + ) + public static TestPage testPage = new TestPage(); + + @ConfigPage( + name = "Test Page width description", + description = "Wow, an epic description", + location = PageLocation.BOTTOM + ) + public static TestPage testPage2 = new TestPage(); + + @Option( + name = "Test switch", + subcategory = "Other subcategory", + type = OptionType.SWITCH + ) + public static boolean switchTest4; + + @Option( + name = "Test checkbox", + subcategory = "Other subcategory", + type = OptionType.CHECKBOX + ) + public static boolean switchTest5; + + @Option( + name = "Favorite food", + subcategory = "Dropdowns", + type = OptionType.DROPDOWN, + category = "Dropdowns", + options = {"Taco", "Pizza", "Hamburger", "Paimon"} + ) + public static int dropdown1; + + @Option( + name = "Favorite food", + subcategory = "Dropdowns", + type = OptionType.DROPDOWN, + category = "Dropdowns", + options = {"Taco", "Pizza", "Hamburger", "Paimon"} + ) + public static int dropdown2; + + @Option( + name = "Favorite food", + subcategory = "Dropdowns", + type = OptionType.DROPDOWN, + category = "Dropdowns", + size = 2, + options = {"Taco", "Pizza", "Hamburger", "Paimon"} + ) + public static int dropdown3; + + @Option( + name = "Slider", + subcategory = "Sliders", + type = OptionType.SLIDER, + category = "Sliders", + size = 2, + min = 0, + max = 25 + ) + public static int slider1; + @Option( + name = "Stepped Slider", + subcategory = "Sliders", + type = OptionType.SLIDER, + category = "Sliders", + size = 2, + min = 0, + max = 30, + step = 2 + ) + public static float slider2; + + + public TestConfig() { + super(new Mod("hacks", ModType.UTIL_QOL, "ShadyDev", "1.0"), "hacksConfig.json"); + } +} + diff --git a/src/main/java/cc/polyfrost/oneconfig/test/TestHud.java b/src/main/java/cc/polyfrost/oneconfig/test/TestHud.java new file mode 100644 index 0000000..ccb7c6b --- /dev/null +++ b/src/main/java/cc/polyfrost/oneconfig/test/TestHud.java @@ -0,0 +1,23 @@ +package cc.polyfrost.oneconfig.test; + +import cc.polyfrost.oneconfig.hud.interfaces.BasicHud; +import cc.polyfrost.oneconfig.lwjgl.RenderManager; +import net.minecraft.client.Minecraft; + +public class TestHud extends BasicHud { + + @Override + public int getWidth(float scale) { + return (int) (Minecraft.getMinecraft().fontRendererObj.getStringWidth("FPS: " + Minecraft.getDebugFPS()) * scale); + } + + @Override + public int getHeight(float scale) { + return (int) (9 * scale); + } + + @Override + public void draw(int x, int y, float scale) { + RenderManager.drawScaledString("FPS: " + Minecraft.getDebugFPS(), x, y, 0xffffff, false, scale); + } +} diff --git a/src/main/java/cc/polyfrost/oneconfig/test/TestNanoVGGui.java b/src/main/java/cc/polyfrost/oneconfig/test/TestNanoVGGui.java new file mode 100644 index 0000000..60cfe2f --- /dev/null +++ b/src/main/java/cc/polyfrost/oneconfig/test/TestNanoVGGui.java @@ -0,0 +1,26 @@ +package cc.polyfrost.oneconfig.test; + +import cc.polyfrost.oneconfig.lwjgl.RenderManager; +import net.minecraft.client.gui.GuiScreen; + +import java.awt.*; + +public class TestNanoVGGui extends GuiScreen { + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + super.drawScreen(mouseX, mouseY, partialTicks); + drawRect(0, 0, width, height, Color.BLACK.getRGB()); + long startTime = System.nanoTime(); + RenderManager.setupAndDraw((vg) -> { + //RenderManager.drawRect(vg, 0, 0, 100, 100, Color.BLUE.getRGB()); + //RenderManager.drawRoundedRect(vg, 305, 305, 100, 100, Color.YELLOW.getRGB(), 8); + //RenderManager.drawString(vg, "Hello!", 80, 20, Color.WHITE.getRGB(), 50, Fonts.MC_REGULAR); + //RenderManager.drawString(vg, "Hello!", 100, 100, Color.WHITE.getRGB(), 50, Fonts.INTER_BOLD); + //RenderManager.drawLine(vg, 0, 0, 100, 100, 7, Color.PINK.getRGB()); + //RenderManager.drawCircle(vg, 200, 200, 50, Color.WHITE.getRGB()); + //RenderManager.drawString(vg, (float) (System.nanoTime() - startTime) / 1000000f + "ms", 500, 500, Color.WHITE.getRGB(), 100, Fonts.INTER_BOLD); + }); + drawString(fontRendererObj, "Hello!", 0, 0, -1); + } // hi +} diff --git a/src/main/java/cc/polyfrost/oneconfig/test/TestPage.java b/src/main/java/cc/polyfrost/oneconfig/test/TestPage.java new file mode 100644 index 0000000..c70610a --- /dev/null +++ b/src/main/java/cc/polyfrost/oneconfig/test/TestPage.java @@ -0,0 +1,44 @@ +package cc.polyfrost.oneconfig.test; + +import cc.polyfrost.oneconfig.config.annotations.Option; +import cc.polyfrost.oneconfig.config.data.OptionType; + +public class TestPage { + @Option( + name = "Text field 1x", + subcategory = "Test", + type = OptionType.TEXT + ) + public static String testDescription; + + @Option( + name = "Text field 1x", + subcategory = "Test", + type = OptionType.TEXT + ) + public static String testDescription2; + + @Option( + name = "Text field 2x", + subcategory = "Test", + type = OptionType.TEXT, + size = 2 + ) + public static String testDescription3; + + @Option( + name = "Secure text field", + subcategory = "Test", + type = OptionType.TEXT, + secure = true + ) + public static String testDescription4; + + @Option( + name = "Text box", + subcategory = "Test", + type = OptionType.TEXT, + multiLine = true + ) + public static String testDescription5; +} |