aboutsummaryrefslogtreecommitdiff
path: root/src/testmod/java/dev/isxander
diff options
context:
space:
mode:
authorxander <xander@isxander.dev>2022-09-01 12:20:05 +0100
committerxander <xander@isxander.dev>2022-09-01 12:20:05 +0100
commit21728802a4ee2b65a32b626140ff01bf59a456c6 (patch)
treeb20264e89856295df3d679a8a47574597e429408 /src/testmod/java/dev/isxander
parent4d977cc9764ecf0073650f126700f6ff638fa06b (diff)
downloadYetAnotherConfigLib-21728802a4ee2b65a32b626140ff01bf59a456c6.tar.gz
YetAnotherConfigLib-21728802a4ee2b65a32b626140ff01bf59a456c6.tar.bz2
YetAnotherConfigLib-21728802a4ee2b65a32b626140ff01bf59a456c6.zip
make tickbox separate controller from on off text
Diffstat (limited to 'src/testmod/java/dev/isxander')
-rw-r--r--src/testmod/java/dev/isxander/yacl/test/ModMenuIntegration.java79
1 files changed, 79 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 e7fa794..0c39ff6 100644
--- a/src/testmod/java/dev/isxander/yacl/test/ModMenuIntegration.java
+++ b/src/testmod/java/dev/isxander/yacl/test/ModMenuIntegration.java
@@ -4,6 +4,7 @@ import com.terraformersmc.modmenu.api.ConfigScreenFactory;
import com.terraformersmc.modmenu.api.ModMenuApi;
import dev.isxander.yacl.api.*;
import dev.isxander.yacl.gui.controllers.ActionController;
+import dev.isxander.yacl.gui.controllers.BooleanController;
import dev.isxander.yacl.gui.controllers.EnumController;
import dev.isxander.yacl.gui.controllers.TickBoxController;
import dev.isxander.yacl.gui.controllers.slider.DoubleSliderController;
@@ -22,6 +23,15 @@ public class ModMenuIntegration implements ModMenuApi {
.category(ConfigCategory.createBuilder()
.name(Text.of("Control Examples"))
.option(Option.createBuilder(boolean.class)
+ .name(Text.of("Boolean Toggle"))
+ .binding(
+ false,
+ () -> TestSettings.booleanToggle,
+ (value) -> TestSettings.booleanToggle = value
+ )
+ .controller(BooleanController::new)
+ .build())
+ .option(Option.createBuilder(boolean.class)
.name(Text.of("Tick Box"))
.tooltip(Text.of("Super long tooltip that is very descriptive to show off the text wrapping features of the thingy yes whwowwoow"))
.binding(
@@ -127,10 +137,79 @@ public class ModMenuIntegration implements ModMenuApi {
.build())
.build())
.build())
+ .category(ConfigCategory.createBuilder()
+ .name(Text.of("Scroll Test"))
+ .option(ButtonOption.createBuilder()
+ .name(Text.of("Option"))
+ .action(() -> {})
+ .controller(ActionController::new)
+ .build())
+ .option(ButtonOption.createBuilder()
+ .name(Text.of("Option"))
+ .action(() -> {})
+ .controller(ActionController::new)
+ .build())
+ .option(ButtonOption.createBuilder()
+ .name(Text.of("Option"))
+ .action(() -> {})
+ .controller(ActionController::new)
+ .build())
+ .option(ButtonOption.createBuilder()
+ .name(Text.of("Option"))
+ .action(() -> {})
+ .controller(ActionController::new)
+ .build())
+ .option(ButtonOption.createBuilder()
+ .name(Text.of("Option"))
+ .action(() -> {})
+ .controller(ActionController::new)
+ .build())
+ .option(ButtonOption.createBuilder()
+ .name(Text.of("Option"))
+ .action(() -> {})
+ .controller(ActionController::new)
+ .build())
+ .option(ButtonOption.createBuilder()
+ .name(Text.of("Option"))
+ .action(() -> {})
+ .controller(ActionController::new)
+ .build())
+ .option(ButtonOption.createBuilder()
+ .name(Text.of("Option"))
+ .action(() -> {})
+ .controller(ActionController::new)
+ .build())
+ .option(ButtonOption.createBuilder()
+ .name(Text.of("Option"))
+ .action(() -> {})
+ .controller(ActionController::new)
+ .build())
+ .option(ButtonOption.createBuilder()
+ .name(Text.of("Option"))
+ .action(() -> {})
+ .controller(ActionController::new)
+ .build())
+ .option(ButtonOption.createBuilder()
+ .name(Text.of("Option"))
+ .action(() -> {})
+ .controller(ActionController::new)
+ .build())
+ .option(ButtonOption.createBuilder()
+ .name(Text.of("Option"))
+ .action(() -> {})
+ .controller(ActionController::new)
+ .build())
+ .option(ButtonOption.createBuilder()
+ .name(Text.of("Option"))
+ .action(() -> {})
+ .controller(ActionController::new)
+ .build())
+ .build())
.build().generateScreen(parent);
}
private static class TestSettings {
+ private static boolean booleanToggle = false;
private static boolean tickbox = false;
private static int intSlider = 0;
private static double doubleSlider = 0;