diff options
author | isXander <isxander@users.noreply.github.com> | 2022-09-18 19:14:58 +0100 |
---|---|---|
committer | isXander <isxander@users.noreply.github.com> | 2022-09-18 19:15:09 +0100 |
commit | 33e98c7edc1404e099f9c9bcc586fd5c55cb8bdd (patch) | |
tree | a964082d62c3b13f5628c036fe49f9ea19d32315 /src/testmod/java/dev/isxander/yacl/test/ModMenuIntegration.java | |
parent | 564a028eed25cfce0e0486f1a1a21affb499a311 (diff) | |
download | YetAnotherConfigLib-33e98c7edc1404e099f9c9bcc586fd5c55cb8bdd.tar.gz YetAnotherConfigLib-33e98c7edc1404e099f9c9bcc586fd5c55cb8bdd.tar.bz2 YetAnotherConfigLib-33e98c7edc1404e099f9c9bcc586fd5c55cb8bdd.zip |
1.3.0
option tooltips now consume the pending value
PlaceholderCategory: a category that when selected, just opens a screen
Diffstat (limited to 'src/testmod/java/dev/isxander/yacl/test/ModMenuIntegration.java')
-rw-r--r-- | src/testmod/java/dev/isxander/yacl/test/ModMenuIntegration.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/testmod/java/dev/isxander/yacl/test/ModMenuIntegration.java b/src/testmod/java/dev/isxander/yacl/test/ModMenuIntegration.java index df81768..944246d 100644 --- a/src/testmod/java/dev/isxander/yacl/test/ModMenuIntegration.java +++ b/src/testmod/java/dev/isxander/yacl/test/ModMenuIntegration.java @@ -3,6 +3,7 @@ package dev.isxander.yacl.test; import com.terraformersmc.modmenu.api.ConfigScreenFactory; import com.terraformersmc.modmenu.api.ModMenuApi; import dev.isxander.yacl.api.*; +import dev.isxander.yacl.gui.RequireRestartScreen; import dev.isxander.yacl.gui.controllers.*; import dev.isxander.yacl.gui.controllers.slider.DoubleSliderController; import dev.isxander.yacl.gui.controllers.slider.FloatSliderController; @@ -10,6 +11,7 @@ import dev.isxander.yacl.gui.controllers.slider.IntegerSliderController; import dev.isxander.yacl.gui.controllers.slider.LongSliderController; import dev.isxander.yacl.gui.controllers.string.StringController; import net.minecraft.client.MinecraftClient; +import net.minecraft.client.gui.screen.MessageScreen; import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.option.GraphicsMode; import net.minecraft.client.toast.SystemToast; @@ -60,7 +62,7 @@ public class ModMenuIntegration implements ModMenuApi { .collapsed(true) .option(Option.createBuilder(boolean.class) .name(Text.of("Boolean Toggle")) - .tooltip(Text.of("A simple toggle button.")) + .tooltip(value -> Text.of("A simple toggle button that contains the value '" + value + "'")) .binding( false, () -> TestSettings.booleanToggle, @@ -190,6 +192,10 @@ public class ModMenuIntegration implements ModMenuApi { .build()) .build()) .build()) + .category(PlaceholderCategory.createBuilder() + .name(Text.of("Placeholder Category")) + .screen((client, yaclScreen) -> new RequireRestartScreen(yaclScreen)) + .build()) .category(ConfigCategory.createBuilder() .name(Text.of("Group Test")) .option(Option.createBuilder(boolean.class) |