diff options
author | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2022-06-06 18:20:23 +0200 |
---|---|---|
committer | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2022-06-06 18:20:23 +0200 |
commit | 21d31344a151dfe94c79a20b503af55120c63b63 (patch) | |
tree | 6bae89e3532b2ed976a493ff8d6b5b7bfed94221 /src/main/java/cc/polyfrost/oneconfig/internal | |
parent | 462d5976f3654f40229ff61391e7e55d0819d82d (diff) | |
download | OneConfig-21d31344a151dfe94c79a20b503af55120c63b63.tar.gz OneConfig-21d31344a151dfe94c79a20b503af55120c63b63.tar.bz2 OneConfig-21d31344a151dfe94c79a20b503af55120c63b63.zip |
rewrite config system
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/internal')
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/internal/OneConfig.java | 2 | ||||
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/internal/assets/Colors.java | 46 | ||||
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/internal/assets/Images.java | 21 | ||||
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/internal/assets/SVGs.java | 54 | ||||
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/internal/config/annotations/Option.java | 14 | ||||
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/internal/config/core/ConfigCore.java (renamed from src/main/java/cc/polyfrost/oneconfig/internal/config/ConfigCore.java) | 2 | ||||
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/internal/plugin/asm/tweakers/VigilantTransformer.java | 2 |
7 files changed, 138 insertions, 3 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/internal/OneConfig.java b/src/main/java/cc/polyfrost/oneconfig/internal/OneConfig.java index 7f0882a..51e3a6f 100644 --- a/src/main/java/cc/polyfrost/oneconfig/internal/OneConfig.java +++ b/src/main/java/cc/polyfrost/oneconfig/internal/OneConfig.java @@ -1,6 +1,6 @@ package cc.polyfrost.oneconfig.internal; -import cc.polyfrost.oneconfig.internal.config.ConfigCore; +import cc.polyfrost.oneconfig.internal.config.core.ConfigCore; import cc.polyfrost.oneconfig.config.data.Mod; import cc.polyfrost.oneconfig.config.data.ModType; import cc.polyfrost.oneconfig.events.EventManager; diff --git a/src/main/java/cc/polyfrost/oneconfig/internal/assets/Colors.java b/src/main/java/cc/polyfrost/oneconfig/internal/assets/Colors.java new file mode 100644 index 0000000..a8d1e72 --- /dev/null +++ b/src/main/java/cc/polyfrost/oneconfig/internal/assets/Colors.java @@ -0,0 +1,46 @@ +package cc.polyfrost.oneconfig.internal.assets; + +import java.awt.*; + +public class Colors { + // the color library + public static final int TRANSPARENT = new Color(0, 0, 0, 0).getRGB(); // Transparent + public static final int BLACK = new Color(0, 0, 0, 255).getRGB(); // Black + public static final int GRAY_900 = new Color(13, 14, 15, 255).getRGB(); // Gray 900 + public static final int GRAY_900_80 = new Color(13, 14, 15, 204).getRGB(); // Gray 900 80% + public static final int GRAY_800 = new Color(21, 22, 23, 255).getRGB(); // Gray 800 + public static final int GRAY_800_95 = new Color(21, 22, 23, 242).getRGB(); + public static final int GRAY_700 = new Color(34, 35, 38, 255).getRGB(); // Gray 700 + public static final int GRAY_600 = new Color(42, 44, 48, 255).getRGB(); // Gray 600 + public static final int GRAY_500 = new Color(49, 51, 56, 255).getRGB(); // Gray 500 // button sidebar hover, button gray normal + public static final int GRAY_500_80 = new Color(49, 51, 56, 204).getRGB(); // Gray 500 80% // button sidebar pressed + public static final int GRAY_400 = new Color(55, 59, 69, 255).getRGB(); // Gray 400 + public static final int GRAY_300 = new Color(73, 79, 92, 255).getRGB(); // Gray 300 // button gray hover + public static final int GRAY_400_80 = new Color(55, 59, 69, 204).getRGB(); // Gray 400 80% // button gray pressed + public static final int PRIMARY_800 = new Color(13, 51, 128, 255).getRGB(); // Blue 800 + public static final int PRIMARY_700 = new Color(18, 71, 178, 255).getRGB(); // Blue 700 + public static final int PRIMARY_700_80 = new Color(18, 71, 178, 204).getRGB(); // Blue 700 80% + public static final int PRIMARY_600 = new Color(20, 82, 204, 255).getRGB(); // Blue 600 // button blue normal + public static final int PRIMARY_500 = new Color(25, 103, 255, 255).getRGB(); // Blue 500 // button blue hover + public static final int PRIMARY_400 = new Color(48, 129, 242, 255).getRGB(); + public static final int WHITE_50 = new Color(255, 255, 255, 127).getRGB(); // White 60% + public static final int WHITE_60 = new Color(255, 255, 255, 153).getRGB(); // White 60% + public static final int WHITE_80 = new Color(255, 255, 255, 204).getRGB(); // White 80% + public static final int WHITE_90 = new Color(255, 255, 255, 229).getRGB(); // White 90% + public static final int WHITE_95 = new Color(255, 255, 255, 242).getRGB(); // White 90% + public static final int WHITE = new Color(255, 255, 255, 255).getRGB(); // White 100% + public static final int SUCCESS_600 = new Color(3, 152, 85).getRGB(); + public static final int SUCCESS_700 = new Color(2, 121, 72).getRGB(); + public static final int WARNING_500 = new Color(247, 144, 9).getRGB(); + public static final int WARNING_600 = new Color(220, 104, 3).getRGB(); + public static final int ERROR_600_80 = new Color(217, 32, 32, 204).getRGB(); + public static final int ERROR_600 = new Color(217, 32, 32).getRGB(); + public static final int ERROR_700 = new Color(180, 24, 24).getRGB(); // Red 700 + public static final int ERROR_800 = new Color(145, 24, 24).getRGB(); // Red 800 + public static final int ERROR_800_80 = new Color(145, 24, 24, 204).getRGB(); // Red 800 + public static final int ERROR_300 = new Color(253, 155, 155).getRGB(); + public static final int ERROR_300_80 = new Color(253, 155, 155, 204).getRGB(); + public static boolean ROUNDED_CORNERS = true; + public static final float CORNER_RADIUS_WIN = 20f; + public static final float CORNER_RADIUS = 12f; +} diff --git a/src/main/java/cc/polyfrost/oneconfig/internal/assets/Images.java b/src/main/java/cc/polyfrost/oneconfig/internal/assets/Images.java new file mode 100644 index 0000000..b7dc9cc --- /dev/null +++ b/src/main/java/cc/polyfrost/oneconfig/internal/assets/Images.java @@ -0,0 +1,21 @@ +package cc.polyfrost.oneconfig.internal.assets; + +import cc.polyfrost.oneconfig.renderer.AssetLoader; + +/** + * An enum of images used in OneConfig. + * + * @see cc.polyfrost.oneconfig.renderer.RenderManager#drawImage(long, String, float, float, float, float, int) + * @see AssetLoader + */ +public enum Images { + HUE_GRADIENT("/assets/oneconfig/options/HueGradient.png"), + COLOR_WHEEL("/assets/oneconfig/options/ColorWheel.png"), + ALPHA_GRID("/assets/oneconfig/options/AlphaGrid.png"); + + public final String filePath; + + Images(String filePath) { + this.filePath = filePath; + } +}
\ No newline at end of file diff --git a/src/main/java/cc/polyfrost/oneconfig/internal/assets/SVGs.java b/src/main/java/cc/polyfrost/oneconfig/internal/assets/SVGs.java new file mode 100644 index 0000000..eaad4ba --- /dev/null +++ b/src/main/java/cc/polyfrost/oneconfig/internal/assets/SVGs.java @@ -0,0 +1,54 @@ +package cc.polyfrost.oneconfig.internal.assets; + +import cc.polyfrost.oneconfig.renderer.AssetLoader; + +/** + * An enum of SVGs used in OneConfig. + * + * @see cc.polyfrost.oneconfig.renderer.RenderManager#drawSvg(long, String, float, float, float, float, int) + * @see AssetLoader + */ +public enum SVGs { + ONECONFIG("/assets/oneconfig/icons/OneConfig.svg"), + ONECONFIG_OFF("/assets/oneconfig/icons/OneConfigOff.svg"), + COPYRIGHT_FILL("/assets/oneconfig/icons/CopyrightFill.svg"), + APERTURE_FILL("/assets/oneconfig/icons/ApertureFill.svg"), + ARROWS_CLOCKWISE_BOLD("/assets/oneconfig/icons/ArrowsClockwiseBold.svg"), + FADERS_HORIZONTAL_BOLD("/assets/oneconfig/icons/FadersHorizontalBold.svg"), + GAUGE_FILL("/assets/oneconfig/icons/GaugeFill.svg"), + GEAR_SIX_FILL("/assets/oneconfig/icons/GearSixFill.svg"), + MAGNIFYING_GLASS_BOLD("/assets/oneconfig/icons/MagnifyingGlassBold.svg"), + NOTE_PENCIL_BOLD("/assets/oneconfig/icons/NotePencilBold.svg"), + PAINT_BRUSH_BROAD_FILL("/assets/oneconfig/icons/PaintBrushBroadFill.svg"), + USER_SWITCH_FILL("/assets/oneconfig/icons/UserSwitchFill.svg"), + X_CIRCLE_BOLD("/assets/oneconfig/icons/XCircleBold.svg"), + CARET_LEFT("/assets/oneconfig/icons/CaretLeftBold.svg"), + CARET_RIGHT("/assets/oneconfig/icons/CaretRightBold.svg"), + + // OLD ICONS + BOX("/assets/oneconfig/old-icons/Box.svg"), + CHECKBOX_TICK("/assets/oneconfig/old-icons/CheckboxTick.svg"), + CHECK_CIRCLE("/assets/oneconfig/old-icons/CheckCircle.svg"), + CHEVRON_DOWN("/assets/oneconfig/old-icons/ChevronDown.svg"), + CHEVRON_UP("/assets/oneconfig/old-icons/ChevronUp.svg"), + COPY("/assets/oneconfig/old-icons/Copy.svg"), + DROPDOWN_LIST("/assets/oneconfig/old-icons/DropdownList.svg"), + ERROR("/assets/oneconfig/old-icons/Error.svg"), + EYE("/assets/oneconfig/old-icons/Eye.svg"), + EYE_OFF("/assets/oneconfig/old-icons/EyeOff.svg"), + HEART_FILL("/assets/oneconfig/old-icons/HeartFill.svg"), + HEART_OUTLINE("/assets/oneconfig/old-icons/HeartOutline.svg"), + HELP_CIRCLE("/assets/oneconfig/old-icons/HelpCircle.svg"), + HISTORY("/assets/oneconfig/old-icons/History.svg"), + INFO_CIRCLE("/assets/oneconfig/old-icons/InfoCircle.svg"), + KEYSTROKE("/assets/oneconfig/old-icons/Keystroke.svg"), + PASTE("/assets/oneconfig/old-icons/Paste.svg"), + POP_OUT("/assets/oneconfig/old-icons/PopOut.svg"), + WARNING("/assets/oneconfig/old-icons/Warning.svg"); + + public final String filePath; + + SVGs(String filePath) { + this.filePath = filePath; + } +} diff --git a/src/main/java/cc/polyfrost/oneconfig/internal/config/annotations/Option.java b/src/main/java/cc/polyfrost/oneconfig/internal/config/annotations/Option.java new file mode 100644 index 0000000..02e6d8e --- /dev/null +++ b/src/main/java/cc/polyfrost/oneconfig/internal/config/annotations/Option.java @@ -0,0 +1,14 @@ +package cc.polyfrost.oneconfig.internal.config.annotations; + +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.ANNOTATION_TYPE) +public @interface Option { + OptionType type(); +} diff --git a/src/main/java/cc/polyfrost/oneconfig/internal/config/ConfigCore.java b/src/main/java/cc/polyfrost/oneconfig/internal/config/core/ConfigCore.java index f41b74e..02ac8f8 100644 --- a/src/main/java/cc/polyfrost/oneconfig/internal/config/ConfigCore.java +++ b/src/main/java/cc/polyfrost/oneconfig/internal/config/core/ConfigCore.java @@ -1,4 +1,4 @@ -package cc.polyfrost.oneconfig.internal.config; +package cc.polyfrost.oneconfig.internal.config.core; import cc.polyfrost.oneconfig.config.data.Mod; import cc.polyfrost.oneconfig.internal.hud.HudCore; diff --git a/src/main/java/cc/polyfrost/oneconfig/internal/plugin/asm/tweakers/VigilantTransformer.java b/src/main/java/cc/polyfrost/oneconfig/internal/plugin/asm/tweakers/VigilantTransformer.java index 09f40e7..58e3575 100644 --- a/src/main/java/cc/polyfrost/oneconfig/internal/plugin/asm/tweakers/VigilantTransformer.java +++ b/src/main/java/cc/polyfrost/oneconfig/internal/plugin/asm/tweakers/VigilantTransformer.java @@ -1,7 +1,7 @@ package cc.polyfrost.oneconfig.internal.plugin.asm.tweakers; import cc.polyfrost.oneconfig.config.compatibility.vigilance.VigilanceConfig; -import cc.polyfrost.oneconfig.internal.config.ConfigCore; +import cc.polyfrost.oneconfig.internal.config.core.ConfigCore; import cc.polyfrost.oneconfig.config.data.Mod; import cc.polyfrost.oneconfig.config.data.ModType; import cc.polyfrost.oneconfig.internal.plugin.asm.ITransformer; |