From 813f3193c6d017701948d32caa9c5b7ed07d083d Mon Sep 17 00:00:00 2001 From: DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> Date: Tue, 7 Jun 2022 17:56:57 +0200 Subject: finish config system rewrite --- .../oneconfig/config/annotations/ConfigPage.java | 37 ---------------------- .../oneconfig/config/annotations/CustomOption.java | 14 ++++++++ .../oneconfig/config/annotations/HUD.java | 16 ++++++++++ .../oneconfig/config/annotations/Page.java | 37 ++++++++++++++++++++++ 4 files changed, 67 insertions(+), 37 deletions(-) delete mode 100644 src/main/java/cc/polyfrost/oneconfig/config/annotations/ConfigPage.java create mode 100644 src/main/java/cc/polyfrost/oneconfig/config/annotations/CustomOption.java create mode 100644 src/main/java/cc/polyfrost/oneconfig/config/annotations/HUD.java create mode 100644 src/main/java/cc/polyfrost/oneconfig/config/annotations/Page.java (limited to 'src/main/java/cc/polyfrost/oneconfig/config/annotations') diff --git a/src/main/java/cc/polyfrost/oneconfig/config/annotations/ConfigPage.java b/src/main/java/cc/polyfrost/oneconfig/config/annotations/ConfigPage.java deleted file mode 100644 index 432d65c..0000000 --- a/src/main/java/cc/polyfrost/oneconfig/config/annotations/ConfigPage.java +++ /dev/null @@ -1,37 +0,0 @@ -package cc.polyfrost.oneconfig.config.annotations; - -import cc.polyfrost.oneconfig.config.data.PageLocation; - -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 ConfigPage { - /** - * The name of the page that will be displayed to the user - */ - String name(); - - /** - * If the page button is at the top or bottem of the page - */ - PageLocation location(); - - /** - * The description of the page that will be displayed to the user - */ - String description() default ""; - - /** - * The category of the page - */ - String category() default "General"; - - /** - * The subcategory of the page - */ - String subcategory() default ""; -} diff --git a/src/main/java/cc/polyfrost/oneconfig/config/annotations/CustomOption.java b/src/main/java/cc/polyfrost/oneconfig/config/annotations/CustomOption.java new file mode 100644 index 0000000..6a1109b --- /dev/null +++ b/src/main/java/cc/polyfrost/oneconfig/config/annotations/CustomOption.java @@ -0,0 +1,14 @@ +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) +public @interface CustomOption { +} diff --git a/src/main/java/cc/polyfrost/oneconfig/config/annotations/HUD.java b/src/main/java/cc/polyfrost/oneconfig/config/annotations/HUD.java new file mode 100644 index 0000000..7bb1903 --- /dev/null +++ b/src/main/java/cc/polyfrost/oneconfig/config/annotations/HUD.java @@ -0,0 +1,16 @@ +package cc.polyfrost.oneconfig.config.annotations; + +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 HUD { + String name(); + + String category() default "General"; + + String subcategory() default ""; +} diff --git a/src/main/java/cc/polyfrost/oneconfig/config/annotations/Page.java b/src/main/java/cc/polyfrost/oneconfig/config/annotations/Page.java new file mode 100644 index 0000000..2e93a7d --- /dev/null +++ b/src/main/java/cc/polyfrost/oneconfig/config/annotations/Page.java @@ -0,0 +1,37 @@ +package cc.polyfrost.oneconfig.config.annotations; + +import cc.polyfrost.oneconfig.config.data.PageLocation; + +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 Page { + /** + * The name of the page that will be displayed to the user + */ + String name(); + + /** + * If the page button is at the top or bottem of the page + */ + PageLocation location(); + + /** + * The description of the page that will be displayed to the user + */ + String description() default ""; + + /** + * The category of the page + */ + String category() default "General"; + + /** + * The subcategory of the page + */ + String subcategory() default ""; +} -- cgit