From 79eb8936fffdbd51455bae6d45bf355f7958d8a6 Mon Sep 17 00:00:00 2001 From: Motschen Date: Thu, 9 Mar 2023 20:37:44 +0100 Subject: [PATCH] Update the example config --- MidnightConfigExample.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/MidnightConfigExample.java b/MidnightConfigExample.java index f6ceedf..2975aea 100644 --- a/MidnightConfigExample.java +++ b/MidnightConfigExample.java @@ -13,9 +13,10 @@ public class MidnightConfigExample extends MidnightConfig { - @Comment public static Comment text1; // Comments are rendered like an option without a button and are excluded from the config file - @Comment(centered = true) public static Comment text2; // Centered comments are the same as normal ones - just centered! - @Entry public static boolean showInfo = true; // Example for a boolean option + @Comment(category = "text") public static Comment text1; // Comments are rendered like an option without a button and are excluded from the config file + @Comment(category = "text", centered = true) public static Comment text2; // Centered comments are the same as normal ones - just centered! + @Comment(category = "text") public static Comment spacer1; // Comments containing the word "spacer" will just appear as a blank line + @Entry(category = "text") public static boolean showInfo = true; // Example for a boolean option @Entry(category = "text") public static String name = "Hello World!"; // Example for a string option, which is in a category! @Entry(category = "text") public static TestEnum testEnum = TestEnum.FABRIC; // Example for an enum option public enum TestEnum { // Enums allow the user to cycle through predefined options @@ -25,7 +26,7 @@ public enum TestEnum { // Enums allow the user to @Entry(category = "numbers") public static double world = 1.4D; // Example for a double option @Entry(category = "numbers", min=69,max=420) public static int hello = 420; // - The entered number has to be larger than 69 and smaller than 420 @Entry(category = "text", width = 7, min = 7, isColor = true, name = "I am a color!") public static String titleColor = "#ffffff"; // The isColor property adds a preview box for a hexadecimal color - @Entry(category = "sliders", name = "I am an array list!") public static List arrayList = Lists.newArrayList("String1", "String2"); // Array String Lists are also supported + @Entry(category = "text", name = "I am an array list!") public static List arrayList = Lists.newArrayList("String1", "String2"); // Array String Lists are also supported @Entry(category = "sliders", name = "I am an int slider.",isSlider = true, min = 0, max = 100) public static int intSlider = 35; // Int fields can also be displayed as a Slider @Entry(category = "sliders", name = "I am a float slider!", isSlider = true, min = 0f, max = 1f, precision = 1000) public static float floatSlider = 0.24f; // And so can floats! Precision defines the amount of decimal places // The name field can be used to specify a custom translation string or plain text