diff options
author | Crendgrim <Crendgrim@users.noreply.github.com> | 2023-08-31 00:06:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-30 23:06:47 +0100 |
commit | 554646dbd857e2fab1be8339ce8d0231ef2dbb4c (patch) | |
tree | b55e6f1d282c18e743857bba3c9d5e4f226200ed /test-common/src/main/java/dev/isxander/yacl3/test/AutogenConfigTest.java | |
parent | c11566072608683034864dbd4e0d3f5afa067537 (diff) | |
download | YetAnotherConfigLib-554646dbd857e2fab1be8339ce8d0231ef2dbb4c.tar.gz YetAnotherConfigLib-554646dbd857e2fab1be8339ce8d0231ef2dbb4c.tar.bz2 YetAnotherConfigLib-554646dbd857e2fab1be8339ce8d0231ef2dbb4c.zip |
Add dropdown controllers (#95)
Diffstat (limited to 'test-common/src/main/java/dev/isxander/yacl3/test/AutogenConfigTest.java')
-rw-r--r-- | test-common/src/main/java/dev/isxander/yacl3/test/AutogenConfigTest.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/test-common/src/main/java/dev/isxander/yacl3/test/AutogenConfigTest.java b/test-common/src/main/java/dev/isxander/yacl3/test/AutogenConfigTest.java index 828aa73..a664d91 100644 --- a/test-common/src/main/java/dev/isxander/yacl3/test/AutogenConfigTest.java +++ b/test-common/src/main/java/dev/isxander/yacl3/test/AutogenConfigTest.java @@ -16,6 +16,8 @@ import dev.isxander.yacl3.gui.ValueFormatters; import dev.isxander.yacl3.platform.YACLPlatform; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.Items; import java.awt.*; import java.util.List; @@ -30,7 +32,7 @@ public class AutogenConfigTest { .build(); @AutoGen(category = "test", group = "master_test") - @MasterTickBox({ "testTickBox", "testBoolean", "testInt", "testDouble", "testFloat", "testLong", "testIntField", "testDoubleField", "testFloatField", "testLongField", "testEnum", "testColor", "testString" }) + @MasterTickBox({ "testTickBox", "testBoolean", "testInt", "testDouble", "testFloat", "testLong", "testIntField", "testDoubleField", "testFloatField", "testLongField", "testEnum", "testColor", "testString", "testDropdown", "testItem" }) @SerialEntry(comment = "This option disables all the other options in this group") public boolean masterOption = true; @@ -90,6 +92,14 @@ public class AutogenConfigTest { @StringField @SerialEntry public String testString = "Test string"; + @AutoGen(category = "test", group = "master_test") + @Dropdown(values = {"Apple", "Banana", "Cherry", "Date"}, allowAnyValue = true) + @SerialEntry public String testDropdown = "Cherry"; + + @AutoGen(category = "test", group = "master_test") + @ItemField + @SerialEntry public Item testItem = Items.AZURE_BLUET; + @AutoGen(category = "test", group = "misc") @Label private final Component testLabel = Component.literal("Test label"); |