diff options
author | xander <xander@isxander.dev> | 2022-09-02 10:45:53 +0100 |
---|---|---|
committer | xander <xander@isxander.dev> | 2022-09-02 10:45:53 +0100 |
commit | 7bfbbc908d53c379fa36a929282e7f20b95afde8 (patch) | |
tree | 939adcb7460f08bfb2335f94b26d114c2dd05dcf /src/testmod/java/dev/isxander | |
parent | cff8d5bad318d133ab1089524619fc15f3b15b6f (diff) | |
download | YetAnotherConfigLib-7bfbbc908d53c379fa36a929282e7f20b95afde8.tar.gz YetAnotherConfigLib-7bfbbc908d53c379fa36a929282e7f20b95afde8.tar.bz2 YetAnotherConfigLib-7bfbbc908d53c379fa36a929282e7f20b95afde8.zip |
fix group validation & icon & wiki test stuff
Diffstat (limited to 'src/testmod/java/dev/isxander')
-rw-r--r-- | src/testmod/java/dev/isxander/yacl/test/ModMenuIntegration.java | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/src/testmod/java/dev/isxander/yacl/test/ModMenuIntegration.java b/src/testmod/java/dev/isxander/yacl/test/ModMenuIntegration.java index d71a83b..8776c16 100644 --- a/src/testmod/java/dev/isxander/yacl/test/ModMenuIntegration.java +++ b/src/testmod/java/dev/isxander/yacl/test/ModMenuIntegration.java @@ -18,6 +18,10 @@ import net.minecraft.text.Text; public class ModMenuIntegration implements ModMenuApi { @Override public ConfigScreenFactory<?> getModConfigScreenFactory() { + return getWikiButton(); + } + + private ConfigScreenFactory<?> getFullTestSuite() { return (parent) -> YetAnotherConfigLib.createBuilder() .title(Text.of("Test GUI")) .category(ConfigCategory.createBuilder() @@ -218,6 +222,71 @@ public class ModMenuIntegration implements ModMenuApi { .build().generateScreen(parent); } + private ConfigScreenFactory<?> getWikiBasic() { + return (parent) -> YetAnotherConfigLib.createBuilder() + .title(Text.of("Mod Name")) + .category(ConfigCategory.createBuilder() + .name(Text.of("My Category")) + .tooltip(Text.of("This displays when you hover over a category button")) // optional + .option(Option.createBuilder(boolean.class) + .name(Text.of("My Boolean Option")) + .tooltip(Text.of("This option displays the basic capabilities of YetAnotherConfigLib")) // optional + .binding( + true, // default + () -> TestSettings.booleanToggle, // getter + newValue -> TestSettings.booleanToggle = newValue // setter + ) + .controller(BooleanController::new) + .build()) + .build()) + .save(TestSettings::save) + .build() + .generateScreen(parent); + } + + private ConfigScreenFactory<?> getWikiGroups() { + return (parent) -> YetAnotherConfigLib.createBuilder() + .title(Text.of("Mod Name")) + .category(ConfigCategory.createBuilder() + .name(Text.of("My Category")) + .tooltip(Text.of("This displays when you hover over a category button")) // optional + .group(OptionGroup.createBuilder() + .name(Text.of("Option Group")) + .option(Option.createBuilder(boolean.class) + .name(Text.of("My Boolean Option")) + .tooltip(Text.of("This option displays the basic capabilities of YetAnotherConfigLib")) // optional + .binding( + true, // default + () -> TestSettings.booleanToggle, // getter + newValue -> TestSettings.booleanToggle = newValue // setter + ) + .controller(BooleanController::new) + .build()) + .build()) + .build()) + .save(TestSettings::save) + .build() + .generateScreen(parent); + } + + private ConfigScreenFactory<?> getWikiButton() { + return (parent) -> YetAnotherConfigLib.createBuilder() + .title(Text.of("Mod Name")) + .category(ConfigCategory.createBuilder() + .name(Text.of("My Category")) + .tooltip(Text.of("This displays when you hover over a category button")) // optional + .option(ButtonOption.createBuilder() + .name(Text.of("Pressable Button")) + .tooltip(Text.of("This is so easy!")) // optional + .action(() -> {}) + .controller(ActionController::new) + .build()) + .build()) + .save(TestSettings::save) + .build() + .generateScreen(parent); + } + private static class TestSettings { private static boolean booleanToggle = false; private static boolean tickbox = false; @@ -237,5 +306,9 @@ public class ModMenuIntegration implements ModMenuApi { public enum Alphabet { A, B, C } + + public static void save() { + + } } } |