diff options
Diffstat (limited to 'test-common/src/main/java/dev')
-rw-r--r-- | test-common/src/main/java/dev/isxander/yacl3/test/ConfigV2Test.java | 9 | ||||
-rw-r--r-- | test-common/src/main/java/dev/isxander/yacl3/test/GuiTest.java | 5 |
2 files changed, 10 insertions, 4 deletions
diff --git a/test-common/src/main/java/dev/isxander/yacl3/test/ConfigV2Test.java b/test-common/src/main/java/dev/isxander/yacl3/test/ConfigV2Test.java index 6084e23..d287604 100644 --- a/test-common/src/main/java/dev/isxander/yacl3/test/ConfigV2Test.java +++ b/test-common/src/main/java/dev/isxander/yacl3/test/ConfigV2Test.java @@ -12,18 +12,21 @@ public class ConfigV2Test { public static ConfigClassHandler<ConfigV2Test> INSTANCE = ConfigClassHandler.createBuilder(ConfigV2Test.class) .id(new ResourceLocation("yacl3", "config")) .serializer(config -> GsonConfigSerializerBuilder.create(config) - .setPath(YACLPlatform.getConfigDir().resolve("yacl-test-v2.json")) + .setPath(YACLPlatform.getConfigDir().resolve("yacl-test-v2.json5")) + .setJson5(true) .build()) .autoGen(true) .build(); @AutoGen(category = "test", group = "master_test") @MasterTickBox({ "testTickBox", "testInt" }) - @SerialEntry public boolean masterOption = true; + @SerialEntry(comment = "This option does this and that which is cool because this...") + public boolean masterOption = true; @AutoGen(category = "test", group = "master_test") @TickBox - @SerialEntry public boolean testTickBox = true; + @SerialEntry(comment = "This is a cool comment omg this is amazing") + public boolean testTickBox = true; @AutoGen(category = "test", group = "master_test") @IntSlider(min = 0, max = 10, step = 2) diff --git a/test-common/src/main/java/dev/isxander/yacl3/test/GuiTest.java b/test-common/src/main/java/dev/isxander/yacl3/test/GuiTest.java index 2eadb2a..4953d0c 100644 --- a/test-common/src/main/java/dev/isxander/yacl3/test/GuiTest.java +++ b/test-common/src/main/java/dev/isxander/yacl3/test/GuiTest.java @@ -44,7 +44,10 @@ public class GuiTest { .build()) .option(ButtonOption.createBuilder() .name(Component.literal("Auto-gen test")) - .action((screen, opt) -> Minecraft.getInstance().setScreen(ConfigV2Test.INSTANCE.generateGui().generateScreen(screen))) + .action((screen, opt) -> { + ConfigV2Test.INSTANCE.serializer().deserialize(); + Minecraft.getInstance().setScreen(ConfigV2Test.INSTANCE.generateGui().generateScreen(screen)); + }) .build()) .group(OptionGroup.createBuilder() .name(Component.literal("Wiki")) |