aboutsummaryrefslogtreecommitdiff
path: root/test-common/src/main/java/dev/isxander/yacl3/test
diff options
context:
space:
mode:
authorRasmion <42215949+Rasmion@users.noreply.github.com>2023-10-22 23:08:01 +0200
committerGitHub <noreply@github.com>2023-10-22 22:08:01 +0100
commita2d8b2de90b76c081d55e82853a0ec67f7c868d9 (patch)
treeb1c46a4d132d0df496e364d044c6a74df7f536de /test-common/src/main/java/dev/isxander/yacl3/test
parentec17d3cc159e58b1bcd8fffbb91d98f1df5c97e4 (diff)
downloadYetAnotherConfigLib-a2d8b2de90b76c081d55e82853a0ec67f7c868d9.tar.gz
YetAnotherConfigLib-a2d8b2de90b76c081d55e82853a0ec67f7c868d9.tar.bz2
YetAnotherConfigLib-a2d8b2de90b76c081d55e82853a0ec67f7c868d9.zip
Bug fixes, quality of life changes, visual changes (#108)
Diffstat (limited to 'test-common/src/main/java/dev/isxander/yacl3/test')
-rw-r--r--test-common/src/main/java/dev/isxander/yacl3/test/GuiTest.java42
1 files changed, 21 insertions, 21 deletions
diff --git a/test-common/src/main/java/dev/isxander/yacl3/test/GuiTest.java b/test-common/src/main/java/dev/isxander/yacl3/test/GuiTest.java
index 31942be..3b5c122 100644
--- a/test-common/src/main/java/dev/isxander/yacl3/test/GuiTest.java
+++ b/test-common/src/main/java/dev/isxander/yacl3/test/GuiTest.java
@@ -105,7 +105,7 @@ public class GuiTest {
.name(Component.literal("Custom Boolean Toggle"))
.description(val -> OptionDescription.createBuilder()
.text(Component.literal("You can customize controllers like so! YACL is truly infinitely customizable! This tooltip is long in order to demonstrate the cool, smooth scrolling of these descriptions. Did you know, they are also super clickable?! I know, cool right, YACL 3.x really is amazing."))
- .image(Path.of("D:\\Xander\\Downloads\\_MG_0860-Enhanced-NR.png"), new ResourceLocation("yacl", "f.webp"))
+ .image(Path.of("D:\\Xander\\Downloads\\_MG_0860-Enhanced-NR.png"), new ResourceLocation("yacl", "f.webp")) // TODO: Add img file to git?
.build())
.binding(
defaults.customBooleanToggle,
@@ -113,7 +113,7 @@ public class GuiTest {
(value) -> config.customBooleanToggle = value
)
.controller(opt -> BooleanControllerBuilder.create(opt)
- .valueFormatter(state -> state ? Component.literal("Amazing") : Component.literal("Not Amazing"))
+ .formatValue(state -> state ? Component.literal("Amazing") : Component.literal("Not Amazing"))
.coloured(true))
.listener((opt, val) -> booleanOption.get().setAvailable(val))
.build())
@@ -130,7 +130,7 @@ public class GuiTest {
.build())
.group(OptionGroup.createBuilder()
.name(Component.literal("Slider Controllers"))
- .option(Option.createBuilder(int.class)
+ .option(Option.<Integer>createBuilder()
.name(Component.literal("Int Slider"))
.instant(true)
.binding(
@@ -141,7 +141,7 @@ public class GuiTest {
)
.customController(opt -> new IntegerSliderController(opt, 0, 3, 1))
.build())
- .option(Option.createBuilder(double.class)
+ .option(Option.<Double>createBuilder()
.name(Component.literal("Double Slider"))
.binding(
defaults.doubleSlider,
@@ -150,7 +150,7 @@ public class GuiTest {
)
.customController(opt -> new DoubleSliderController(opt, 0, 3, 0.05))
.build())
- .option(Option.createBuilder(float.class)
+ .option(Option.<Float>createBuilder()
.name(Component.literal("Float Slider"))
.binding(
defaults.floatSlider,
@@ -159,7 +159,7 @@ public class GuiTest {
)
.customController(opt -> new FloatSliderController(opt, 0, 3, 0.1f))
.build())
- .option(Option.createBuilder(long.class)
+ .option(Option.<Long>createBuilder()
.name(Component.literal("Long Slider"))
.binding(
defaults.longSlider,
@@ -171,7 +171,7 @@ public class GuiTest {
.build())
.group(OptionGroup.createBuilder()
.name(Component.literal("Input Field Controllers"))
- .option(Option.createBuilder(String.class)
+ .option(Option.<String>createBuilder()
.name(Component.literal("Component Option"))
.binding(
defaults.textField,
@@ -180,7 +180,7 @@ public class GuiTest {
)
.customController(StringController::new)
.build())
- .option(Option.createBuilder(Color.class)
+ .option(Option.<Color>createBuilder()
.name(Component.literal("Color Option"))
.binding(
defaults.colorOption,
@@ -192,7 +192,7 @@ public class GuiTest {
.build())
.group(OptionGroup.createBuilder()
.name(Component.literal("Number Fields"))
- .option(Option.createBuilder(double.class)
+ .option(Option.<Double>createBuilder()
.name(Component.literal("Double Field"))
.binding(
defaults.doubleField,
@@ -201,7 +201,7 @@ public class GuiTest {
)
.customController(DoubleFieldController::new)
.build())
- .option(Option.createBuilder(float.class)
+ .option(Option.<Float>createBuilder()
.name(Component.literal("Float Field"))
.binding(
defaults.floatField,
@@ -210,7 +210,7 @@ public class GuiTest {
)
.customController(FloatFieldController::new)
.build())
- .option(Option.createBuilder(int.class)
+ .option(Option.<Integer>createBuilder()
.name(Component.literal("Integer Field"))
.binding(
defaults.intField,
@@ -219,7 +219,7 @@ public class GuiTest {
)
.customController(IntegerFieldController::new)
.build())
- .option(Option.createBuilder(long.class)
+ .option(Option.<Long>createBuilder()
.name(Component.literal("Long Field"))
.binding(
defaults.longField,
@@ -231,7 +231,7 @@ public class GuiTest {
.build())
.group(OptionGroup.createBuilder()
.name(Component.literal("Enum Controllers"))
- .option(Option.createBuilder(ConfigTest.Alphabet.class)
+ .option(Option.<ConfigTest.Alphabet>createBuilder()
.name(Component.literal("Enum Cycler"))
.binding(
defaults.enumOption,
@@ -294,7 +294,7 @@ public class GuiTest {
.group(OptionGroup.createBuilder()
.name(Component.literal("Minecraft Bindings"))
.description(OptionDescription.of(Component.literal("YACL can also bind Minecraft options!")))
- .option(Option.createBuilder(boolean.class)
+ .option(Option.<Boolean>createBuilder()
.name(Component.literal("Minecraft AutoJump"))
.description(OptionDescription.of(Component.literal("You can even bind minecraft options!")))
.binding(Binding.minecraft(Minecraft.getInstance().options.autoJump()))
@@ -309,7 +309,7 @@ public class GuiTest {
.build())
.category(ConfigCategory.createBuilder()
.name(Component.literal("List Test"))
- .group(ListOption.createBuilder(String.class)
+ .group(ListOption.<String>createBuilder()
.name(Component.literal("String List"))
.binding(
defaults.stringList,
@@ -334,7 +334,7 @@ public class GuiTest {
.initial(0)
.available(false)
.build())
- .group(ListOption.createBuilder(Component.class)
+ .group(ListOption.<Component>createBuilder()
.name(Component.literal("Useless Label List"))
.binding(Binding.immutable(List.of(Component.literal("It's quite impressive that literally every single controller works, without problem."))))
.customController(LabelController::new)
@@ -343,7 +343,7 @@ public class GuiTest {
.build())
.category(ConfigCategory.createBuilder()
.name(Component.literal("Group Test"))
- .option(Option.createBuilder(boolean.class)
+ .option(Option.<Boolean>createBuilder()
.name(Component.literal("Root Test"))
.binding(
defaults.groupTestRoot,
@@ -354,7 +354,7 @@ public class GuiTest {
.build())
.group(OptionGroup.createBuilder()
.name(Component.literal("First Group"))
- .option(Option.createBuilder(boolean.class)
+ .option(Option.<Boolean>createBuilder()
.name(Component.literal("First Group Test 1"))
.binding(
defaults.groupTestFirstGroup,
@@ -363,7 +363,7 @@ public class GuiTest {
)
.customController(TickBoxController::new)
.build())
- .option(Option.createBuilder(boolean.class)
+ .option(Option.<Boolean>createBuilder()
.name(Component.literal("First Group Test 2"))
.binding(
defaults.groupTestFirstGroup2,
@@ -375,7 +375,7 @@ public class GuiTest {
.build())
.group(OptionGroup.createBuilder()
.name(Component.empty())
- .option(Option.createBuilder(boolean.class)
+ .option(Option.<Boolean>createBuilder()
.name(Component.literal("Second Group Test"))
.binding(
defaults.groupTestSecondGroup,
@@ -437,7 +437,7 @@ public class GuiTest {
.group(OptionGroup.createBuilder()
.name(Component.literal("Name of the group"))
.description(OptionDescription.of(Component.literal("This Component will appear when you hover over the name or focus on the collapse button with Tab.")))
- .option(Option.createBuilder(boolean.class)
+ .option(Option.<Boolean>createBuilder()
.name(Component.literal("Boolean Option"))
.description(OptionDescription.of(Component.literal("This Component will appear as a tooltip when you hover over the option.")))
.binding(true, () -> myBooleanOption, newVal -> myBooleanOption = newVal)