From 33e98c7edc1404e099f9c9bcc586fd5c55cb8bdd Mon Sep 17 00:00:00 2001 From: isXander Date: Sun, 18 Sep 2022 19:14:58 +0100 Subject: 1.3.0 option tooltips now consume the pending value PlaceholderCategory: a category that when selected, just opens a screen --- src/testmod/java/dev/isxander/yacl/test/ModMenuIntegration.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/testmod/java/dev/isxander/yacl') 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) -- cgit