aboutsummaryrefslogtreecommitdiff
path: root/src/testmod/java/dev/isxander/yacl/test/ModMenuIntegration.java
diff options
context:
space:
mode:
authorxander <xander@isxander.dev>2022-09-03 17:39:31 +0100
committerxander <xander@isxander.dev>2022-09-03 17:39:31 +0100
commit7d3668fc2e76dd18cf40d964e2ea1a9676fbf56d (patch)
tree6a1ea4317995dac2262a4a25469ff7dacaed2815 /src/testmod/java/dev/isxander/yacl/test/ModMenuIntegration.java
parentb629229b96cb17b130f406893a219a7cd8c0e10f (diff)
downloadYetAnotherConfigLib-7d3668fc2e76dd18cf40d964e2ea1a9676fbf56d.tar.gz
YetAnotherConfigLib-7d3668fc2e76dd18cf40d964e2ea1a9676fbf56d.tar.bz2
YetAnotherConfigLib-7d3668fc2e76dd18cf40d964e2ea1a9676fbf56d.zip
re-organising testmod
Diffstat (limited to 'src/testmod/java/dev/isxander/yacl/test/ModMenuIntegration.java')
-rw-r--r--src/testmod/java/dev/isxander/yacl/test/ModMenuIntegration.java35
1 files changed, 28 insertions, 7 deletions
diff --git a/src/testmod/java/dev/isxander/yacl/test/ModMenuIntegration.java b/src/testmod/java/dev/isxander/yacl/test/ModMenuIntegration.java
index 69d09b9..ac313e2 100644
--- a/src/testmod/java/dev/isxander/yacl/test/ModMenuIntegration.java
+++ b/src/testmod/java/dev/isxander/yacl/test/ModMenuIntegration.java
@@ -12,6 +12,7 @@ import dev.isxander.yacl.gui.controllers.slider.FloatSliderController;
import dev.isxander.yacl.gui.controllers.slider.IntegerSliderController;
import dev.isxander.yacl.gui.controllers.slider.LongSliderController;
import net.minecraft.client.MinecraftClient;
+import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.option.GraphicsMode;
import net.minecraft.client.toast.SystemToast;
import net.minecraft.text.Text;
@@ -19,11 +20,31 @@ import net.minecraft.text.Text;
public class ModMenuIntegration implements ModMenuApi {
@Override
public ConfigScreenFactory<?> getModConfigScreenFactory() {
- return getFullTestSuite();
+ return (parent) -> YetAnotherConfigLib.createBuilder()
+ .title(Text.of("Test Suites"))
+ .category(ConfigCategory.createBuilder()
+ .name(Text.of("Suites"))
+ .option(ButtonOption.createBuilder()
+ .name(Text.of("Full Test Suite"))
+ .controller(ActionController::new)
+ .action(screen -> MinecraftClient.getInstance().setScreen(getFullTestSuite(screen)))
+ .build())
+ .option(ButtonOption.createBuilder()
+ .name(Text.of("Basic Wiki Suite"))
+ .controller(ActionController::new)
+ .action(screen -> MinecraftClient.getInstance().setScreen(getWikiBasic(screen)))
+ .build())
+ .option(ButtonOption.createBuilder()
+ .name(Text.of("Group Wiki Suite"))
+ .controller(ActionController::new)
+ .action(screen -> MinecraftClient.getInstance().setScreen(getWikiGroups(screen)))
+ .build())
+ .build())
+ .build().generateScreen(parent);
}
- private ConfigScreenFactory<?> getFullTestSuite() {
- return (parent) -> YetAnotherConfigLib.createBuilder()
+ private Screen getFullTestSuite(Screen parent) {
+ return YetAnotherConfigLib.createBuilder()
.title(Text.of("Test GUI"))
.category(ConfigCategory.createBuilder()
.name(Text.of("Control Examples"))
@@ -263,8 +284,8 @@ public class ModMenuIntegration implements ModMenuApi {
.build().generateScreen(parent);
}
- private ConfigScreenFactory<?> getWikiBasic() {
- return (parent) -> YetAnotherConfigLib.createBuilder()
+ private Screen getWikiBasic(Screen parent) {
+ return YetAnotherConfigLib.createBuilder()
.title(Text.of("Mod Name"))
.category(ConfigCategory.createBuilder()
.name(Text.of("My Category"))
@@ -285,8 +306,8 @@ public class ModMenuIntegration implements ModMenuApi {
.generateScreen(parent);
}
- private ConfigScreenFactory<?> getWikiGroups() {
- return (parent) -> YetAnotherConfigLib.createBuilder()
+ private Screen getWikiGroups(Screen parent) {
+ return YetAnotherConfigLib.createBuilder()
.title(Text.of("Mod Name"))
.category(ConfigCategory.createBuilder()
.name(Text.of("My Category"))