From ca8c9a40cbd393ddc1559382fb29a7f3a7c3a646 Mon Sep 17 00:00:00 2001 From: hackthetime Date: Thu, 16 Nov 2023 11:24:20 +0100 Subject: working on moulconfig. re-added debug thread instead of using execution service because it slowly but surely takes all threads. --- .../hype/bbsentials/forge/client/MoulConfig.java | 8 ++-- .../forge/client/categories/FirstCategory.java | 54 ++++++++++++++++++++++ 2 files changed, 57 insertions(+), 5 deletions(-) create mode 100644 forge/src/main/java/de/hype/bbsentials/forge/client/categories/FirstCategory.java (limited to 'forge') diff --git a/forge/src/main/java/de/hype/bbsentials/forge/client/MoulConfig.java b/forge/src/main/java/de/hype/bbsentials/forge/client/MoulConfig.java index 24bca8a..93ecd99 100644 --- a/forge/src/main/java/de/hype/bbsentials/forge/client/MoulConfig.java +++ b/forge/src/main/java/de/hype/bbsentials/forge/client/MoulConfig.java @@ -1,6 +1,7 @@ package de.hype.bbsentials.forge.client; import com.google.gson.annotations.Expose; +import de.hype.bbsentials.forge.client.categories.FirstCategory; import io.github.moulberry.moulconfig.Config; import io.github.moulberry.moulconfig.annotations.Category; import io.github.moulberry.moulconfig.annotations.ConfigEditorDropdown; @@ -11,20 +12,17 @@ import io.github.moulberry.moulconfig.processor.BuiltinMoulConfigGuis; import io.github.moulberry.moulconfig.processor.ConfigProcessorDriver; import io.github.moulberry.moulconfig.processor.MoulConfigProcessor; import net.minecraft.client.Minecraft; +import net.minecraftforge.common.config.ConfigCategory; import static de.hype.bbsentials.common.client.BBsentials.config; public class MoulConfig extends Config { - @Expose - @ConfigOption(name = "test", desc = "dropdown test") - @ConfigEditorDropdown(values = {"hi", "test"}) - public String test; MoulConfigEditor editor; MoulConfigProcessor processor; @Expose @Category(name = "First Category", desc = "This is the first category.") - MoulConfig main = this; + public FirstCategory firstCategory = new FirstCategory(); public MoulConfig() { processor = new MoulConfigProcessor<>(this); diff --git a/forge/src/main/java/de/hype/bbsentials/forge/client/categories/FirstCategory.java b/forge/src/main/java/de/hype/bbsentials/forge/client/categories/FirstCategory.java new file mode 100644 index 0000000..05aa511 --- /dev/null +++ b/forge/src/main/java/de/hype/bbsentials/forge/client/categories/FirstCategory.java @@ -0,0 +1,54 @@ +package de.hype.bbsentials.forge.client.categories; + +import com.google.gson.annotations.Expose; +import io.github.moulberry.moulconfig.annotations.*; + +import java.awt.*; + +public class FirstCategory { + @Expose + @ConfigOption(name = "ConfigEditorDropdown", desc = "ConfigEditorDropdown") + @ConfigEditorDropdown(values = {"hi", "test"}) + public String test; + + @Expose + @ConfigOption(name = "First Toggle", desc = "Enable this toggle to activate a feature.") + @ConfigEditorBoolean + public boolean firstToggle = false; + + @Expose + @ConfigOption(name = "Color Editor", desc = "Color Editor") + @ConfigEditorColour + public Color color = Color.RED; + + @Expose + @ConfigOption(name = "ConfigEditorInfoText", desc = "Info Text Sample") + @ConfigEditorInfoText(infoTitle = "ยง6Info Text Sample") + public String text = ""; + + @Expose + @ConfigOption(name = "Text Example", desc = "Text Sample") + @ConfigEditorText + public String textSample = ""; + + @Expose + @ConfigOption(name = "Slider Example", desc = "Slider Sample") + @ConfigEditorSlider(minStep = 10, maxValue = 100, minValue = 0) + public int i = 0; + +// @Expose +// @ConfigOption(name = "Keybinding Example", desc = "Keybinding Sample") +// @ConfigEditorKeybind(defaultKey = 12) +// public ConfigEditorKeybind keybind = new KeyBinding("Craft",12,""); +// +// @Expose +// @ConfigOption(name = "Button Example", desc = "Button Sample") +// @ConfigEditorButton +// public ConfigEditorButton button = new ConfigEditorButton(); +// @Expose +// @ConfigOption(name = "Draggable List Example", desc = "Draggable List Sample") +// @ConfigEditorDraggableList +// public ConfigEditorDraggableList draggableList = new ConfigEditorDraggableList(); + + +} -- cgit