diff options
author | xander <xander@isxander.dev> | 2022-09-15 19:22:40 +0100 |
---|---|---|
committer | xander <xander@isxander.dev> | 2022-09-15 19:22:40 +0100 |
commit | b9ce9513c8e55ed53321d78b6fbbd07aacd5e987 (patch) | |
tree | 445836336f061c0be2cf601ecc294022f0cace33 /src/testmod/java | |
parent | e8b6e383b368706c992425f7de7023f24d376d7c (diff) | |
download | YetAnotherConfigLib-b9ce9513c8e55ed53321d78b6fbbd07aacd5e987.tar.gz YetAnotherConfigLib-b9ce9513c8e55ed53321d78b6fbbd07aacd5e987.tar.bz2 YetAnotherConfigLib-b9ce9513c8e55ed53321d78b6fbbd07aacd5e987.zip |
available property + fix category tooltips not showing
Diffstat (limited to 'src/testmod/java')
-rw-r--r-- | src/testmod/java/dev/isxander/yacl/test/ModMenuIntegration.java | 37 |
1 files changed, 37 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 d1ef4d0..df81768 100644 --- a/src/testmod/java/dev/isxander/yacl/test/ModMenuIntegration.java +++ b/src/testmod/java/dev/isxander/yacl/test/ModMenuIntegration.java @@ -39,6 +39,11 @@ public class ModMenuIntegration implements ModMenuApi { .controller(ActionController::new) .action(screen -> MinecraftClient.getInstance().setScreen(getWikiGroups(screen))) .build()) + .option(ButtonOption.createBuilder() + .name(Text.of("Unavailable Test Suite")) + .controller(ActionController::new) + .action(screen -> MinecraftClient.getInstance().setScreen(getDisabledTest(screen))) + .build()) .build()) .build().generateScreen(parent); } @@ -311,6 +316,38 @@ public class ModMenuIntegration implements ModMenuApi { .build().generateScreen(parent); } + private Screen getDisabledTest(Screen parent) { + return YetAnotherConfigLib.createBuilder() + .title(Text.empty()) + .category(ConfigCategory.createBuilder() + .name(Text.of("Disabled Test")) + .option(Option.createBuilder(int.class) + .name(Text.of("Slider")) + .binding(Binding.immutable(0)) + .controller(opt -> new IntegerSliderController(opt, 0, 5, 1)) + .available(false) + .build()) + .option(Option.createBuilder(boolean.class) + .name(Text.of("Tick Box")) + .binding(Binding.immutable(true)) + .controller(TickBoxController::new) + .available(false) + .build()) + .option(Option.createBuilder(boolean.class) + .name(Text.of("Tick Box (Enabled)")) + .binding(Binding.immutable(true)) + .controller(TickBoxController::new) + .build()) + .option(Option.createBuilder(String.class) + .name(Text.of("Text Field")) + .binding(Binding.immutable("hi")) + .controller(StringController::new) + .available(false) + .build()) + .build()) + .build().generateScreen(parent); + } + private Screen getWikiBasic(Screen parent) { return YetAnotherConfigLib.createBuilder() .title(Text.of("Mod Name")) |