diff options
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/config/annotations')
12 files changed, 250 insertions, 88 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/config/annotations/Button.java b/src/main/java/cc/polyfrost/oneconfig/config/annotations/Button.java new file mode 100644 index 0000000..300651f --- /dev/null +++ b/src/main/java/cc/polyfrost/oneconfig/config/annotations/Button.java @@ -0,0 +1,24 @@ +package cc.polyfrost.oneconfig.config.annotations; + +import cc.polyfrost.oneconfig.config.data.OptionType; +import cc.polyfrost.oneconfig.internal.config.annotations.Option; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +@Option(type = OptionType.BUTTON) +public @interface Button { + String name(); + + String text(); + + int size() default 1; + + String category() default "General"; + + String subcategory() default ""; +} diff --git a/src/main/java/cc/polyfrost/oneconfig/config/annotations/Checkbox.java b/src/main/java/cc/polyfrost/oneconfig/config/annotations/Checkbox.java new file mode 100644 index 0000000..eae35e4 --- /dev/null +++ b/src/main/java/cc/polyfrost/oneconfig/config/annotations/Checkbox.java @@ -0,0 +1,22 @@ +package cc.polyfrost.oneconfig.config.annotations; + +import cc.polyfrost.oneconfig.config.data.OptionType; +import cc.polyfrost.oneconfig.internal.config.annotations.Option; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +@Option(type = OptionType.CHECKBOX) +public @interface Checkbox { + String name(); + + int size() default 1; + + String category() default "General"; + + String subcategory() default ""; +} diff --git a/src/main/java/cc/polyfrost/oneconfig/config/annotations/VigilanceName.java b/src/main/java/cc/polyfrost/oneconfig/config/annotations/Color.java index e4b042a..98cc5ec 100644 --- a/src/main/java/cc/polyfrost/oneconfig/config/annotations/VigilanceName.java +++ b/src/main/java/cc/polyfrost/oneconfig/config/annotations/Color.java @@ -1,5 +1,8 @@ package cc.polyfrost.oneconfig.config.annotations; +import cc.polyfrost.oneconfig.config.data.OptionType; +import cc.polyfrost.oneconfig.internal.config.annotations.Option; + import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @@ -7,10 +10,13 @@ import java.lang.annotation.Target; @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.FIELD) -public @interface VigilanceName { +@Option(type = OptionType.COLOR) +public @interface Color { String name(); - String category(); + int size() default 1; + + String category() default "General"; - String subcategory(); + String subcategory() default ""; } diff --git a/src/main/java/cc/polyfrost/oneconfig/config/annotations/Dropdown.java b/src/main/java/cc/polyfrost/oneconfig/config/annotations/Dropdown.java new file mode 100644 index 0000000..1fbf162 --- /dev/null +++ b/src/main/java/cc/polyfrost/oneconfig/config/annotations/Dropdown.java @@ -0,0 +1,24 @@ +package cc.polyfrost.oneconfig.config.annotations; + +import cc.polyfrost.oneconfig.config.data.OptionType; +import cc.polyfrost.oneconfig.internal.config.annotations.Option; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +@Option(type = OptionType.DROPDOWN) +public @interface Dropdown { + String name(); + + String[] options(); + + int size() default 1; + + String category() default "General"; + + String subcategory() default ""; +} diff --git a/src/main/java/cc/polyfrost/oneconfig/config/annotations/DualOption.java b/src/main/java/cc/polyfrost/oneconfig/config/annotations/DualOption.java new file mode 100644 index 0000000..f01d074 --- /dev/null +++ b/src/main/java/cc/polyfrost/oneconfig/config/annotations/DualOption.java @@ -0,0 +1,26 @@ +package cc.polyfrost.oneconfig.config.annotations; + +import cc.polyfrost.oneconfig.config.data.OptionType; +import cc.polyfrost.oneconfig.internal.config.annotations.Option; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +@Option(type = OptionType.DUAL_OPTION) +public @interface DualOption { + String name(); + + String left(); + + String right(); + + int size() default 1; + + String category() default "General"; + + String subcategory() default ""; +} diff --git a/src/main/java/cc/polyfrost/oneconfig/config/annotations/Header.java b/src/main/java/cc/polyfrost/oneconfig/config/annotations/Header.java new file mode 100644 index 0000000..3821a01 --- /dev/null +++ b/src/main/java/cc/polyfrost/oneconfig/config/annotations/Header.java @@ -0,0 +1,22 @@ +package cc.polyfrost.oneconfig.config.annotations; + +import cc.polyfrost.oneconfig.config.data.OptionType; +import cc.polyfrost.oneconfig.internal.config.annotations.Option; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +@Option(type = OptionType.HEADER) +public @interface Header { + String text(); + + int size() default 1; + + String category() default "General"; + + String subcategory() default ""; +} diff --git a/src/main/java/cc/polyfrost/oneconfig/config/annotations/Info.java b/src/main/java/cc/polyfrost/oneconfig/config/annotations/Info.java new file mode 100644 index 0000000..3f058ed --- /dev/null +++ b/src/main/java/cc/polyfrost/oneconfig/config/annotations/Info.java @@ -0,0 +1,25 @@ +package cc.polyfrost.oneconfig.config.annotations; + +import cc.polyfrost.oneconfig.config.data.InfoType; +import cc.polyfrost.oneconfig.config.data.OptionType; +import cc.polyfrost.oneconfig.internal.config.annotations.Option; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +@Option(type = OptionType.INFO) +public @interface Info { + String text(); + + InfoType type(); + + int size() default 1; + + String category() default "General"; + + String subcategory() default ""; +} diff --git a/src/main/java/cc/polyfrost/oneconfig/config/annotations/KeyBind.java b/src/main/java/cc/polyfrost/oneconfig/config/annotations/KeyBind.java new file mode 100644 index 0000000..7d6cfdc --- /dev/null +++ b/src/main/java/cc/polyfrost/oneconfig/config/annotations/KeyBind.java @@ -0,0 +1,22 @@ +package cc.polyfrost.oneconfig.config.annotations; + +import cc.polyfrost.oneconfig.config.data.OptionType; +import cc.polyfrost.oneconfig.internal.config.annotations.Option; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +@Option(type = OptionType.KEYBIND) +public @interface KeyBind { + String name(); + + int size() default 1; + + String category() default "General"; + + String subcategory() default ""; +} diff --git a/src/main/java/cc/polyfrost/oneconfig/config/annotations/Option.java b/src/main/java/cc/polyfrost/oneconfig/config/annotations/Option.java deleted file mode 100644 index f30f01e..0000000 --- a/src/main/java/cc/polyfrost/oneconfig/config/annotations/Option.java +++ /dev/null @@ -1,85 +0,0 @@ -package cc.polyfrost.oneconfig.config.annotations; - -import cc.polyfrost.oneconfig.config.data.InfoType; -import cc.polyfrost.oneconfig.config.data.OptionType; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.FIELD) -public @interface Option { - /** - * The name of the option that will be displayed to the user - */ - String name(); - - /** - * The type of the option - */ - OptionType type(); - - /** - * The category of the component - */ - String category() default "General"; - - /** - * The subcategory of the component (displayed as header) - */ - String subcategory() default ""; - - /** - * The width of the option (1 = half width, 2 = full width) - */ - int size() default 1; - - /** - * A String array of all the possible values for the UniSelector, dropdownList, and ComboBox. - * Also used in the DualOption slider, index 0 is the left, index 1 is the right; for example: - * {"Option 1", "Option 2"} - */ - String[] options() default {}; - - /** - * The placeholder in the text field - */ - String placeholder() default ""; - - /** - * If the text field is secure or not - */ - boolean secure() default false; - - /** - * If the text field is multi line or not - */ - boolean multiLine() default false; - - /** - * Minimum value of slider - */ - float min() default 0; - - /** - * The maximum value of the slider - */ - float max() default 0; - - /** - * Steps of slider (0 for no steps) - */ - int step() default 0; - - /** - * Option for info option type - */ - InfoType infoType() default InfoType.INFO; - - /** - * Text displayed inside button - */ - String buttonText() default "Activate"; -} diff --git a/src/main/java/cc/polyfrost/oneconfig/config/annotations/Slider.java b/src/main/java/cc/polyfrost/oneconfig/config/annotations/Slider.java new file mode 100644 index 0000000..144d329 --- /dev/null +++ b/src/main/java/cc/polyfrost/oneconfig/config/annotations/Slider.java @@ -0,0 +1,26 @@ +package cc.polyfrost.oneconfig.config.annotations; + +import cc.polyfrost.oneconfig.config.data.OptionType; +import cc.polyfrost.oneconfig.internal.config.annotations.Option; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +@Option(type = OptionType.SLIDER) +public @interface Slider { + String name(); + + float min(); + + float max(); + + int step() default 0; + + String category() default "General"; + + String subcategory() default ""; +} diff --git a/src/main/java/cc/polyfrost/oneconfig/config/annotations/Switch.java b/src/main/java/cc/polyfrost/oneconfig/config/annotations/Switch.java new file mode 100644 index 0000000..d3b8e80 --- /dev/null +++ b/src/main/java/cc/polyfrost/oneconfig/config/annotations/Switch.java @@ -0,0 +1,22 @@ +package cc.polyfrost.oneconfig.config.annotations; + +import cc.polyfrost.oneconfig.config.data.OptionType; +import cc.polyfrost.oneconfig.internal.config.annotations.Option; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +@Option(type = OptionType.SWITCH) +public @interface Switch { + String name(); + + int size() default 1; + + String category() default "General"; + + String subcategory() default ""; +} diff --git a/src/main/java/cc/polyfrost/oneconfig/config/annotations/Text.java b/src/main/java/cc/polyfrost/oneconfig/config/annotations/Text.java new file mode 100644 index 0000000..90e5779 --- /dev/null +++ b/src/main/java/cc/polyfrost/oneconfig/config/annotations/Text.java @@ -0,0 +1,28 @@ +package cc.polyfrost.oneconfig.config.annotations; + +import cc.polyfrost.oneconfig.config.data.OptionType; +import cc.polyfrost.oneconfig.internal.config.annotations.Option; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +@Option(type = OptionType.TEXT) +public @interface Text { + String name(); + + String placeholder() default ""; + + boolean secure() default false; + + boolean multiline() default false; + + int size() default 1; + + String category() default "General"; + + String subcategory() default ""; +} |