diff options
author | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2022-06-05 17:43:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-05 17:43:23 +0200 |
commit | ab7256dff5d6d37488081ba7a01b36d3ee9ef563 (patch) | |
tree | 8207341e6c402848cdbe7b2f2297f5f975e0e083 /src/main/java/cc/polyfrost/oneconfig | |
parent | a903cfc4d3f76cf3db24749b65156d126fa714e7 (diff) | |
download | OneConfig-ab7256dff5d6d37488081ba7a01b36d3ee9ef563.tar.gz OneConfig-ab7256dff5d6d37488081ba7a01b36d3ee9ef563.tar.bz2 OneConfig-ab7256dff5d6d37488081ba7a01b36d3ee9ef563.zip |
refactor (#36)
* refactor
* fix vig compat
* fix nanovg thingy
* e
* finalize
* gui utils package thingy
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig')
81 files changed, 452 insertions, 450 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/config/interfaces/Config.java b/src/main/java/cc/polyfrost/oneconfig/config/Config.java index 8eb5eb1..d0d8acf 100644 --- a/src/main/java/cc/polyfrost/oneconfig/config/interfaces/Config.java +++ b/src/main/java/cc/polyfrost/oneconfig/config/Config.java @@ -1,16 +1,20 @@ -package cc.polyfrost.oneconfig.config.interfaces; +package cc.polyfrost.oneconfig.config; import cc.polyfrost.oneconfig.config.annotations.ConfigPage; import cc.polyfrost.oneconfig.config.annotations.Option; import cc.polyfrost.oneconfig.config.core.ConfigCore; import cc.polyfrost.oneconfig.config.data.*; +import cc.polyfrost.oneconfig.config.elements.BasicOption; +import cc.polyfrost.oneconfig.config.elements.OptionCategory; +import cc.polyfrost.oneconfig.config.elements.OptionPage; +import cc.polyfrost.oneconfig.config.elements.OptionSubcategory; import cc.polyfrost.oneconfig.config.profiles.Profiles; import cc.polyfrost.oneconfig.gui.OneConfigGui; import cc.polyfrost.oneconfig.gui.elements.config.*; import cc.polyfrost.oneconfig.gui.pages.ModConfigPage; import cc.polyfrost.oneconfig.hud.BasicHud; import cc.polyfrost.oneconfig.hud.HudCore; -import cc.polyfrost.oneconfig.utils.GuiUtils; +import cc.polyfrost.oneconfig.utils.gui.GuiUtils; import com.google.gson.*; import java.io.*; diff --git a/src/main/java/cc/polyfrost/oneconfig/config/compatibility/VigilanceConfig.java b/src/main/java/cc/polyfrost/oneconfig/config/compatibility/vigilance/VigilanceConfig.java index fa4f058..cfa717f 100644 --- a/src/main/java/cc/polyfrost/oneconfig/config/compatibility/VigilanceConfig.java +++ b/src/main/java/cc/polyfrost/oneconfig/config/compatibility/vigilance/VigilanceConfig.java @@ -1,13 +1,13 @@ -package cc.polyfrost.oneconfig.config.compatibility; +package cc.polyfrost.oneconfig.config.compatibility.vigilance; import cc.polyfrost.oneconfig.config.core.ConfigCore; import cc.polyfrost.oneconfig.config.core.OneColor; import cc.polyfrost.oneconfig.config.data.Mod; -import cc.polyfrost.oneconfig.config.data.OptionCategory; -import cc.polyfrost.oneconfig.config.data.OptionPage; -import cc.polyfrost.oneconfig.config.data.OptionSubcategory; -import cc.polyfrost.oneconfig.config.interfaces.BasicOption; -import cc.polyfrost.oneconfig.config.interfaces.Config; +import cc.polyfrost.oneconfig.config.elements.OptionCategory; +import cc.polyfrost.oneconfig.config.elements.OptionPage; +import cc.polyfrost.oneconfig.config.elements.OptionSubcategory; +import cc.polyfrost.oneconfig.config.elements.BasicOption; +import cc.polyfrost.oneconfig.config.Config; import cc.polyfrost.oneconfig.gui.elements.config.*; import gg.essential.vigilance.Vigilant; import gg.essential.vigilance.data.*; diff --git a/src/main/java/cc/polyfrost/oneconfig/config/compatibility/VigilantAccessor.java b/src/main/java/cc/polyfrost/oneconfig/config/compatibility/vigilance/VigilantAccessor.java index ca2b1da..c449bd9 100644 --- a/src/main/java/cc/polyfrost/oneconfig/config/compatibility/VigilantAccessor.java +++ b/src/main/java/cc/polyfrost/oneconfig/config/compatibility/vigilance/VigilantAccessor.java @@ -1,4 +1,4 @@ -package cc.polyfrost.oneconfig.config.compatibility; +package cc.polyfrost.oneconfig.config.compatibility.vigilance; import gg.essential.vigilance.data.PropertyCollector; diff --git a/src/main/java/cc/polyfrost/oneconfig/config/data/Mod.java b/src/main/java/cc/polyfrost/oneconfig/config/data/Mod.java index 241dca7..090d1f8 100644 --- a/src/main/java/cc/polyfrost/oneconfig/config/data/Mod.java +++ b/src/main/java/cc/polyfrost/oneconfig/config/data/Mod.java @@ -1,7 +1,8 @@ package cc.polyfrost.oneconfig.config.data; -import cc.polyfrost.oneconfig.config.interfaces.Config; -import cc.polyfrost.oneconfig.config.migration.Migrator; +import cc.polyfrost.oneconfig.config.Config; +import cc.polyfrost.oneconfig.config.elements.OptionPage; +import cc.polyfrost.oneconfig.config.migration.vigilance.Migrator; import org.jetbrains.annotations.Nullable; public class Mod { diff --git a/src/main/java/cc/polyfrost/oneconfig/config/interfaces/BasicOption.java b/src/main/java/cc/polyfrost/oneconfig/config/elements/BasicOption.java index d4b4498..d4efeaa 100644 --- a/src/main/java/cc/polyfrost/oneconfig/config/interfaces/BasicOption.java +++ b/src/main/java/cc/polyfrost/oneconfig/config/elements/BasicOption.java @@ -1,4 +1,4 @@ -package cc.polyfrost.oneconfig.config.interfaces; +package cc.polyfrost.oneconfig.config.elements; import java.lang.reflect.Field; import java.util.function.Supplier; diff --git a/src/main/java/cc/polyfrost/oneconfig/config/data/OptionCategory.java b/src/main/java/cc/polyfrost/oneconfig/config/elements/OptionCategory.java index 76b2b34..4a37bfc 100644 --- a/src/main/java/cc/polyfrost/oneconfig/config/data/OptionCategory.java +++ b/src/main/java/cc/polyfrost/oneconfig/config/elements/OptionCategory.java @@ -1,4 +1,4 @@ -package cc.polyfrost.oneconfig.config.data; +package cc.polyfrost.oneconfig.config.elements; import java.util.ArrayList; diff --git a/src/main/java/cc/polyfrost/oneconfig/config/data/OptionPage.java b/src/main/java/cc/polyfrost/oneconfig/config/elements/OptionPage.java index 32a07b9..5eaac8b 100644 --- a/src/main/java/cc/polyfrost/oneconfig/config/data/OptionPage.java +++ b/src/main/java/cc/polyfrost/oneconfig/config/elements/OptionPage.java @@ -1,15 +1,12 @@ -package cc.polyfrost.oneconfig.config.data; +package cc.polyfrost.oneconfig.config.elements; + +import cc.polyfrost.oneconfig.config.data.Mod; import java.util.LinkedHashMap; public class OptionPage { public final String name; public final Mod mod; - /** - * Depth 1 = categories - * Depth 2 = subcategories - * Depth 3 = list of options - */ public final LinkedHashMap<String, OptionCategory> categories = new LinkedHashMap<>(); public OptionPage(String name, Mod mod) { diff --git a/src/main/java/cc/polyfrost/oneconfig/config/data/OptionSubcategory.java b/src/main/java/cc/polyfrost/oneconfig/config/elements/OptionSubcategory.java index e69e077..ff1d770 100644 --- a/src/main/java/cc/polyfrost/oneconfig/config/data/OptionSubcategory.java +++ b/src/main/java/cc/polyfrost/oneconfig/config/elements/OptionSubcategory.java @@ -1,11 +1,11 @@ -package cc.polyfrost.oneconfig.config.data; +package cc.polyfrost.oneconfig.config.elements; -import cc.polyfrost.oneconfig.config.OneConfigConfig; -import cc.polyfrost.oneconfig.config.interfaces.BasicOption; +import cc.polyfrost.oneconfig.gui.Colors; +import cc.polyfrost.oneconfig.config.elements.BasicOption; import cc.polyfrost.oneconfig.gui.OneConfigGui; import cc.polyfrost.oneconfig.gui.elements.config.ConfigPageButton; -import cc.polyfrost.oneconfig.lwjgl.RenderManager; -import cc.polyfrost.oneconfig.lwjgl.font.Fonts; +import cc.polyfrost.oneconfig.renderer.RenderManager; +import cc.polyfrost.oneconfig.renderer.font.Fonts; import java.util.ArrayList; @@ -45,7 +45,7 @@ public class OptionSubcategory { if (filteredOptions.size() == 0 && filteredTop.size() == 0 && filteredBottom.size() == 0) return 0; int optionY = y; if (!name.equals("")) { - RenderManager.drawText(vg, name, x, y + 12, OneConfigConfig.WHITE_90, 24, Fonts.MEDIUM); + RenderManager.drawText(vg, name, x, y + 12, Colors.WHITE_90, 24, Fonts.MEDIUM); optionY += 36; } @@ -68,7 +68,7 @@ public class OptionSubcategory { } backgroundSize += option.getHeight() + 16; } - RenderManager.drawRoundedRect(vg, x - 16, optionY, 1024, backgroundSize, OneConfigConfig.GRAY_900, 20); + RenderManager.drawRoundedRect(vg, x - 16, optionY, 1024, backgroundSize, Colors.GRAY_900, 20); optionY += 16; } diff --git a/src/main/java/cc/polyfrost/oneconfig/config/migration/Migrator.java b/src/main/java/cc/polyfrost/oneconfig/config/migration/vigilance/Migrator.java index abfb2a0..f3f60b7 100644 --- a/src/main/java/cc/polyfrost/oneconfig/config/migration/Migrator.java +++ b/src/main/java/cc/polyfrost/oneconfig/config/migration/vigilance/Migrator.java @@ -1,4 +1,4 @@ -package cc.polyfrost.oneconfig.config.migration; +package cc.polyfrost.oneconfig.config.migration.vigilance; import java.lang.reflect.Field; diff --git a/src/main/java/cc/polyfrost/oneconfig/config/migration/VigilanceMigrator.java b/src/main/java/cc/polyfrost/oneconfig/config/migration/vigilance/VigilanceMigrator.java index b45aeba..2870e03 100644 --- a/src/main/java/cc/polyfrost/oneconfig/config/migration/VigilanceMigrator.java +++ b/src/main/java/cc/polyfrost/oneconfig/config/migration/vigilance/VigilanceMigrator.java @@ -1,4 +1,4 @@ -package cc.polyfrost.oneconfig.config.migration; +package cc.polyfrost.oneconfig.config.migration.vigilance; import cc.polyfrost.oneconfig.config.annotations.VigilanceName; diff --git a/src/main/java/cc/polyfrost/oneconfig/config/profiles/Profiles.java b/src/main/java/cc/polyfrost/oneconfig/config/profiles/Profiles.java index dfc5e16..006fea9 100644 --- a/src/main/java/cc/polyfrost/oneconfig/config/profiles/Profiles.java +++ b/src/main/java/cc/polyfrost/oneconfig/config/profiles/Profiles.java @@ -1,8 +1,8 @@ package cc.polyfrost.oneconfig.config.profiles; -import cc.polyfrost.oneconfig.OneConfig; -import cc.polyfrost.oneconfig.config.OneConfigConfig; +import cc.polyfrost.oneconfig.internal.OneConfig; import cc.polyfrost.oneconfig.config.core.ConfigCore; +import cc.polyfrost.oneconfig.internal.config.OneConfigConfig; import org.apache.commons.io.FileUtils; import java.io.File; diff --git a/src/main/java/cc/polyfrost/oneconfig/config/OneConfigConfig.java b/src/main/java/cc/polyfrost/oneconfig/gui/Colors.java index b867bc0..6cb9567 100644 --- a/src/main/java/cc/polyfrost/oneconfig/config/OneConfigConfig.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/Colors.java @@ -1,19 +1,8 @@ -package cc.polyfrost.oneconfig.config; - -import cc.polyfrost.oneconfig.config.core.OneColor; -import cc.polyfrost.oneconfig.config.data.Mod; -import cc.polyfrost.oneconfig.config.interfaces.Config; -import com.google.gson.JsonParser; +package cc.polyfrost.oneconfig.gui; import java.awt.*; -import java.io.*; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.util.ArrayList; - -public class OneConfigConfig extends Config { +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 @@ -51,41 +40,7 @@ public class OneConfigConfig extends Config { 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 String currentProfile = "Default Profile"; - public static ArrayList<String> favoriteMods = new ArrayList<>(); - public static ArrayList<OneColor> favoriteColors = new ArrayList<>(); - public static ArrayList<OneColor> recentColors = new ArrayList<>(); public static boolean ROUNDED_CORNERS = true; - public static float CORNER_RADIUS_WIN = 20f; - public static float CORNER_RADIUS = 12f; - - public static boolean allShowShortCut = false; - - public OneConfigConfig() { - super(null, "OneConfig.json"); - } - - @Override - public void init(Mod mod) { - if (new File("OneConfig/" + configFile).exists()) load(); - else save(); - } - - @Override - public void save() { - try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(Files.newOutputStream(Paths.get("OneConfig/" + configFile)), StandardCharsets.UTF_8))) { - writer.write(gson.toJson(this)); - } catch (IOException e) { - e.printStackTrace(); - } - } - - @Override - public void load() { - try (BufferedReader reader = new BufferedReader(new InputStreamReader(Files.newInputStream(Paths.get("OneConfig/" + configFile)), StandardCharsets.UTF_8))) { - deserializePart(new JsonParser().parse(reader).getAsJsonObject(), this); - } catch (IOException e) { - e.printStackTrace(); - } - } + public static final float CORNER_RADIUS_WIN = 20f; + public static final float CORNER_RADIUS = 12f; } diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/HudGui.java b/src/main/java/cc/polyfrost/oneconfig/gui/HudGui.java index 52030fc..1b172d0 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/HudGui.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/HudGui.java @@ -3,7 +3,7 @@ package cc.polyfrost.oneconfig.gui; import cc.polyfrost.oneconfig.config.core.ConfigCore; import cc.polyfrost.oneconfig.hud.BasicHud; import cc.polyfrost.oneconfig.hud.HudCore; -import cc.polyfrost.oneconfig.lwjgl.RenderManager; +import cc.polyfrost.oneconfig.renderer.RenderManager; import gg.essential.universal.UKeyboard; import gg.essential.universal.UMatrixStack; import gg.essential.universal.UScreen; diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/OneConfigGui.java b/src/main/java/cc/polyfrost/oneconfig/gui/OneConfigGui.java index a9da8c2..81fe9c0 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/OneConfigGui.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/OneConfigGui.java @@ -1,6 +1,5 @@ package cc.polyfrost.oneconfig.gui; -import cc.polyfrost.oneconfig.config.OneConfigConfig; import cc.polyfrost.oneconfig.config.core.OneColor; import cc.polyfrost.oneconfig.gui.animations.Animation; import cc.polyfrost.oneconfig.gui.animations.EaseInOutQuad; @@ -9,11 +8,11 @@ import cc.polyfrost.oneconfig.gui.elements.ColorSelector; import cc.polyfrost.oneconfig.gui.elements.text.TextInputField; import cc.polyfrost.oneconfig.gui.pages.ModsPage; import cc.polyfrost.oneconfig.gui.pages.Page; -import cc.polyfrost.oneconfig.lwjgl.RenderManager; -import cc.polyfrost.oneconfig.lwjgl.font.Fonts; -import cc.polyfrost.oneconfig.lwjgl.image.SVGs; -import cc.polyfrost.oneconfig.lwjgl.scissor.ScissorManager; -import cc.polyfrost.oneconfig.utils.GuiUtils; +import cc.polyfrost.oneconfig.renderer.RenderManager; +import cc.polyfrost.oneconfig.renderer.font.Fonts; +import cc.polyfrost.oneconfig.renderer.image.SVGs; +import cc.polyfrost.oneconfig.renderer.scissor.ScissorManager; +import cc.polyfrost.oneconfig.utils.gui.GuiUtils; import cc.polyfrost.oneconfig.utils.InputUtils; import cc.polyfrost.oneconfig.utils.color.ColorPalette; import gg.essential.universal.UKeyboard; @@ -33,8 +32,8 @@ public class OneConfigGui extends UScreen { private final TextInputField textInputField = new TextInputField(248, 40, "Search...", false, false, SVGs.MAGNIFYING_GLASS_BOLD); private final ArrayList<Page> previousPages = new ArrayList<>(); private final ArrayList<Page> nextPages = new ArrayList<>(); - private final BasicElement backArrow = new BasicElement(40, 40, new ColorPalette(OneConfigConfig.GRAY_700, OneConfigConfig.GRAY_500, OneConfigConfig.GRAY_500_80), true); - private final BasicElement forwardArrow = new BasicElement(40, 40, new ColorPalette(OneConfigConfig.GRAY_700, OneConfigConfig.GRAY_500, OneConfigConfig.GRAY_500_80), true); + private final BasicElement backArrow = new BasicElement(40, 40, new ColorPalette(Colors.GRAY_700, Colors.GRAY_500, Colors.GRAY_500_80), true); + private final BasicElement forwardArrow = new BasicElement(40, 40, new ColorPalette(Colors.GRAY_700, Colors.GRAY_500, Colors.GRAY_500_80), true); private final ArrayList<Page> parents = new ArrayList<>(); public ColorSelector currentColorSelector; public boolean mouseDown; @@ -80,18 +79,18 @@ public class OneConfigGui extends UScreen { int x = (int) ((UResolution.getWindowWidth() - 1280 * scale) / 2f / scale); int y = (int) ((UResolution.getWindowHeight() - 800 * scale) / 2f / scale); RenderManager.scale(vg, scale, scale); - if (OneConfigConfig.ROUNDED_CORNERS) { + if (Colors.ROUNDED_CORNERS) { RenderManager.drawDropShadow(vg, x, y, 1280, 800, 32, 0, 20); - RenderManager.drawRoundedRect(vg, x + 224, y, 1056, 800, OneConfigConfig.GRAY_800, OneConfigConfig.CORNER_RADIUS_WIN); - RenderManager.drawRoundedRect(vg, x, y, 244, 800, OneConfigConfig.GRAY_800_95, OneConfigConfig.CORNER_RADIUS_WIN); - RenderManager.drawRect(vg, x + 224, y, 20, 800, OneConfigConfig.GRAY_800); + RenderManager.drawRoundedRect(vg, x + 224, y, 1056, 800, Colors.GRAY_800, Colors.CORNER_RADIUS_WIN); + RenderManager.drawRoundedRect(vg, x, y, 244, 800, Colors.GRAY_800_95, Colors.CORNER_RADIUS_WIN); + RenderManager.drawRect(vg, x + 224, y, 20, 800, Colors.GRAY_800); } - RenderManager.drawLine(vg, x + 224, y + 72, x + 1280, y + 72, 1, OneConfigConfig.GRAY_700); - RenderManager.drawLine(vg, x + 224, y, x + 222, y + 800, 1, OneConfigConfig.GRAY_700); + RenderManager.drawLine(vg, x + 224, y + 72, x + 1280, y + 72, 1, Colors.GRAY_700); + RenderManager.drawLine(vg, x + 224, y, x + 222, y + 800, 1, Colors.GRAY_700); RenderManager.drawSvg(vg, SVGs.ONECONFIG, x + 19, y + 19, 42, 42); - RenderManager.drawText(vg, "OneConfig", x + 69, y + 32, OneConfigConfig.WHITE, 18f, Fonts.BOLD); // added half line height to center text - RenderManager.drawText(vg, "By Polyfrost", x + 69, y + 51, OneConfigConfig.WHITE, 12f, Fonts.REGULAR); + RenderManager.drawText(vg, "OneConfig", x + 69, y + 32, Colors.WHITE, 18f, Fonts.BOLD); // added half line height to center text + RenderManager.drawText(vg, "By Polyfrost", x + 69, y + 51, Colors.WHITE, 12f, Fonts.REGULAR); textInputField.draw(vg, x + 1020, y + 16); sideBar.draw(vg, x, y); @@ -156,9 +155,9 @@ public class OneConfigGui extends UScreen { String title = parents.get(i).getTitle(); float width = RenderManager.getTextWidth(vg, title, 24f, Fonts.SEMIBOLD); boolean hovered = InputUtils.isAreaHovered((int) breadcrumbX, y + 24, (int) width, 36); - int color = OneConfigConfig.WHITE_60; - if (i == parents.size() - 1) color = OneConfigConfig.WHITE; - else if (hovered && !Mouse.isButtonDown(0)) color = OneConfigConfig.WHITE_80; + int color = Colors.WHITE_60; + if (i == parents.size() - 1) color = Colors.WHITE; + else if (hovered && !Mouse.isButtonDown(0)) color = Colors.WHITE_80; RenderManager.drawText(vg, title, breadcrumbX, y + 38, color, 24f, Fonts.SEMIBOLD); if (i != 0) RenderManager.drawSvg(vg, SVGs.CARET_RIGHT, breadcrumbX - 28, y + 25, 24, 24, color); @@ -168,7 +167,7 @@ public class OneConfigGui extends UScreen { long end = System.nanoTime() - start; String s = (" draw: " + end / 1000000f + "ms"); - RenderManager.drawText(vg, s, x + 1170, y + 792, OneConfigConfig.GRAY_300, 10f, Fonts.MEDIUM); + RenderManager.drawText(vg, s, x + 1170, y + 792, Colors.GRAY_300, 10f, Fonts.MEDIUM); if (currentColorSelector != null) { currentColorSelector.draw(vg); } diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/SideBar.java b/src/main/java/cc/polyfrost/oneconfig/gui/SideBar.java index 236733a..b6f1160 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/SideBar.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/SideBar.java @@ -1,17 +1,16 @@ package cc.polyfrost.oneconfig.gui; -import cc.polyfrost.oneconfig.config.OneConfigConfig; import cc.polyfrost.oneconfig.gui.animations.Animation; import cc.polyfrost.oneconfig.gui.animations.DummyAnimation; import cc.polyfrost.oneconfig.gui.animations.EaseInOutQuart; import cc.polyfrost.oneconfig.gui.elements.BasicButton; import cc.polyfrost.oneconfig.gui.pages.CreditsPage; import cc.polyfrost.oneconfig.gui.pages.ModsPage; -import cc.polyfrost.oneconfig.lwjgl.RenderManager; -import cc.polyfrost.oneconfig.lwjgl.font.Fonts; -import cc.polyfrost.oneconfig.lwjgl.image.SVGs; +import cc.polyfrost.oneconfig.renderer.RenderManager; +import cc.polyfrost.oneconfig.renderer.font.Fonts; +import cc.polyfrost.oneconfig.renderer.image.SVGs; import cc.polyfrost.oneconfig.test.ButtonTestPage; -import cc.polyfrost.oneconfig.utils.GuiUtils; +import cc.polyfrost.oneconfig.utils.gui.GuiUtils; import cc.polyfrost.oneconfig.utils.color.ColorPalette; import java.util.ArrayList; @@ -60,7 +59,7 @@ public class SideBar { selected = buttons.indexOf(button); } if (moveAnimation != null) { - RenderManager.drawRoundedRect(vg, x + 16, moveAnimation.get() - (sizeAnimation.get() - 36) / 2f, 192, sizeAnimation.get(0), OneConfigConfig.PRIMARY_600, 12); + RenderManager.drawRoundedRect(vg, x + 16, moveAnimation.get() - (sizeAnimation.get() - 36) / 2f, 192, sizeAnimation.get(0), Colors.PRIMARY_600, 12); if (moveAnimation.isFinished() && sizeAnimation.isFinished()) { moveAnimation = null; sizeAnimation = null; @@ -70,12 +69,12 @@ public class SideBar { buttons.get(0).draw(vg, x + 16, y + 80); buttons.get(1).draw(vg, x + 16, y + 116); - RenderManager.drawText(vg, "MOD CONFIG", x + 16, y + 178, OneConfigConfig.WHITE, 12, Fonts.SEMIBOLD); + RenderManager.drawText(vg, "MOD CONFIG", x + 16, y + 178, Colors.WHITE, 12, Fonts.SEMIBOLD); buttons.get(2).draw(vg, x + 16, y + 192); buttons.get(3).draw(vg, x + 16, y + 228); buttons.get(4).draw(vg, x + 16, y + 264); buttons.get(5).draw(vg, x + 16, y + 300); - RenderManager.drawText(vg, "PERSONALIZATION", x + 16, y + 362, OneConfigConfig.WHITE, 12, Fonts.SEMIBOLD); + RenderManager.drawText(vg, "PERSONALIZATION", x + 16, y + 362, Colors.WHITE, 12, Fonts.SEMIBOLD); buttons.get(6).draw(vg, x + 16, y + 376); buttons.get(7).draw(vg, x + 16, y + 412); buttons.get(8).draw(vg, x + 16, y + 448); diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/animations/Animation.java b/src/main/java/cc/polyfrost/oneconfig/gui/animations/Animation.java index 3f2a552..a5cfae0 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/animations/Animation.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/animations/Animation.java @@ -1,6 +1,6 @@ package cc.polyfrost.oneconfig.gui.animations; -import cc.polyfrost.oneconfig.utils.GuiUtils; +import cc.polyfrost.oneconfig.utils.gui.GuiUtils; public abstract class Animation { protected final boolean reverse; diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicButton.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicButton.java index 36acffa..f3168dd 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicButton.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicButton.java @@ -1,11 +1,11 @@ package cc.polyfrost.oneconfig.gui.elements; -import cc.polyfrost.oneconfig.config.OneConfigConfig; +import cc.polyfrost.oneconfig.gui.Colors; import cc.polyfrost.oneconfig.gui.OneConfigGui; import cc.polyfrost.oneconfig.gui.pages.Page; -import cc.polyfrost.oneconfig.lwjgl.RenderManager; -import cc.polyfrost.oneconfig.lwjgl.font.Fonts; -import cc.polyfrost.oneconfig.lwjgl.image.SVGs; +import cc.polyfrost.oneconfig.renderer.RenderManager; +import cc.polyfrost.oneconfig.renderer.font.Fonts; +import cc.polyfrost.oneconfig.renderer.image.SVGs; import cc.polyfrost.oneconfig.utils.color.ColorPalette; import cc.polyfrost.oneconfig.utils.color.ColorUtils; import org.jetbrains.annotations.NotNull; @@ -68,7 +68,7 @@ public class BasicButton extends BasicElement { color = currentColor; } else { RenderManager.drawRoundedRect(vg, x, y, this.width, this.height, currentColor, this.cornerRadius); - color = ColorUtils.setAlpha(OneConfigConfig.WHITE, (int) (colorAnimation.getAlpha() * 255)); + color = ColorUtils.setAlpha(Colors.WHITE, (int) (colorAnimation.getAlpha() * 255)); } final float middle = x + width / 2f; final float middleYIcon = y + height / 2f - iconSize / 2f; diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicElement.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicElement.java index f0b930c..a4a3321 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicElement.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicElement.java @@ -1,7 +1,7 @@ package cc.polyfrost.oneconfig.gui.elements; import cc.polyfrost.oneconfig.gui.animations.ColorAnimation; -import cc.polyfrost.oneconfig.lwjgl.RenderManager; +import cc.polyfrost.oneconfig.renderer.RenderManager; import cc.polyfrost.oneconfig.utils.InputUtils; import cc.polyfrost.oneconfig.utils.color.ColorPalette; import org.jetbrains.annotations.NotNull; diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/ColorSelector.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/ColorSelector.java index 683be1e..d42d465 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/ColorSelector.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/ColorSelector.java @@ -1,6 +1,6 @@ package cc.polyfrost.oneconfig.gui.elements; -import cc.polyfrost.oneconfig.config.OneConfigConfig; +import cc.polyfrost.oneconfig.gui.Colors; import cc.polyfrost.oneconfig.config.core.OneColor; import cc.polyfrost.oneconfig.gui.OneConfigGui; import cc.polyfrost.oneconfig.gui.animations.Animation; @@ -9,12 +9,13 @@ import cc.polyfrost.oneconfig.gui.animations.EaseInOutCubic; import cc.polyfrost.oneconfig.gui.animations.EaseInOutQuad; import cc.polyfrost.oneconfig.gui.elements.text.NumberInputField; import cc.polyfrost.oneconfig.gui.elements.text.TextInputField; -import cc.polyfrost.oneconfig.lwjgl.RenderManager; -import cc.polyfrost.oneconfig.lwjgl.font.Fonts; -import cc.polyfrost.oneconfig.lwjgl.image.Images; -import cc.polyfrost.oneconfig.lwjgl.image.SVGs; -import cc.polyfrost.oneconfig.lwjgl.scissor.Scissor; -import cc.polyfrost.oneconfig.lwjgl.scissor.ScissorManager; +import cc.polyfrost.oneconfig.internal.config.OneConfigConfig; +import cc.polyfrost.oneconfig.renderer.RenderManager; +import cc.polyfrost.oneconfig.renderer.font.Fonts; +import cc.polyfrost.oneconfig.renderer.image.Images; +import cc.polyfrost.oneconfig.renderer.image.SVGs; +import cc.polyfrost.oneconfig.renderer.scissor.Scissor; +import cc.polyfrost.oneconfig.renderer.scissor.ScissorManager; import cc.polyfrost.oneconfig.utils.InputUtils; import cc.polyfrost.oneconfig.utils.NetworkUtils; import cc.polyfrost.oneconfig.utils.color.ColorPalette; @@ -102,11 +103,11 @@ public class ColorSelector { int height = 768; Scissor scissor = ScissorManager.scissor(vg, x - 3, y - 3, width + 6, height + 6); RenderManager.drawHollowRoundRect(vg, x - 3, y - 3, width + 4, height + 4, new Color(204, 204, 204, 77).getRGB(), 20f, 2f); - RenderManager.drawRoundedRect(vg, x, y, width, height, OneConfigConfig.GRAY_800, 20f); - RenderManager.drawText(vg, "Color Selector", x + 16, y + 32, OneConfigConfig.WHITE_90, 18f, Fonts.SEMIBOLD); + RenderManager.drawRoundedRect(vg, x, y, width, height, Colors.GRAY_800, 20f); + RenderManager.drawText(vg, "Color Selector", x + 16, y + 32, Colors.WHITE_90, 18f, Fonts.SEMIBOLD); if (!closeBtn.isHovered()) RenderManager.setAlpha(vg, 0.8f); closeBtn.draw(vg, x + 368, y + 16); - RenderManager.drawSvg(vg, SVGs.X_CIRCLE_BOLD, x + 368, y + 16, 32, 32, closeBtn.isHovered() ? OneConfigConfig.ERROR_600 : -1); + RenderManager.drawSvg(vg, SVGs.X_CIRCLE_BOLD, x + 368, y + 16, 32, 32, closeBtn.isHovered() ? Colors.ERROR_600 : -1); RenderManager.setAlpha(vg, 1f); // hex parser @@ -124,9 +125,9 @@ public class ColorSelector { recentColors.get(i).draw(vg, x + 104 + i * 44, y + 720); } - RenderManager.drawRoundedRect(vg, x + 16, y + 64, 384, 32, OneConfigConfig.GRAY_500, 12f); + RenderManager.drawRoundedRect(vg, x + 16, y + 64, 384, 32, Colors.GRAY_500, 12f); if (!barMoveAnimation.isFinished()) - RenderManager.drawRoundedRect(vg, x + barMoveAnimation.get(), y + 66, 124, 28, OneConfigConfig.PRIMARY_600, 10f); + RenderManager.drawRoundedRect(vg, x + barMoveAnimation.get(), y + 66, 124, 28, Colors.PRIMARY_600, 10f); else buttons.get(mode).setColorPalette(ColorPalette.PRIMARY); int i = 18; @@ -144,22 +145,22 @@ public class ColorSelector { } float percentMoveMain = moveAnimation.get(); - RenderManager.drawText(vg, "Saturation", x + 224, y + 560, OneConfigConfig.WHITE_80, 12f, Fonts.MEDIUM); + RenderManager.drawText(vg, "Saturation", x + 224, y + 560, Colors.WHITE_80, 12f, Fonts.MEDIUM); saturationInput.draw(vg, x + 312, y + 544); - RenderManager.drawText(vg, "Brightness", x + 16, y + 599, OneConfigConfig.WHITE_80, 12f, Fonts.MEDIUM); + RenderManager.drawText(vg, "Brightness", x + 16, y + 599, Colors.WHITE_80, 12f, Fonts.MEDIUM); brightnessInput.draw(vg, x + 104, y + 584); - RenderManager.drawText(vg, "Alpha (%)", x + 224, y + 599, OneConfigConfig.WHITE_80, 12f, Fonts.MEDIUM); + RenderManager.drawText(vg, "Alpha (%)", x + 224, y + 599, Colors.WHITE_80, 12f, Fonts.MEDIUM); alphaInput.draw(vg, x + 312, y + 584); - RenderManager.drawText(vg, color.getDataBit() == -1 ? "Hex (RGB):" : "Color Code:", x + 16, y + 641, OneConfigConfig.WHITE_80, 12f, Fonts.MEDIUM); + RenderManager.drawText(vg, color.getDataBit() == -1 ? "Hex (RGB):" : "Color Code:", x + 16, y + 641, Colors.WHITE_80, 12f, Fonts.MEDIUM); hexInput.draw(vg, x + 104, y + 624); copyBtn.draw(vg, x + 204, y + 624); pasteBtn.draw(vg, x + 244, y + 624); if (mode != 2) { - RenderManager.drawText(vg, "Hue", x + 16, y + 560, OneConfigConfig.WHITE_80, 12f, Fonts.MEDIUM); + RenderManager.drawText(vg, "Hue", x + 16, y + 560, Colors.WHITE_80, 12f, Fonts.MEDIUM); hueInput.draw(vg, x + 104, y + 544); } else { - RenderManager.drawText(vg, "Speed (s)", x + 16, y + 560, OneConfigConfig.WHITE_80, 12f, Fonts.MEDIUM); + RenderManager.drawText(vg, "Speed (s)", x + 16, y + 560, Colors.WHITE_80, 12f, Fonts.MEDIUM); speedInput.draw(vg, x + 104, y + 544); } @@ -172,13 +173,13 @@ public class ColorSelector { if (dragging && InputUtils.isClicked(true)) { dragging = false; } - bottomSlider.setGradient(OneConfigConfig.TRANSPARENT, color.getRGBNoAlpha()); + bottomSlider.setGradient(Colors.TRANSPARENT, color.getRGBNoAlpha()); RenderManager.drawRoundImage(vg, Images.ALPHA_GRID, x + 16, y + 456, 384, 16, 8f); bottomSlider.draw(vg, x + 16, y + 456); if (percentMoveMain > 0.96f) { - RenderManager.drawRoundedRect(vg, mouseX - 7, mouseY - 7, 14, 14, OneConfigConfig.WHITE, 14f); - RenderManager.drawRoundedRect(vg, mouseX - 6, mouseY - 6, 12, 12, OneConfigConfig.BLACK, 12f); + RenderManager.drawRoundedRect(vg, mouseX - 7, mouseY - 7, 14, 14, Colors.WHITE, 14f); + RenderManager.drawRoundedRect(vg, mouseX - 6, mouseY - 6, 12, 12, Colors.BLACK, 12f); RenderManager.drawRoundedRect(vg, mouseX - 5, mouseY - 5, 10, 10, color.getRGBMax(true), 10f); } @@ -188,7 +189,7 @@ public class ColorSelector { // draw the color preview - RenderManager.drawHollowRoundRect(vg, x + 15, y + 487, 384, 40, OneConfigConfig.GRAY_300, 12f, 2f); + RenderManager.drawHollowRoundRect(vg, x + 15, y + 487, 384, 40, Colors.GRAY_300, 12f, 2f); RenderManager.drawRoundImage(vg, Images.ALPHA_GRID, x + 20, y + 492, 376, 32, 8f); RenderManager.drawRoundedRect(vg, x + 20, y + 492, 376, 32, color.getRGB(), 8f); InputUtils.blockClicks(true); @@ -213,8 +214,8 @@ public class ColorSelector { } if (mode == 2) { speedSlider.draw(vg, x + 60, y + 424); - RenderManager.drawText(vg, "SLOW", x + 16, y + 429, OneConfigConfig.WHITE_80, 12f, Fonts.REGULAR); - RenderManager.drawText(vg, "FAST", x + 370, y + 429, OneConfigConfig.WHITE_80, 12f, Fonts.REGULAR); + RenderManager.drawText(vg, "SLOW", x + 16, y + 429, Colors.WHITE_80, 12f, Fonts.REGULAR); + RenderManager.drawText(vg, "FAST", x + 370, y + 429, Colors.WHITE_80, 12f, Fonts.REGULAR); } break; case 1: @@ -222,7 +223,7 @@ public class ColorSelector { topSlider.setImage(null); RenderManager.drawRoundImage(vg, Images.COLOR_WHEEL, x + 64, y + 120, 288, 288, 144f); - topSlider.setGradient(OneConfigConfig.BLACK, color.getRGBMax(true)); + topSlider.setGradient(Colors.BLACK, color.getRGBMax(true)); topSlider.setImage(null); topSlider.draw(vg, x + 16, y + 424); break; @@ -427,8 +428,8 @@ public class ColorSelector { } RenderManager.drawHollowRoundRect(vg, x - 0.5f, y - 0.5f, width, height, new Color(204, 204, 204, 80).getRGB(), 8f, 1f); - RenderManager.drawHollowRoundRect(vg, currentDragPoint - 1, y - 1, 18, 18, OneConfigConfig.WHITE, 9f, 1f); - RenderManager.drawHollowRoundRect(vg, currentDragPoint, y, 16, 16, OneConfigConfig.BLACK, 8f, 1f); + RenderManager.drawHollowRoundRect(vg, currentDragPoint - 1, y - 1, 18, 18, Colors.WHITE, 9f, 1f); + RenderManager.drawHollowRoundRect(vg, currentDragPoint, y, 16, 16, Colors.BLACK, 8f, 1f); RenderManager.drawRoundedRect(vg, currentDragPoint + 1.5f, y + 1.5f, 14, 14, color, 7f); } @@ -456,8 +457,8 @@ public class ColorSelector { @Override public void draw(long vg, int x, int y) { - RenderManager.drawRoundedRect(vg, x, y, 32, 32, toggled ? OneConfigConfig.PRIMARY_600 : OneConfigConfig.GRAY_300, 12f); - RenderManager.drawRoundedRect(vg, x + 2, y + 2, 28, 28, OneConfigConfig.GRAY_800, 10f); + RenderManager.drawRoundedRect(vg, x, y, 32, 32, toggled ? Colors.PRIMARY_600 : Colors.GRAY_300, 12f); + RenderManager.drawRoundedRect(vg, x + 2, y + 2, 28, 28, Colors.GRAY_800, 10f); RenderManager.drawRoundedRect(vg, x + 4, y + 4, 24, 24, color.getRGB(), 8f); update(x, y); } diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java index bac855e..f48e1af 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java @@ -1,16 +1,16 @@ package cc.polyfrost.oneconfig.gui.elements; -import cc.polyfrost.oneconfig.OneConfig; -import cc.polyfrost.oneconfig.config.OneConfigConfig; +import cc.polyfrost.oneconfig.internal.OneConfig; +import cc.polyfrost.oneconfig.gui.Colors; import cc.polyfrost.oneconfig.config.data.Mod; import cc.polyfrost.oneconfig.gui.OneConfigGui; import cc.polyfrost.oneconfig.gui.animations.ColorAnimation; import cc.polyfrost.oneconfig.gui.pages.ModConfigPage; -import cc.polyfrost.oneconfig.lwjgl.RenderManager; -import cc.polyfrost.oneconfig.lwjgl.font.Fonts; -import cc.polyfrost.oneconfig.lwjgl.image.SVGs; -import cc.polyfrost.oneconfig.lwjgl.scissor.Scissor; -import cc.polyfrost.oneconfig.lwjgl.scissor.ScissorManager; +import cc.polyfrost.oneconfig.renderer.RenderManager; +import cc.polyfrost.oneconfig.renderer.font.Fonts; +import cc.polyfrost.oneconfig.renderer.image.SVGs; +import cc.polyfrost.oneconfig.renderer.scissor.Scissor; +import cc.polyfrost.oneconfig.renderer.scissor.ScissorManager; import cc.polyfrost.oneconfig.utils.InputUtils; import cc.polyfrost.oneconfig.utils.color.ColorPalette; import cc.polyfrost.oneconfig.utils.color.ColorUtils; @@ -51,17 +51,17 @@ public class ModCard extends BasicElement { if (disabled) RenderManager.setAlpha(vg, 0.5f); RenderManager.drawRoundedRectVaried(vg, x, y, width, 87, colorFrame.getColor(isHoveredMain, isHoveredMain && Mouse.isButtonDown(0)), 12f, 12f, 0f, 0f); RenderManager.drawRoundedRectVaried(vg, x, y + 87, width, 32, colorToggle.getColor(isHoveredSecondary, isHoveredSecondary && Mouse.isButtonDown(0)), 0f, 0f, 12f, 12f); - RenderManager.drawLine(vg, x, y + 86, x + width, y + 86, 2, OneConfigConfig.GRAY_300); + RenderManager.drawLine(vg, x, y + 86, x + width, y + 86, 2, Colors.GRAY_300); if (modData.modIcon != null) { if (modData.modIcon.toLowerCase().endsWith(".svg")) RenderManager.drawSvg(vg, modData.modIcon, x + 98, y + 19, 48, 48); else RenderManager.drawImage(vg, modData.modIcon, x + 98, y + 19, 48, 48); } else { - RenderManager.drawText(vg, modData.name, x + 122 - RenderManager.getTextWidth(vg, modData.name, 16, Fonts.MINECRAFT_BOLD) / 2f, y + 44, ColorUtils.setAlpha(OneConfigConfig.WHITE, (int) (colorFrame.getAlpha() * 255)), 16, Fonts.MINECRAFT_BOLD); + RenderManager.drawText(vg, modData.name, x + 122 - RenderManager.getTextWidth(vg, modData.name, 16, Fonts.MINECRAFT_BOLD) / 2f, y + 44, ColorUtils.setAlpha(Colors.WHITE, (int) (colorFrame.getAlpha() * 255)), 16, Fonts.MINECRAFT_BOLD); } favoriteButton.draw(vg, x + 212, y + 87); favorite = favoriteButton.isToggled(); - RenderManager.drawText(vg, modData.name, x + 12, y + 103, ColorUtils.setAlpha(OneConfigConfig.WHITE, (int) (colorToggle.getAlpha() * 255)), 14f, Fonts.MEDIUM); + RenderManager.drawText(vg, modData.name, x + 12, y + 103, ColorUtils.setAlpha(Colors.WHITE, (int) (colorToggle.getAlpha() * 255)), 14f, Fonts.MEDIUM); if (favorite) favoriteButton.setLeftIcon(SVGs.HEART_FILL); else favoriteButton.setLeftIcon(SVGs.HEART_OUTLINE); diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/ModUpdateCard.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/ModUpdateCard.java deleted file mode 100644 index 55041b9..0000000 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/ModUpdateCard.java +++ /dev/null @@ -1,8 +0,0 @@ -package cc.polyfrost.oneconfig.gui.elements; - -public class ModUpdateCard extends BasicElement { - - public ModUpdateCard(int width, int height) { // TODO - super(width, height, true); - } -} diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/Slider.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/Slider.java index 3aab5ad..5705ba8 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/Slider.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/Slider.java @@ -1,7 +1,7 @@ package cc.polyfrost.oneconfig.gui.elements; -import cc.polyfrost.oneconfig.config.OneConfigConfig; -import cc.polyfrost.oneconfig.lwjgl.RenderManager; +import cc.polyfrost.oneconfig.gui.Colors; +import cc.polyfrost.oneconfig.renderer.RenderManager; import cc.polyfrost.oneconfig.utils.InputUtils; import org.lwjgl.input.Mouse; @@ -23,9 +23,9 @@ public class Slider extends BasicElement { @Override public void draw(long vg, int x, int y) { update(x, y); - RenderManager.drawRoundedRect(vg, x, y + 2, width, height - 4, OneConfigConfig.GRAY_300, 3f); - RenderManager.drawRoundedRect(vg, x, y + 2, width * value, height - 4, OneConfigConfig.PRIMARY_500, 3f); - RenderManager.drawRoundedRect(vg, currentDragPoint - dragPointerSize / 2, y - 8, 24, 24, OneConfigConfig.WHITE, 12f); + RenderManager.drawRoundedRect(vg, x, y + 2, width, height - 4, Colors.GRAY_300, 3f); + RenderManager.drawRoundedRect(vg, x, y + 2, width * value, height - 4, Colors.PRIMARY_500, 3f); + RenderManager.drawRoundedRect(vg, currentDragPoint - dragPointerSize / 2, y - 8, 24, 24, Colors.WHITE, 12f); } diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigButton.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigButton.java index 19bf058..a488fea 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigButton.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigButton.java @@ -1,10 +1,10 @@ package cc.polyfrost.oneconfig.gui.elements.config; -import cc.polyfrost.oneconfig.config.OneConfigConfig; -import cc.polyfrost.oneconfig.config.interfaces.BasicOption; +import cc.polyfrost.oneconfig.gui.Colors; +import cc.polyfrost.oneconfig.config.elements.BasicOption; import cc.polyfrost.oneconfig.gui.elements.BasicButton; -import cc.polyfrost.oneconfig.lwjgl.RenderManager; -import cc.polyfrost.oneconfig.lwjgl.font.Fonts; +import cc.polyfrost.oneconfig.renderer.RenderManager; +import cc.polyfrost.oneconfig.renderer.font.Fonts; import cc.polyfrost.oneconfig.utils.color.ColorPalette; import java.lang.reflect.Field; @@ -39,7 +39,7 @@ public class ConfigButton extends BasicOption { public void draw(long vg, int x, int y) { button.disable(!isEnabled()); if (!isEnabled()) RenderManager.setAlpha(vg, 0.5f); - RenderManager.drawText(vg, name, x, y + 17, OneConfigConfig.WHITE, 14f, Fonts.MEDIUM); + RenderManager.drawText(vg, name, x, y + 17, Colors.WHITE, 14f, Fonts.MEDIUM); button.draw(vg, x + (size == 1 ? 352 : 736), y); RenderManager.setAlpha(vg, 1f); } diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigCheckbox.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigCheckbox.java index 4b38dd6..b21c7dc 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigCheckbox.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigCheckbox.java @@ -1,14 +1,14 @@ package cc.polyfrost.oneconfig.gui.elements.config; -import cc.polyfrost.oneconfig.config.OneConfigConfig; -import cc.polyfrost.oneconfig.config.interfaces.BasicOption; +import cc.polyfrost.oneconfig.gui.Colors; +import cc.polyfrost.oneconfig.config.elements.BasicOption; import cc.polyfrost.oneconfig.gui.animations.Animation; import cc.polyfrost.oneconfig.gui.animations.ColorAnimation; import cc.polyfrost.oneconfig.gui.animations.DummyAnimation; import cc.polyfrost.oneconfig.gui.animations.EaseInOutQuad; -import cc.polyfrost.oneconfig.lwjgl.RenderManager; -import cc.polyfrost.oneconfig.lwjgl.font.Fonts; -import cc.polyfrost.oneconfig.lwjgl.image.SVGs; +import cc.polyfrost.oneconfig.renderer.RenderManager; +import cc.polyfrost.oneconfig.renderer.font.Fonts; +import cc.polyfrost.oneconfig.renderer.image.SVGs; import cc.polyfrost.oneconfig.utils.InputUtils; import cc.polyfrost.oneconfig.utils.color.ColorPalette; import cc.polyfrost.oneconfig.utils.color.ColorUtils; @@ -49,16 +49,16 @@ public class ConfigCheckbox extends BasicOption { } float percentOn = animation.get(); - RenderManager.drawText(vg, name, x + 32, y + 17, OneConfigConfig.WHITE_90, 14f, Fonts.MEDIUM); + RenderManager.drawText(vg, name, x + 32, y + 17, Colors.WHITE_90, 14f, Fonts.MEDIUM); RenderManager.drawRoundedRect(vg, x, y + 4, 24, 24, color.getColor(hover, hover && Mouse.isButtonDown(0)), 6f); - RenderManager.drawHollowRoundRect(vg, x, y + 4, 23.5f, 23.5f, OneConfigConfig.GRAY_300, 6f, 1f); // the 0.5f is to make it look better ok + RenderManager.drawHollowRoundRect(vg, x, y + 4, 23.5f, 23.5f, Colors.GRAY_300, 6f, 1f); // the 0.5f is to make it look better ok - RenderManager.drawRoundedRect(vg, x, y + 4, 24, 24, ColorUtils.setAlpha(OneConfigConfig.PRIMARY_500, (int) (percentOn * 255)), 6f); + RenderManager.drawRoundedRect(vg, x, y + 4, 24, 24, ColorUtils.setAlpha(Colors.PRIMARY_500, (int) (percentOn * 255)), 6f); RenderManager.drawSvg(vg, SVGs.CHECKBOX_TICK, x, y + 4, 24, 24, new Color(1f, 1f, 1f, percentOn).getRGB()); if (toggled && hover) - RenderManager.drawHollowRoundRect(vg, x - 1, y + 3, 24, 24, OneConfigConfig.PRIMARY_600, 6f, 2f); + RenderManager.drawHollowRoundRect(vg, x - 1, y + 3, 24, 24, Colors.PRIMARY_600, 6f, 2f); RenderManager.setAlpha(vg, 1f); } diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigColorElement.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigColorElement.java index 121416d..0e13f07 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigColorElement.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigColorElement.java @@ -1,15 +1,15 @@ package cc.polyfrost.oneconfig.gui.elements.config; -import cc.polyfrost.oneconfig.config.OneConfigConfig; +import cc.polyfrost.oneconfig.gui.Colors; import cc.polyfrost.oneconfig.config.core.OneColor; -import cc.polyfrost.oneconfig.config.interfaces.BasicOption; +import cc.polyfrost.oneconfig.config.elements.BasicOption; import cc.polyfrost.oneconfig.gui.OneConfigGui; import cc.polyfrost.oneconfig.gui.elements.BasicElement; import cc.polyfrost.oneconfig.gui.elements.ColorSelector; import cc.polyfrost.oneconfig.gui.elements.text.TextInputField; -import cc.polyfrost.oneconfig.lwjgl.RenderManager; -import cc.polyfrost.oneconfig.lwjgl.font.Fonts; -import cc.polyfrost.oneconfig.lwjgl.image.Images; +import cc.polyfrost.oneconfig.renderer.RenderManager; +import cc.polyfrost.oneconfig.renderer.font.Fonts; +import cc.polyfrost.oneconfig.renderer.image.Images; import cc.polyfrost.oneconfig.utils.InputUtils; import java.lang.reflect.Field; @@ -41,7 +41,7 @@ public class ConfigColorElement extends BasicOption { } catch (IllegalAccessException e) { return; } - RenderManager.drawText(vg, name, x, y + 16, OneConfigConfig.WHITE_90, 14f, Fonts.MEDIUM); + RenderManager.drawText(vg, name, x, y + 16, Colors.WHITE_90, 14f, Fonts.MEDIUM); if (!hexField.isToggled()) hexField.setInput("#" + color.getHex()); hexField.setErrored(false); if (hexField.isToggled()) { @@ -74,7 +74,7 @@ public class ConfigColorElement extends BasicOption { alphaField.draw(vg, x1 + 336, y); element.update(x1 + 416, y); - RenderManager.drawHollowRoundRect(vg, x1 + 415, y - 1, 64, 32, OneConfigConfig.GRAY_300, 12f, 2f); + RenderManager.drawHollowRoundRect(vg, x1 + 415, y - 1, 64, 32, Colors.GRAY_300, 12f, 2f); RenderManager.drawRoundImage(vg, Images.ALPHA_GRID, x1 + 420, y + 4, 56, 24, 8f); RenderManager.drawRoundedRect(vg, x1 + 420, y + 4, 56, 24, color.getRGB(), 8f); if (element.isClicked() && !element.isToggled()) { diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigDropdown.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigDropdown.java index 472f80e..1d64420 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigDropdown.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigDropdown.java @@ -1,11 +1,11 @@ package cc.polyfrost.oneconfig.gui.elements.config; -import cc.polyfrost.oneconfig.config.OneConfigConfig; -import cc.polyfrost.oneconfig.config.interfaces.BasicOption; +import cc.polyfrost.oneconfig.gui.Colors; +import cc.polyfrost.oneconfig.config.elements.BasicOption; import cc.polyfrost.oneconfig.gui.animations.ColorAnimation; -import cc.polyfrost.oneconfig.lwjgl.RenderManager; -import cc.polyfrost.oneconfig.lwjgl.font.Fonts; -import cc.polyfrost.oneconfig.lwjgl.image.SVGs; +import cc.polyfrost.oneconfig.renderer.RenderManager; +import cc.polyfrost.oneconfig.renderer.font.Fonts; +import cc.polyfrost.oneconfig.renderer.image.SVGs; import cc.polyfrost.oneconfig.utils.InputUtils; import cc.polyfrost.oneconfig.utils.color.ColorPalette; import org.lwjgl.input.Mouse; @@ -17,7 +17,7 @@ import java.util.Arrays; public class ConfigDropdown extends BasicOption { private final String[] options; private final ColorAnimation backgroundColor = new ColorAnimation(ColorPalette.SECONDARY); - private final ColorAnimation atomColor = new ColorAnimation(new ColorPalette(OneConfigConfig.PRIMARY_600, OneConfigConfig.PRIMARY_500, OneConfigConfig.PRIMARY_500)); + private final ColorAnimation atomColor = new ColorAnimation(new ColorPalette(Colors.PRIMARY_600, Colors.PRIMARY_500, Colors.PRIMARY_500)); private boolean opened = false; public ConfigDropdown(Field field, Object parent, String name, int size, String[] options) { @@ -28,7 +28,7 @@ public class ConfigDropdown extends BasicOption { @Override public void draw(long vg, int x, int y) { if (!isEnabled()) RenderManager.setAlpha(vg, 0.5f); - RenderManager.drawText(vg, name, x, y + 16, OneConfigConfig.WHITE_90, 14f, Fonts.MEDIUM); + RenderManager.drawText(vg, name, x, y + 16, Colors.WHITE_90, 14f, Fonts.MEDIUM); boolean hovered; if (size == 1) hovered = InputUtils.isAreaHovered(x + 224, y, 256, 32) && isEnabled(); @@ -52,12 +52,12 @@ public class ConfigDropdown extends BasicOption { if (hovered && Mouse.isButtonDown(0)) RenderManager.setAlpha(vg, 0.8f); if (size == 1) { RenderManager.drawRoundedRect(vg, x + 224, y, 256, 32, backgroundColor.getColor(hovered, hovered && Mouse.isButtonDown(0)), 12); - RenderManager.drawText(vg, options[selected], x + 236, y + 16, OneConfigConfig.WHITE_80, 14f, Fonts.MEDIUM); + RenderManager.drawText(vg, options[selected], x + 236, y + 16, Colors.WHITE_80, 14f, Fonts.MEDIUM); RenderManager.drawRoundedRect(vg, x + 452, y + 4, 24, 24, atomColor.getColor(hovered, false), 8); RenderManager.drawSvg(vg, SVGs.DROPDOWN_LIST, x + 452, y + 4, 24, 24); } else { RenderManager.drawRoundedRect(vg, x + 352, y, 640, 32, backgroundColor.getColor(hovered, hovered && Mouse.isButtonDown(0)), 12); - RenderManager.drawText(vg, options[selected], x + 364, y + 16, OneConfigConfig.WHITE_80, 14f, Fonts.MEDIUM); + RenderManager.drawText(vg, options[selected], x + 364, y + 16, Colors.WHITE_80, 14f, Fonts.MEDIUM); RenderManager.drawRoundedRect(vg, x + 964, y + 4, 24, 24, atomColor.getColor(hovered, false), 8); RenderManager.drawSvg(vg, SVGs.DROPDOWN_LIST, x + 964, y + 4, 24, 24); } @@ -81,23 +81,23 @@ public class ConfigDropdown extends BasicOption { if (hovered && Mouse.isButtonDown(0)) RenderManager.setAlpha(vg, 0.8f); if (size == 1) { RenderManager.drawRoundedRect(vg, x + 224, y, 256, 32, backgroundColor.getColor(hovered, hovered && Mouse.isButtonDown(0)), 12); - RenderManager.drawText(vg, options[selected], x + 236, y + 16, OneConfigConfig.WHITE_80, 14f, Fonts.MEDIUM); + RenderManager.drawText(vg, options[selected], x + 236, y + 16, Colors.WHITE_80, 14f, Fonts.MEDIUM); if (hovered && Mouse.isButtonDown(0)) RenderManager.setAlpha(vg, 0.8f); RenderManager.drawRoundedRect(vg, x + 452, y + 4, 24, 24, atomColor.getColor(hovered, false), 8); RenderManager.drawSvg(vg, SVGs.DROPDOWN_LIST, x + 452, y + 4, 24, 24); RenderManager.setAlpha(vg, 1f); - RenderManager.drawRoundedRect(vg, x + 224, y + 40, 256, options.length * 32 + 8, OneConfigConfig.GRAY_700, 12); + RenderManager.drawRoundedRect(vg, x + 224, y + 40, 256, options.length * 32 + 8, Colors.GRAY_700, 12); RenderManager.drawHollowRoundRect(vg, x + 223, y + 39, 258, options.length * 32 + 10, new Color(204, 204, 204, 77).getRGB(), 12, 1); int optionY = y + 44; for (String option : options) { - int color = OneConfigConfig.WHITE_80; + int color = Colors.WHITE_80; boolean optionHovered = InputUtils.isAreaHovered(x + 224, optionY, 252, 32); if (optionHovered && Mouse.isButtonDown(0)) { - RenderManager.drawRoundedRect(vg, x + 228, optionY + 2, 248, 28, OneConfigConfig.PRIMARY_700_80, 8); + RenderManager.drawRoundedRect(vg, x + 228, optionY + 2, 248, 28, Colors.PRIMARY_700_80, 8); } else if (optionHovered) { - RenderManager.drawRoundedRect(vg, x + 228, optionY + 2, 248, 28, OneConfigConfig.PRIMARY_700, 8); - color = OneConfigConfig.WHITE; + RenderManager.drawRoundedRect(vg, x + 228, optionY + 2, 248, 28, Colors.PRIMARY_700, 8); + color = Colors.WHITE; } if (optionHovered && InputUtils.isClicked(true)) { try { @@ -114,23 +114,23 @@ public class ConfigDropdown extends BasicOption { } } else { RenderManager.drawRoundedRect(vg, x + 352, y, 640, 32, backgroundColor.getColor(hovered, hovered && Mouse.isButtonDown(0)), 12); - RenderManager.drawText(vg, options[selected], x + 364, y + 16, OneConfigConfig.WHITE_80, 14f, Fonts.MEDIUM); + RenderManager.drawText(vg, options[selected], x + 364, y + 16, Colors.WHITE_80, 14f, Fonts.MEDIUM); if (hovered && Mouse.isButtonDown(0)) RenderManager.setAlpha(vg, 0.8f); RenderManager.drawRoundedRect(vg, x + 964, y + 4, 24, 24, atomColor.getColor(hovered, false), 8); RenderManager.drawSvg(vg, SVGs.DROPDOWN_LIST, x + 964, y + 4, 24, 24); RenderManager.setAlpha(vg, 1f); - RenderManager.drawRoundedRect(vg, x + 352, y + 40, 640, options.length * 32 + 8, OneConfigConfig.GRAY_700, 12); + RenderManager.drawRoundedRect(vg, x + 352, y + 40, 640, options.length * 32 + 8, Colors.GRAY_700, 12); RenderManager.drawHollowRoundRect(vg, x + 351, y + 39, 642, options.length * 32 + 10, new Color(204, 204, 204, 77).getRGB(), 12, 1); int optionY = y + 44; for (String option : options) { - int color = OneConfigConfig.WHITE_80; + int color = Colors.WHITE_80; boolean optionHovered = InputUtils.isAreaHovered(x + 352, optionY, 640, 36); if (optionHovered && Mouse.isButtonDown(0)) { - RenderManager.drawRoundedRect(vg, x + 356, optionY + 2, 632, 28, OneConfigConfig.PRIMARY_700_80, 8); + RenderManager.drawRoundedRect(vg, x + 356, optionY + 2, 632, 28, Colors.PRIMARY_700_80, 8); } else if (optionHovered) { - RenderManager.drawRoundedRect(vg, x + 356, optionY + 2, 632, 28, OneConfigConfig.PRIMARY_700, 8); - color = OneConfigConfig.WHITE; + RenderManager.drawRoundedRect(vg, x + 356, optionY + 2, 632, 28, Colors.PRIMARY_700, 8); + color = Colors.WHITE; } RenderManager.drawText(vg, option, x + 368, optionY + 18, color, 14, Fonts.MEDIUM); diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigDualOption.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigDualOption.java index e7b1083..5bf28c0 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigDualOption.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigDualOption.java @@ -1,12 +1,12 @@ package cc.polyfrost.oneconfig.gui.elements.config; -import cc.polyfrost.oneconfig.config.OneConfigConfig; -import cc.polyfrost.oneconfig.config.interfaces.BasicOption; +import cc.polyfrost.oneconfig.gui.Colors; +import cc.polyfrost.oneconfig.config.elements.BasicOption; import cc.polyfrost.oneconfig.gui.animations.Animation; import cc.polyfrost.oneconfig.gui.animations.DummyAnimation; import cc.polyfrost.oneconfig.gui.animations.EaseInOutCubic; -import cc.polyfrost.oneconfig.lwjgl.RenderManager; -import cc.polyfrost.oneconfig.lwjgl.font.Fonts; +import cc.polyfrost.oneconfig.renderer.RenderManager; +import cc.polyfrost.oneconfig.renderer.font.Fonts; import cc.polyfrost.oneconfig.utils.InputUtils; import java.lang.reflect.Field; @@ -38,14 +38,14 @@ public class ConfigDualOption extends BasicOption { if (!isEnabled()) RenderManager.setAlpha(vg, 0.5f); boolean hoveredLeft = InputUtils.isAreaHovered(x + 226, y, 128, 32) && isEnabled(); boolean hoveredRight = InputUtils.isAreaHovered(x + 354, y, 128, 32) && isEnabled(); - RenderManager.drawText(vg, name, x, y + 16, OneConfigConfig.WHITE_90, 14f, Fonts.MEDIUM); - RenderManager.drawRoundedRect(vg, x + 226, y, 256, 32, OneConfigConfig.GRAY_600, 12f); - RenderManager.drawRoundedRect(vg, x + posAnimation.get(), y + 2, 124, 28, OneConfigConfig.PRIMARY_600, 10f); + RenderManager.drawText(vg, name, x, y + 16, Colors.WHITE_90, 14f, Fonts.MEDIUM); + RenderManager.drawRoundedRect(vg, x + 226, y, 256, 32, Colors.GRAY_600, 12f); + RenderManager.drawRoundedRect(vg, x + posAnimation.get(), y + 2, 124, 28, Colors.PRIMARY_600, 10f); if (!hoveredLeft && isEnabled()) RenderManager.setAlpha(vg, 0.8f); - RenderManager.drawText(vg, left, x + 290 - RenderManager.getTextWidth(vg, left, 12f, Fonts.MEDIUM) / 2, y + 17, OneConfigConfig.WHITE, 12f, Fonts.MEDIUM); + RenderManager.drawText(vg, left, x + 290 - RenderManager.getTextWidth(vg, left, 12f, Fonts.MEDIUM) / 2, y + 17, Colors.WHITE, 12f, Fonts.MEDIUM); if (isEnabled()) RenderManager.setAlpha(vg, 1f); if (!hoveredRight && isEnabled()) RenderManager.setAlpha(vg, 0.8f); - RenderManager.drawText(vg, right, x + 418 - RenderManager.getTextWidth(vg, right, 12f, Fonts.MEDIUM) / 2, y + 17, OneConfigConfig.WHITE, 12f, Fonts.MEDIUM); + RenderManager.drawText(vg, right, x + 418 - RenderManager.getTextWidth(vg, right, 12f, Fonts.MEDIUM) / 2, y + 17, Colors.WHITE, 12f, Fonts.MEDIUM); RenderManager.setAlpha(vg, 1); if ((hoveredLeft && toggled || hoveredRight && !toggled) && InputUtils.isClicked()) { diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigHeader.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigHeader.java index 445424e..bfdb8ca 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigHeader.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigHeader.java @@ -1,11 +1,11 @@ package cc.polyfrost.oneconfig.gui.elements.config; -import cc.polyfrost.oneconfig.config.OneConfigConfig; -import cc.polyfrost.oneconfig.config.interfaces.BasicOption; -import cc.polyfrost.oneconfig.lwjgl.RenderManager; -import cc.polyfrost.oneconfig.lwjgl.font.Fonts; -import cc.polyfrost.oneconfig.lwjgl.scissor.Scissor; -import cc.polyfrost.oneconfig.lwjgl.scissor.ScissorManager; +import cc.polyfrost.oneconfig.gui.Colors; +import cc.polyfrost.oneconfig.config.elements.BasicOption; +import cc.polyfrost.oneconfig.renderer.RenderManager; +import cc.polyfrost.oneconfig.renderer.font.Fonts; +import cc.polyfrost.oneconfig.renderer.scissor.Scissor; +import cc.polyfrost.oneconfig.renderer.scissor.ScissorManager; import java.lang.reflect.Field; @@ -18,7 +18,7 @@ public class ConfigHeader extends BasicOption { @Override public void draw(long vg, int x, int y) { Scissor scissor = ScissorManager.scissor(vg, x, y, size == 1 ? 480 : 992, 32); - RenderManager.drawText(vg, name, x, y + 17, OneConfigConfig.WHITE_90, 24, Fonts.MEDIUM); + RenderManager.drawText(vg, name, x, y + 17, Colors.WHITE_90, 24, Fonts.MEDIUM); ScissorManager.resetScissor(vg, scissor); } diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigInfo.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigInfo.java index 6a6c4f2..c0e041f 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigInfo.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigInfo.java @@ -1,12 +1,12 @@ package cc.polyfrost.oneconfig.gui.elements.config; -import cc.polyfrost.oneconfig.config.OneConfigConfig; +import cc.polyfrost.oneconfig.gui.Colors; import cc.polyfrost.oneconfig.config.data.InfoType; -import cc.polyfrost.oneconfig.config.interfaces.BasicOption; -import cc.polyfrost.oneconfig.lwjgl.RenderManager; -import cc.polyfrost.oneconfig.lwjgl.font.Fonts; -import cc.polyfrost.oneconfig.lwjgl.scissor.Scissor; -import cc.polyfrost.oneconfig.lwjgl.scissor.ScissorManager; +import cc.polyfrost.oneconfig.config.elements.BasicOption; +import cc.polyfrost.oneconfig.renderer.RenderManager; +import cc.polyfrost.oneconfig.renderer.font.Fonts; +import cc.polyfrost.oneconfig.renderer.scissor.Scissor; +import cc.polyfrost.oneconfig.renderer.scissor.ScissorManager; import java.lang.reflect.Field; @@ -22,7 +22,7 @@ public class ConfigInfo extends BasicOption { public void draw(long vg, int x, int y) { Scissor scissor = ScissorManager.scissor(vg, x, y, size == 1 ? 448 : 960, 32); RenderManager.drawInfo(vg, type, x, y + 4, 24); - RenderManager.drawText(vg, name, x + 32, y + 18, OneConfigConfig.WHITE_90, 14, Fonts.MEDIUM); + RenderManager.drawText(vg, name, x + 32, y + 18, Colors.WHITE_90, 14, Fonts.MEDIUM); ScissorManager.resetScissor(vg, scissor); } diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigKeyBind.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigKeyBind.java index a448b14..986bb98 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigKeyBind.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigKeyBind.java @@ -1,13 +1,13 @@ package cc.polyfrost.oneconfig.gui.elements.config; -import cc.polyfrost.oneconfig.config.OneConfigConfig; +import cc.polyfrost.oneconfig.gui.Colors; import cc.polyfrost.oneconfig.config.core.OneKeyBind; -import cc.polyfrost.oneconfig.config.interfaces.BasicOption; +import cc.polyfrost.oneconfig.config.elements.BasicOption; import cc.polyfrost.oneconfig.gui.OneConfigGui; import cc.polyfrost.oneconfig.gui.elements.BasicButton; -import cc.polyfrost.oneconfig.lwjgl.RenderManager; -import cc.polyfrost.oneconfig.lwjgl.font.Fonts; -import cc.polyfrost.oneconfig.lwjgl.image.SVGs; +import cc.polyfrost.oneconfig.renderer.RenderManager; +import cc.polyfrost.oneconfig.renderer.font.Fonts; +import cc.polyfrost.oneconfig.renderer.image.SVGs; import cc.polyfrost.oneconfig.utils.color.ColorPalette; import gg.essential.universal.UKeyboard; @@ -26,7 +26,7 @@ public class ConfigKeyBind extends BasicOption { @Override public void draw(long vg, int x, int y) { if (!isEnabled()) RenderManager.setAlpha(vg, 0.5f); - RenderManager.drawText(vg, name, x, y + 17, OneConfigConfig.WHITE, 14f, Fonts.MEDIUM); + RenderManager.drawText(vg, name, x, y + 17, Colors.WHITE, 14f, Fonts.MEDIUM); OneKeyBind keyBind = getKeyBind(); String text = keyBind.getDisplay(); button.disable(!isEnabled()); diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigPageButton.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigPageButton.java index 8b47045..e4fcc77 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigPageButton.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigPageButton.java @@ -1,14 +1,14 @@ package cc.polyfrost.oneconfig.gui.elements.config; -import cc.polyfrost.oneconfig.config.OneConfigConfig; -import cc.polyfrost.oneconfig.config.data.OptionPage; -import cc.polyfrost.oneconfig.config.interfaces.BasicOption; +import cc.polyfrost.oneconfig.gui.Colors; +import cc.polyfrost.oneconfig.config.elements.OptionPage; +import cc.polyfrost.oneconfig.config.elements.BasicOption; import cc.polyfrost.oneconfig.gui.OneConfigGui; import cc.polyfrost.oneconfig.gui.animations.ColorAnimation; import cc.polyfrost.oneconfig.gui.pages.ModConfigPage; -import cc.polyfrost.oneconfig.lwjgl.RenderManager; -import cc.polyfrost.oneconfig.lwjgl.font.Fonts; -import cc.polyfrost.oneconfig.lwjgl.image.SVGs; +import cc.polyfrost.oneconfig.renderer.RenderManager; +import cc.polyfrost.oneconfig.renderer.font.Fonts; +import cc.polyfrost.oneconfig.renderer.image.SVGs; import cc.polyfrost.oneconfig.utils.InputUtils; import cc.polyfrost.oneconfig.utils.color.ColorPalette; import org.lwjgl.input.Mouse; @@ -35,9 +35,9 @@ public class ConfigPageButton extends BasicOption { if (!isEnabled()) RenderManager.setAlpha(vg, 0.5f); RenderManager.drawRoundedRect(vg, x - 16, y, 1024, height, backgroundColor.getColor(hovered, hovered && Mouse.isButtonDown(0)), 20); - RenderManager.drawText(vg, name, x + 10, y + 32, OneConfigConfig.WHITE_90, 24, Fonts.MEDIUM); + RenderManager.drawText(vg, name, x + 10, y + 32, Colors.WHITE_90, 24, Fonts.MEDIUM); if (!description.equals("")) - RenderManager.drawText(vg, name, x + 10, y + 70, OneConfigConfig.WHITE_90, 14, Fonts.MEDIUM); + RenderManager.drawText(vg, name, x + 10, y + 70, Colors.WHITE_90, 14, Fonts.MEDIUM); RenderManager.drawSvg(vg, SVGs.CARET_RIGHT, x + 981f, y + (description.equals("") ? 20f : 36f), 13, 22); if (clicked) OneConfigGui.INSTANCE.openPage(new ModConfigPage(page)); diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigSlider.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigSlider.java index 45217c0..2bda274 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigSlider.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigSlider.java @@ -1,10 +1,10 @@ package cc.polyfrost.oneconfig.gui.elements.config; -import cc.polyfrost.oneconfig.config.OneConfigConfig; -import cc.polyfrost.oneconfig.config.interfaces.BasicOption; +import cc.polyfrost.oneconfig.gui.Colors; +import cc.polyfrost.oneconfig.config.elements.BasicOption; import cc.polyfrost.oneconfig.gui.elements.text.NumberInputField; -import cc.polyfrost.oneconfig.lwjgl.RenderManager; -import cc.polyfrost.oneconfig.lwjgl.font.Fonts; +import cc.polyfrost.oneconfig.renderer.RenderManager; +import cc.polyfrost.oneconfig.renderer.font.Fonts; import cc.polyfrost.oneconfig.utils.InputUtils; import cc.polyfrost.oneconfig.utils.MathUtils; import org.lwjgl.input.Mouse; @@ -67,17 +67,17 @@ public class ConfigSlider extends BasicOption { } if (!inputField.isToggled()) inputField.setCurrentValue(value); - RenderManager.drawText(vg, name, x, y + 17, OneConfigConfig.WHITE_90, 14f, Fonts.MEDIUM); - RenderManager.drawRoundedRect(vg, x + 352, y + 13, 512, 6, OneConfigConfig.GRAY_300, 4f); - RenderManager.drawRoundedRect(vg, x + 352, y + 13, xCoordinate - x - 352, 6, OneConfigConfig.PRIMARY_500, 4f); + RenderManager.drawText(vg, name, x, y + 17, Colors.WHITE_90, 14f, Fonts.MEDIUM); + RenderManager.drawRoundedRect(vg, x + 352, y + 13, 512, 6, Colors.GRAY_300, 4f); + RenderManager.drawRoundedRect(vg, x + 352, y + 13, xCoordinate - x - 352, 6, Colors.PRIMARY_500, 4f); if (step > 0) { for (float i = x + 352; i <= x + 864; i += 512 / ((max - min) / step)) { - int color = xCoordinate > i - 2 ? OneConfigConfig.PRIMARY_500 : OneConfigConfig.GRAY_300; + int color = xCoordinate > i - 2 ? Colors.PRIMARY_500 : Colors.GRAY_300; RenderManager.drawRoundedRect(vg, i - 2, y + 9, 4, 14, color, 2f); } } - if (step == 0) RenderManager.drawRoundedRect(vg, xCoordinate - 12, y + 4, 24, 24, OneConfigConfig.WHITE, 12f); - else RenderManager.drawRoundedRect(vg, xCoordinate - 4, y + 4, 8, 24, OneConfigConfig.WHITE, 4f); + if (step == 0) RenderManager.drawRoundedRect(vg, xCoordinate - 12, y + 4, 24, 24, Colors.WHITE, 12f); + else RenderManager.drawRoundedRect(vg, xCoordinate - 4, y + 4, 8, 24, Colors.WHITE, 4f); inputField.draw(vg, x + 892, y); RenderManager.setAlpha(vg, 1f); } diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigSwitch.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigSwitch.java index 090f5a6..2aedf4e 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigSwitch.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigSwitch.java @@ -1,13 +1,13 @@ package cc.polyfrost.oneconfig.gui.elements.config; -import cc.polyfrost.oneconfig.config.OneConfigConfig; -import cc.polyfrost.oneconfig.config.interfaces.BasicOption; +import cc.polyfrost.oneconfig.gui.Colors; +import cc.polyfrost.oneconfig.config.elements.BasicOption; import cc.polyfrost.oneconfig.gui.animations.Animation; import cc.polyfrost.oneconfig.gui.animations.ColorAnimation; import cc.polyfrost.oneconfig.gui.animations.DummyAnimation; import cc.polyfrost.oneconfig.gui.animations.EaseInOutQuad; -import cc.polyfrost.oneconfig.lwjgl.RenderManager; -import cc.polyfrost.oneconfig.lwjgl.font.Fonts; +import cc.polyfrost.oneconfig.renderer.RenderManager; +import cc.polyfrost.oneconfig.renderer.font.Fonts; import cc.polyfrost.oneconfig.utils.InputUtils; import cc.polyfrost.oneconfig.utils.color.ColorPalette; import org.lwjgl.input.Mouse; @@ -38,8 +38,8 @@ public class ConfigSwitch extends BasicOption { boolean hovered = InputUtils.isAreaHovered(x, y, 42, 32); if (!isEnabled()) RenderManager.setAlpha(vg, 0.5f); RenderManager.drawRoundedRect(vg, x, y + 4, 42, 24, color.getColor(hovered, hovered && Mouse.isButtonDown(0)), 12f); - RenderManager.drawRoundedRect(vg, x2, y + 7, 18, 18, OneConfigConfig.WHITE, 9f); - RenderManager.drawText(vg, name, x + 50, y + 17, OneConfigConfig.WHITE, 14f, Fonts.MEDIUM); + RenderManager.drawRoundedRect(vg, x2, y + 7, 18, 18, Colors.WHITE, 9f); + RenderManager.drawText(vg, name, x + 50, y + 17, Colors.WHITE, 14f, Fonts.MEDIUM); if (InputUtils.isAreaClicked(x, y, 42, 32) && isEnabled()) { toggled = !toggled; diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigTextBox.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigTextBox.java index 966a85e..225232b 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigTextBox.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigTextBox.java @@ -1,11 +1,11 @@ package cc.polyfrost.oneconfig.gui.elements.config; -import cc.polyfrost.oneconfig.config.OneConfigConfig; -import cc.polyfrost.oneconfig.config.interfaces.BasicOption; +import cc.polyfrost.oneconfig.gui.Colors; +import cc.polyfrost.oneconfig.config.elements.BasicOption; import cc.polyfrost.oneconfig.gui.elements.text.TextInputField; -import cc.polyfrost.oneconfig.lwjgl.RenderManager; -import cc.polyfrost.oneconfig.lwjgl.font.Fonts; -import cc.polyfrost.oneconfig.lwjgl.image.SVGs; +import cc.polyfrost.oneconfig.renderer.RenderManager; +import cc.polyfrost.oneconfig.renderer.font.Fonts; +import cc.polyfrost.oneconfig.renderer.image.SVGs; import cc.polyfrost.oneconfig.utils.InputUtils; import org.lwjgl.input.Mouse; @@ -27,7 +27,7 @@ public class ConfigTextBox extends BasicOption { public void draw(long vg, int x, int y) { if (!isEnabled()) RenderManager.setAlpha(vg, 0.5f); textField.disable(!isEnabled()); - RenderManager.drawText(vg, name, x, y + 16, OneConfigConfig.WHITE_90, 14, Fonts.MEDIUM); + RenderManager.drawText(vg, name, x, y + 16, Colors.WHITE_90, 14, Fonts.MEDIUM); try { String value = (String) get(); @@ -42,7 +42,7 @@ public class ConfigTextBox extends BasicOption { if (secure) { SVGs icon = textField.getPassword() ? SVGs.EYE_OFF : SVGs.EYE; boolean hovered = InputUtils.isAreaHovered(x + 967, y + 7, 18, 18) && isEnabled(); - int color = hovered ? OneConfigConfig.WHITE : OneConfigConfig.WHITE_80; + int color = hovered ? Colors.WHITE : Colors.WHITE_80; if (hovered && InputUtils.isClicked()) textField.setPassword(!textField.getPassword()); if (hovered && Mouse.isButtonDown(0)) RenderManager.setAlpha(vg, 0.5f); RenderManager.drawSvg(vg, icon, x + 967, y + 7, 18, 18, color); diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/text/NumberInputField.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/text/NumberInputField.java index ed05760..a76c242 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/text/NumberInputField.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/text/NumberInputField.java @@ -1,10 +1,10 @@ package cc.polyfrost.oneconfig.gui.elements.text; -import cc.polyfrost.oneconfig.config.OneConfigConfig; +import cc.polyfrost.oneconfig.gui.Colors; import cc.polyfrost.oneconfig.gui.animations.ColorAnimation; import cc.polyfrost.oneconfig.gui.elements.BasicElement; -import cc.polyfrost.oneconfig.lwjgl.RenderManager; -import cc.polyfrost.oneconfig.lwjgl.image.SVGs; +import cc.polyfrost.oneconfig.renderer.RenderManager; +import cc.polyfrost.oneconfig.renderer.image.SVGs; import cc.polyfrost.oneconfig.utils.color.ColorPalette; public class NumberInputField extends TextInputField { @@ -29,7 +29,7 @@ public class NumberInputField extends TextInputField { @Override public void draw(long vg, int x, int y) { super.errored = false; - RenderManager.drawRoundedRect(vg, x + width + 4, y, 12, 28, OneConfigConfig.GRAY_500, 6f); + RenderManager.drawRoundedRect(vg, x + width + 4, y, 12, 28, Colors.GRAY_500, 6f); upArrow.disable(disabled); downArrow.disable(disabled); upArrow.update(x + width + 4, y); diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/text/SearchField.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/text/SearchField.java deleted file mode 100644 index af7b6e1..0000000 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/text/SearchField.java +++ /dev/null @@ -1,14 +0,0 @@ -package cc.polyfrost.oneconfig.gui.elements.text; - -public class SearchField extends TextInputField { - - public SearchField(int width, int height, String defaultText, boolean multiLine, boolean password) { - super(width, height, defaultText, multiLine, password); - } - - @Override - public void draw(long vg, int x, int y) { - super.draw(vg, x, y); - // TODO - } -} diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/text/TextInputField.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/text/TextInputField.java index b16472d..3fde012 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/text/TextInputField.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/text/TextInputField.java @@ -1,12 +1,12 @@ package cc.polyfrost.oneconfig.gui.elements.text; -import cc.polyfrost.oneconfig.config.OneConfigConfig; +import cc.polyfrost.oneconfig.gui.Colors; import cc.polyfrost.oneconfig.gui.elements.BasicElement; -import cc.polyfrost.oneconfig.lwjgl.RenderManager; -import cc.polyfrost.oneconfig.lwjgl.font.Fonts; -import cc.polyfrost.oneconfig.lwjgl.image.SVGs; -import cc.polyfrost.oneconfig.lwjgl.scissor.Scissor; -import cc.polyfrost.oneconfig.lwjgl.scissor.ScissorManager; +import cc.polyfrost.oneconfig.renderer.RenderManager; +import cc.polyfrost.oneconfig.renderer.font.Fonts; +import cc.polyfrost.oneconfig.renderer.image.SVGs; +import cc.polyfrost.oneconfig.renderer.scissor.Scissor; +import cc.polyfrost.oneconfig.renderer.scissor.ScissorManager; import cc.polyfrost.oneconfig.utils.InputUtils; import cc.polyfrost.oneconfig.utils.MathUtils; import cc.polyfrost.oneconfig.utils.TextUtils; @@ -102,14 +102,14 @@ public class TextInputField extends BasicElement { this.y = y; this.vg = vg; try { - int colorOutline = errored ? OneConfigConfig.ERROR_700 : OneConfigConfig.GRAY_700; + int colorOutline = errored ? Colors.ERROR_700 : Colors.GRAY_700; if (!toggled) RenderManager.drawHollowRoundRect(vg, x, y, width - 0.5f, height - 0.5f, colorOutline, 12f, 2f); else { RenderManager.setAlpha(vg, 0.15f); - RenderManager.drawRoundedRect(vg, x - 4, y - 4, width + 8, height + 8, errored ? OneConfigConfig.ERROR_600 : OneConfigConfig.PRIMARY_600, 16); + RenderManager.drawRoundedRect(vg, x - 4, y - 4, width + 8, height + 8, errored ? Colors.ERROR_600 : Colors.PRIMARY_600, 16); RenderManager.setAlpha(vg, 1f); - RenderManager.drawHollowRoundRect(vg, x, y, width - 0.5f, height - 0.5f, errored ? OneConfigConfig.ERROR_600 : OneConfigConfig.PRIMARY_600, 12f, 2f); + RenderManager.drawHollowRoundRect(vg, x, y, width - 0.5f, height - 0.5f, errored ? Colors.ERROR_600 : Colors.PRIMARY_600, 12f, 2f); } Scissor scissor = ScissorManager.scissor(vg, x, y, width, height); super.update(x, y); @@ -117,7 +117,7 @@ public class TextInputField extends BasicElement { onClose(); toggled = false; } - int color = toggled ? OneConfigConfig.WHITE : OneConfigConfig.WHITE_60; + int color = toggled ? Colors.WHITE : Colors.WHITE_60; if (!toggled) caretPos = input.length(); if (caretPos > input.length()) caretPos = input.length(); if (prevCaret > input.length()) prevCaret = input.length(); @@ -177,15 +177,15 @@ public class TextInputField extends BasicElement { float halfTextWidth = this.getTextWidth(vg, input) / 2f; if (start != 0f && end != 0f && toggled) { if (!multiLine) { - RenderManager.drawRect(vg, start, y + height / 2f - 10, end, 20, OneConfigConfig.GRAY_300); + RenderManager.drawRect(vg, start, y + height / 2f - 10, end, 20, Colors.GRAY_300); } else if (startLine == endLine) { - RenderManager.drawRect(vg, start, y + 10 + 24 * startLine, end, 20, OneConfigConfig.GRAY_300); + RenderManager.drawRect(vg, start, y + 10 + 24 * startLine, end, 20, Colors.GRAY_300); } else { - RenderManager.drawRect(vg, start, y + 10 + 24 * startLine, this.width - 24, 20, OneConfigConfig.GRAY_300); + RenderManager.drawRect(vg, start, y + 10 + 24 * startLine, this.width - 24, 20, Colors.GRAY_300); for (int i = startLine + 1; i < endLine; i++) { - RenderManager.drawRect(vg, x + 12, y + 10 + 24 * i, this.width - 24, 20, OneConfigConfig.GRAY_300); + RenderManager.drawRect(vg, x + 12, y + 10 + 24 * i, this.width - 24, 20, Colors.GRAY_300); } - RenderManager.drawRect(vg, x + 12, y + 10 + 24 * endLine, end, 20, OneConfigConfig.GRAY_300); + RenderManager.drawRect(vg, x + 12, y + 10 + 24 * endLine, end, 20, Colors.GRAY_300); } } if (hovered) { @@ -215,11 +215,11 @@ public class TextInputField extends BasicElement { if (toggled) { if (multiLine) { int lineY = y + 20 + getCaretLine(caretPos) * 24; - RenderManager.drawLine(vg, x + width + 12, lineY - 10, x + width + 12, lineY + 10, 1, OneConfigConfig.WHITE); + RenderManager.drawLine(vg, x + width + 12, lineY - 10, x + width + 12, lineY + 10, 1, Colors.WHITE); } else if (!centered) { - RenderManager.drawLine(vg, x + width + 12, (float) y + height / 2f - 10, x + width + 12, (float) y + height / 2f + 10, 1, OneConfigConfig.WHITE); + RenderManager.drawLine(vg, x + width + 12, (float) y + height / 2f - 10, x + width + 12, (float) y + height / 2f + 10, 1, Colors.WHITE); } else { - RenderManager.drawLine(vg, x + this.width / 2f - halfTextWidth + width, (float) y + height / 2f - 10, x + this.width / 2f - halfTextWidth + width, (float) y + height / 2f + 10, 1, OneConfigConfig.WHITE); + RenderManager.drawLine(vg, x + this.width / 2f - halfTextWidth + width, (float) y + height / 2f - 10, x + this.width / 2f - halfTextWidth + width, (float) y + height / 2f + 10, 1, Colors.WHITE); } } diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/pages/CreditsPage.java b/src/main/java/cc/polyfrost/oneconfig/gui/pages/CreditsPage.java index f67a028..ddc144c 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/pages/CreditsPage.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/pages/CreditsPage.java @@ -1,8 +1,8 @@ package cc.polyfrost.oneconfig.gui.pages; -import cc.polyfrost.oneconfig.lwjgl.RenderManager; -import cc.polyfrost.oneconfig.lwjgl.font.Fonts; -import cc.polyfrost.oneconfig.lwjgl.image.SVGs; +import cc.polyfrost.oneconfig.renderer.RenderManager; +import cc.polyfrost.oneconfig.renderer.font.Fonts; +import cc.polyfrost.oneconfig.renderer.image.SVGs; public class CreditsPage extends Page { public CreditsPage() { diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/pages/HomePage.java b/src/main/java/cc/polyfrost/oneconfig/gui/pages/HomePage.java index bd73c1e..4c24058 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/pages/HomePage.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/pages/HomePage.java @@ -1,9 +1,9 @@ package cc.polyfrost.oneconfig.gui.pages; -import cc.polyfrost.oneconfig.config.OneConfigConfig; -import cc.polyfrost.oneconfig.lwjgl.RenderManager; -import cc.polyfrost.oneconfig.lwjgl.font.Fonts; -import cc.polyfrost.oneconfig.lwjgl.image.SVGs; +import cc.polyfrost.oneconfig.gui.Colors; +import cc.polyfrost.oneconfig.renderer.RenderManager; +import cc.polyfrost.oneconfig.renderer.font.Fonts; +import cc.polyfrost.oneconfig.renderer.image.SVGs; public class HomePage extends Page { /*private final BasicButton socialsBtn = new BasicButton(184, 36, "Socials", SVGs.SHARE, SVGs.POP_OUT, BasicButton.ALIGNMENT_CENTER, ColorUtils.PRIMARY); @@ -34,10 +34,10 @@ public class HomePage extends Page { public void draw(long vg, int x, int y) { RenderManager.drawRoundedRect(vg, x, y, 184, 36, -1, 12f); RenderManager.drawText(vg, "This is a cool string to test pages", x + 32, y + 72, -1, 36f, Fonts.BOLD); - RenderManager.drawRoundedRect(vg, x + 350, y + 310, 300, 200, OneConfigConfig.PRIMARY_600, 14f); + RenderManager.drawRoundedRect(vg, x + 350, y + 310, 300, 200, Colors.PRIMARY_600, 14f); RenderManager.drawSvg(vg, SVGs.INFO_CIRCLE, x + 20, y + 604, 24, 24); - RenderManager.drawText(vg, "Info", x + 52, y + 618, OneConfigConfig.WHITE_90, 24f, Fonts.MEDIUM); - RenderManager.drawRoundedRect(vg, x + 16, y + 644, 1024, 64, OneConfigConfig.GRAY_700, 20f); + RenderManager.drawText(vg, "Info", x + 52, y + 618, Colors.WHITE_90, 24f, Fonts.MEDIUM); + RenderManager.drawRoundedRect(vg, x + 16, y + 644, 1024, 64, Colors.GRAY_700, 20f); RenderManager.drawURL(vg, "https://www.youtube.com/watch?v=dQw4w9WgXcQ", x + 100, y + 205, 24, Fonts.MEDIUM); diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModConfigPage.java b/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModConfigPage.java index b5f2256..3e8fbf8 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModConfigPage.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModConfigPage.java @@ -1,11 +1,11 @@ package cc.polyfrost.oneconfig.gui.pages; -import cc.polyfrost.oneconfig.config.data.OptionPage; -import cc.polyfrost.oneconfig.config.data.OptionSubcategory; -import cc.polyfrost.oneconfig.config.interfaces.BasicOption; +import cc.polyfrost.oneconfig.config.elements.OptionPage; +import cc.polyfrost.oneconfig.config.elements.OptionSubcategory; +import cc.polyfrost.oneconfig.config.elements.BasicOption; import cc.polyfrost.oneconfig.gui.elements.BasicButton; -import cc.polyfrost.oneconfig.lwjgl.RenderManager; -import cc.polyfrost.oneconfig.lwjgl.font.Fonts; +import cc.polyfrost.oneconfig.renderer.RenderManager; +import cc.polyfrost.oneconfig.renderer.font.Fonts; import cc.polyfrost.oneconfig.utils.color.ColorPalette; import java.util.ArrayList; diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModsPage.java b/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModsPage.java index 3b8e172..c192255 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModsPage.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModsPage.java @@ -1,14 +1,15 @@ package cc.polyfrost.oneconfig.gui.pages; -import cc.polyfrost.oneconfig.OneConfig; -import cc.polyfrost.oneconfig.config.OneConfigConfig; +import cc.polyfrost.oneconfig.internal.OneConfig; +import cc.polyfrost.oneconfig.gui.Colors; import cc.polyfrost.oneconfig.config.data.Mod; import cc.polyfrost.oneconfig.config.data.ModType; import cc.polyfrost.oneconfig.gui.OneConfigGui; import cc.polyfrost.oneconfig.gui.elements.BasicButton; import cc.polyfrost.oneconfig.gui.elements.ModCard; -import cc.polyfrost.oneconfig.lwjgl.RenderManager; -import cc.polyfrost.oneconfig.lwjgl.font.Fonts; +import cc.polyfrost.oneconfig.internal.config.OneConfigConfig; +import cc.polyfrost.oneconfig.renderer.RenderManager; +import cc.polyfrost.oneconfig.renderer.font.Fonts; import cc.polyfrost.oneconfig.utils.color.ColorPalette; import java.util.ArrayList; @@ -56,7 +57,7 @@ public class ModsPage extends Page { } size = iY + 119; if (iX == x + 16 && iY == y + 72) { - RenderManager.drawText(vg, "Looks like there is nothing here. Try another category?", x + 16, y + 72, OneConfigConfig.WHITE_60, 14f, Fonts.MEDIUM); + RenderManager.drawText(vg, "Looks like there is nothing here. Try another category?", x + 16, y + 72, Colors.WHITE_60, 14f, Fonts.MEDIUM); } } diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/pages/Page.java b/src/main/java/cc/polyfrost/oneconfig/gui/pages/Page.java index fda6ea2..b1bc083 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/pages/Page.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/pages/Page.java @@ -2,8 +2,8 @@ package cc.polyfrost.oneconfig.gui.pages; import cc.polyfrost.oneconfig.gui.animations.Animation; import cc.polyfrost.oneconfig.gui.animations.EaseOutQuad; -import cc.polyfrost.oneconfig.lwjgl.scissor.Scissor; -import cc.polyfrost.oneconfig.lwjgl.scissor.ScissorManager; +import cc.polyfrost.oneconfig.renderer.scissor.Scissor; +import cc.polyfrost.oneconfig.renderer.scissor.ScissorManager; import org.lwjgl.input.Mouse; /** diff --git a/src/main/java/cc/polyfrost/oneconfig/hud/BasicHud.java b/src/main/java/cc/polyfrost/oneconfig/hud/BasicHud.java index d78fbaf..445b2ad 100644 --- a/src/main/java/cc/polyfrost/oneconfig/hud/BasicHud.java +++ b/src/main/java/cc/polyfrost/oneconfig/hud/BasicHud.java @@ -1,7 +1,7 @@ package cc.polyfrost.oneconfig.hud; import cc.polyfrost.oneconfig.config.core.OneColor; -import cc.polyfrost.oneconfig.lwjgl.RenderManager; +import cc.polyfrost.oneconfig.renderer.RenderManager; public abstract class BasicHud { public boolean enabled; diff --git a/src/main/java/cc/polyfrost/oneconfig/hud/TextHud.java b/src/main/java/cc/polyfrost/oneconfig/hud/TextHud.java index 9525ba4..f868660 100644 --- a/src/main/java/cc/polyfrost/oneconfig/hud/TextHud.java +++ b/src/main/java/cc/polyfrost/oneconfig/hud/TextHud.java @@ -1,6 +1,6 @@ package cc.polyfrost.oneconfig.hud; -import cc.polyfrost.oneconfig.lwjgl.RenderManager; +import cc.polyfrost.oneconfig.renderer.RenderManager; import gg.essential.universal.UMinecraft; public abstract class TextHud extends BasicHud { diff --git a/src/main/java/cc/polyfrost/oneconfig/OneConfig.java b/src/main/java/cc/polyfrost/oneconfig/internal/OneConfig.java index e8612b6..3a00e06 100644 --- a/src/main/java/cc/polyfrost/oneconfig/OneConfig.java +++ b/src/main/java/cc/polyfrost/oneconfig/internal/OneConfig.java @@ -1,16 +1,16 @@ -package cc.polyfrost.oneconfig; +package cc.polyfrost.oneconfig.internal; -import cc.polyfrost.oneconfig.command.OneConfigCommand; -import cc.polyfrost.oneconfig.config.OneConfigConfig; import cc.polyfrost.oneconfig.config.core.ConfigCore; import cc.polyfrost.oneconfig.config.data.Mod; import cc.polyfrost.oneconfig.config.data.ModType; import cc.polyfrost.oneconfig.events.EventManager; import cc.polyfrost.oneconfig.hud.HudCore; -import cc.polyfrost.oneconfig.lwjgl.BlurHandler; +import cc.polyfrost.oneconfig.internal.config.OneConfigConfig; +import cc.polyfrost.oneconfig.internal.command.OneConfigCommand; +import cc.polyfrost.oneconfig.internal.gui.BlurHandler; import cc.polyfrost.oneconfig.test.TestCommand; import cc.polyfrost.oneconfig.test.TestConfig; -import cc.polyfrost.oneconfig.utils.GuiUtils; +import cc.polyfrost.oneconfig.utils.gui.GuiUtils; import cc.polyfrost.oneconfig.utils.commands.CommandManager; import cc.polyfrost.oneconfig.utils.hypixel.HypixelUtils; import net.minecraftforge.fml.common.DummyModContainer; diff --git a/src/main/java/cc/polyfrost/oneconfig/command/OneConfigCommand.java b/src/main/java/cc/polyfrost/oneconfig/internal/command/OneConfigCommand.java index d58c5a6..82d040a 100644 --- a/src/main/java/cc/polyfrost/oneconfig/command/OneConfigCommand.java +++ b/src/main/java/cc/polyfrost/oneconfig/internal/command/OneConfigCommand.java @@ -1,8 +1,8 @@ -package cc.polyfrost.oneconfig.command; +package cc.polyfrost.oneconfig.internal.command; import cc.polyfrost.oneconfig.gui.HudGui; import cc.polyfrost.oneconfig.gui.OneConfigGui; -import cc.polyfrost.oneconfig.utils.GuiUtils; +import cc.polyfrost.oneconfig.utils.gui.GuiUtils; import cc.polyfrost.oneconfig.utils.InputUtils; import cc.polyfrost.oneconfig.utils.commands.annotations.Command; import cc.polyfrost.oneconfig.utils.commands.annotations.Main; diff --git a/src/main/java/cc/polyfrost/oneconfig/internal/config/OneConfigConfig.java b/src/main/java/cc/polyfrost/oneconfig/internal/config/OneConfigConfig.java new file mode 100644 index 0000000..8f67ee6 --- /dev/null +++ b/src/main/java/cc/polyfrost/oneconfig/internal/config/OneConfigConfig.java @@ -0,0 +1,48 @@ +package cc.polyfrost.oneconfig.internal.config; + +import cc.polyfrost.oneconfig.config.Config; +import cc.polyfrost.oneconfig.config.core.OneColor; +import cc.polyfrost.oneconfig.config.data.Mod; +import cc.polyfrost.oneconfig.utils.JsonUtils; + +import java.io.*; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.ArrayList; + +public class OneConfigConfig extends Config { + public static String currentProfile = "Default Profile"; + public static ArrayList<String> favoriteMods = new ArrayList<>(); + public static ArrayList<OneColor> favoriteColors = new ArrayList<>(); + public static ArrayList<OneColor> recentColors = new ArrayList<>(); + public static boolean allShowShortCut = false; + + public OneConfigConfig() { + super(null, "OneConfig.json"); + } + + @Override + public void init(Mod mod) { + if (new File("OneConfig/" + configFile).exists()) load(); + else save(); + } + + @Override + public void save() { + try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(Files.newOutputStream(Paths.get("OneConfig/" + configFile)), StandardCharsets.UTF_8))) { + writer.write(gson.toJson(this)); + } catch (IOException e) { + e.printStackTrace(); + } + } + + @Override + public void load() { + try (BufferedReader reader = new BufferedReader(new InputStreamReader(Files.newInputStream(Paths.get("OneConfig/" + configFile)), StandardCharsets.UTF_8))) { + deserializePart(JsonUtils.PARSER.parse(reader).getAsJsonObject(), this); + } catch (IOException e) { + e.printStackTrace(); + } + } +} diff --git a/src/main/java/cc/polyfrost/oneconfig/lwjgl/BlurHandler.java b/src/main/java/cc/polyfrost/oneconfig/internal/gui/BlurHandler.java index 1219782..f5c332f 100644 --- a/src/main/java/cc/polyfrost/oneconfig/lwjgl/BlurHandler.java +++ b/src/main/java/cc/polyfrost/oneconfig/internal/gui/BlurHandler.java @@ -1,11 +1,11 @@ -package cc.polyfrost.oneconfig.lwjgl; +package cc.polyfrost.oneconfig.internal.gui; import cc.polyfrost.oneconfig.events.EventManager; import cc.polyfrost.oneconfig.events.event.RenderEvent; import cc.polyfrost.oneconfig.events.event.ScreenOpenEvent; import cc.polyfrost.oneconfig.events.event.Stage; import cc.polyfrost.oneconfig.gui.OneConfigGui; -import cc.polyfrost.oneconfig.mixin.ShaderGroupAccessor; +import cc.polyfrost.oneconfig.internal.mixin.ShaderGroupAccessor; import gg.essential.universal.UMinecraft; import gg.essential.universal.UScreen; import me.kbrewster.eventbus.Subscribe; diff --git a/src/main/java/cc/polyfrost/oneconfig/init/OneConfigInit.java b/src/main/java/cc/polyfrost/oneconfig/internal/init/OneConfigInit.java index df424fd..438c60e 100644 --- a/src/main/java/cc/polyfrost/oneconfig/init/OneConfigInit.java +++ b/src/main/java/cc/polyfrost/oneconfig/internal/init/OneConfigInit.java @@ -1,4 +1,4 @@ -package cc.polyfrost.oneconfig.init; +package cc.polyfrost.oneconfig.internal.init; import net.minecraft.launchwrapper.Launch; import org.spongepowered.asm.launch.MixinBootstrap; diff --git a/src/main/java/cc/polyfrost/oneconfig/mixin/FontRendererMixin.java b/src/main/java/cc/polyfrost/oneconfig/internal/mixin/FontRendererMixin.java index 7eac19d..227b99e 100644 --- a/src/main/java/cc/polyfrost/oneconfig/mixin/FontRendererMixin.java +++ b/src/main/java/cc/polyfrost/oneconfig/internal/mixin/FontRendererMixin.java @@ -1,4 +1,4 @@ -package cc.polyfrost.oneconfig.mixin; +package cc.polyfrost.oneconfig.internal.mixin; import net.minecraft.client.gui.FontRenderer; diff --git a/src/main/java/cc/polyfrost/oneconfig/mixin/GuiIngameForgeMixin.java b/src/main/java/cc/polyfrost/oneconfig/internal/mixin/GuiIngameForgeMixin.java index 36ec90b..f08d37e 100644 --- a/src/main/java/cc/polyfrost/oneconfig/mixin/GuiIngameForgeMixin.java +++ b/src/main/java/cc/polyfrost/oneconfig/internal/mixin/GuiIngameForgeMixin.java @@ -1,4 +1,4 @@ -package cc.polyfrost.oneconfig.mixin; +package cc.polyfrost.oneconfig.internal.mixin; import cc.polyfrost.oneconfig.events.EventManager; import cc.polyfrost.oneconfig.events.event.HudRenderEvent; diff --git a/src/main/java/cc/polyfrost/oneconfig/mixin/MinecraftMixin.java b/src/main/java/cc/polyfrost/oneconfig/internal/mixin/MinecraftMixin.java index 6618094..f0d201c 100644 --- a/src/main/java/cc/polyfrost/oneconfig/mixin/MinecraftMixin.java +++ b/src/main/java/cc/polyfrost/oneconfig/internal/mixin/MinecraftMixin.java @@ -1,6 +1,6 @@ -package cc.polyfrost.oneconfig.mixin; +package cc.polyfrost.oneconfig.internal.mixin; -import cc.polyfrost.oneconfig.OneConfig; +import cc.polyfrost.oneconfig.internal.OneConfig; import cc.polyfrost.oneconfig.events.EventManager; import cc.polyfrost.oneconfig.events.event.*; import net.minecraft.client.Minecraft; diff --git a/src/main/java/cc/polyfrost/oneconfig/mixin/NetHandlerPlayClientMixin.java b/src/main/java/cc/polyfrost/oneconfig/internal/mixin/NetHandlerPlayClientMixin.java index 5d78531..877d540 100644 --- a/src/main/java/cc/polyfrost/oneconfig/mixin/NetHandlerPlayClientMixin.java +++ b/src/main/java/cc/polyfrost/oneconfig/internal/mixin/NetHandlerPlayClientMixin.java @@ -1,4 +1,4 @@ -package cc.polyfrost.oneconfig.mixin; +package cc.polyfrost.oneconfig.internal.mixin; import cc.polyfrost.oneconfig.events.EventManager; import cc.polyfrost.oneconfig.events.event.ChatReceiveEvent; diff --git a/src/main/java/cc/polyfrost/oneconfig/mixin/NetworkManagerMixin.java b/src/main/java/cc/polyfrost/oneconfig/internal/mixin/NetworkManagerMixin.java index e7a9396..51988f2 100644 --- a/src/main/java/cc/polyfrost/oneconfig/mixin/NetworkManagerMixin.java +++ b/src/main/java/cc/polyfrost/oneconfig/internal/mixin/NetworkManagerMixin.java @@ -1,4 +1,4 @@ -package cc.polyfrost.oneconfig.mixin; +package cc.polyfrost.oneconfig.internal.mixin; import cc.polyfrost.oneconfig.events.EventManager; import cc.polyfrost.oneconfig.events.event.ReceivePacketEvent; diff --git a/src/main/java/cc/polyfrost/oneconfig/mixin/ShaderGroupAccessor.java b/src/main/java/cc/polyfrost/oneconfig/internal/mixin/ShaderGroupAccessor.java index cf8754e..8014670 100644 --- a/src/main/java/cc/polyfrost/oneconfig/mixin/ShaderGroupAccessor.java +++ b/src/main/java/cc/polyfrost/oneconfig/internal/mixin/ShaderGroupAccessor.java @@ -1,4 +1,4 @@ -package cc.polyfrost.oneconfig.mixin; +package cc.polyfrost.oneconfig.internal.mixin; import net.minecraft.client.shader.Shader; import net.minecraft.client.shader.ShaderGroup; diff --git a/src/main/java/cc/polyfrost/oneconfig/mixin/WorldClientMixin.java b/src/main/java/cc/polyfrost/oneconfig/internal/mixin/WorldClientMixin.java index 13a3821..d1fce6a 100644 --- a/src/main/java/cc/polyfrost/oneconfig/mixin/WorldClientMixin.java +++ b/src/main/java/cc/polyfrost/oneconfig/internal/mixin/WorldClientMixin.java @@ -1,4 +1,4 @@ -package cc.polyfrost.oneconfig.mixin; +package cc.polyfrost.oneconfig.internal.mixin; import cc.polyfrost.oneconfig.events.EventManager; import cc.polyfrost.oneconfig.events.event.WorldLoadEvent; diff --git a/src/main/java/cc/polyfrost/oneconfig/plugin/LoadingPlugin.java b/src/main/java/cc/polyfrost/oneconfig/internal/plugin/LoadingPlugin.java index be2b399..b819f24 100644 --- a/src/main/java/cc/polyfrost/oneconfig/plugin/LoadingPlugin.java +++ b/src/main/java/cc/polyfrost/oneconfig/internal/plugin/LoadingPlugin.java @@ -1,6 +1,6 @@ -package cc.polyfrost.oneconfig.plugin; +package cc.polyfrost.oneconfig.internal.plugin; -import cc.polyfrost.oneconfig.init.OneConfigInit; +import cc.polyfrost.oneconfig.internal.init.OneConfigInit; import net.minecraft.launchwrapper.Launch; import net.minecraft.launchwrapper.LaunchClassLoader; import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin; @@ -23,13 +23,13 @@ public class LoadingPlugin implements IFMLLoadingPlugin { exceptions.remove("org.lwjgl."); OneConfigInit.initialize(new String[]{}); } catch (Exception e) { - throw new RuntimeException("e"); + throw new RuntimeException(e); } } @Override public String[] getASMTransformerClass() { - return new String[]{"cc.polyfrost.oneconfig.plugin.asm.ClassTransformer"}; + return new String[]{"cc.polyfrost.oneconfig.internal.plugin.asm.ClassTransformer"}; } @Override @@ -44,7 +44,6 @@ public class LoadingPlugin implements IFMLLoadingPlugin { @Override public void injectData(Map<String, Object> data) { - } @Override diff --git a/src/main/java/cc/polyfrost/oneconfig/lwjgl/plugin/Lwjgl2FunctionProvider.java b/src/main/java/cc/polyfrost/oneconfig/internal/plugin/Lwjgl2FunctionProvider.java index 4cef17c..105afa2 100644 --- a/src/main/java/cc/polyfrost/oneconfig/lwjgl/plugin/Lwjgl2FunctionProvider.java +++ b/src/main/java/cc/polyfrost/oneconfig/internal/plugin/Lwjgl2FunctionProvider.java @@ -1,4 +1,4 @@ -package cc.polyfrost.oneconfig.lwjgl.plugin; +package cc.polyfrost.oneconfig.internal.plugin; import org.lwjgl.opengl.GLContext; import org.lwjgl.system.FunctionProvider; diff --git a/src/main/java/cc/polyfrost/oneconfig/plugin/OneConfigMixinPlugin.java b/src/main/java/cc/polyfrost/oneconfig/internal/plugin/OneConfigMixinPlugin.java index 951e942..c55febc 100644 --- a/src/main/java/cc/polyfrost/oneconfig/plugin/OneConfigMixinPlugin.java +++ b/src/main/java/cc/polyfrost/oneconfig/internal/plugin/OneConfigMixinPlugin.java @@ -1,4 +1,4 @@ -package cc.polyfrost.oneconfig.plugin; +package cc.polyfrost.oneconfig.internal.plugin; import org.spongepowered.asm.lib.tree.ClassNode; import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin; diff --git a/src/main/java/cc/polyfrost/oneconfig/plugin/asm/ClassTransformer.java b/src/main/java/cc/polyfrost/oneconfig/internal/plugin/asm/ClassTransformer.java index 989b5da..1a2766f 100644 --- a/src/main/java/cc/polyfrost/oneconfig/plugin/asm/ClassTransformer.java +++ b/src/main/java/cc/polyfrost/oneconfig/internal/plugin/asm/ClassTransformer.java @@ -1,7 +1,7 @@ -package cc.polyfrost.oneconfig.plugin.asm; +package cc.polyfrost.oneconfig.internal.plugin.asm; -import cc.polyfrost.oneconfig.plugin.asm.tweakers.NanoVGGLConfigTransformer; -import cc.polyfrost.oneconfig.plugin.asm.tweakers.VigilantTransformer; +import cc.polyfrost.oneconfig.internal.plugin.asm.tweakers.NanoVGGLConfigTransformer; +import cc.polyfrost.oneconfig.internal.plugin.asm.tweakers.VigilantTransformer; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.Multimap; import net.minecraft.launchwrapper.IClassTransformer; diff --git a/src/main/java/cc/polyfrost/oneconfig/plugin/asm/ITransformer.java b/src/main/java/cc/polyfrost/oneconfig/internal/plugin/asm/ITransformer.java index f14877f..482a310 100644 --- a/src/main/java/cc/polyfrost/oneconfig/plugin/asm/ITransformer.java +++ b/src/main/java/cc/polyfrost/oneconfig/internal/plugin/asm/ITransformer.java @@ -1,4 +1,4 @@ -package cc.polyfrost.oneconfig.plugin.asm; +package cc.polyfrost.oneconfig.internal.plugin.asm; import org.objectweb.asm.tree.ClassNode; diff --git a/src/main/java/cc/polyfrost/oneconfig/plugin/asm/tweakers/NanoVGGLConfigTransformer.java b/src/main/java/cc/polyfrost/oneconfig/internal/plugin/asm/tweakers/NanoVGGLConfigTransformer.java index 38da8dd..4d7a5cc 100644 --- a/src/main/java/cc/polyfrost/oneconfig/plugin/asm/tweakers/NanoVGGLConfigTransformer.java +++ b/src/main/java/cc/polyfrost/oneconfig/internal/plugin/asm/tweakers/NanoVGGLConfigTransformer.java @@ -1,6 +1,6 @@ -package cc.polyfrost.oneconfig.plugin.asm.tweakers; +package cc.polyfrost.oneconfig.internal.plugin.asm.tweakers; -import cc.polyfrost.oneconfig.plugin.asm.ITransformer; +import cc.polyfrost.oneconfig.internal.plugin.asm.ITransformer; import org.objectweb.asm.Opcodes; import org.objectweb.asm.tree.*; @@ -17,11 +17,11 @@ public class NanoVGGLConfigTransformer implements ITransformer { InsnList list = new InsnList(); list.add(new VarInsnNode(Opcodes.LLOAD, 0)); - list.add(new TypeInsnNode(Opcodes.NEW, "cc/polyfrost/oneconfig/lwjgl/plugin/Lwjgl2FunctionProvider")); + list.add(new TypeInsnNode(Opcodes.NEW, "cc/polyfrost/oneconfig/internal/plugin/Lwjgl2FunctionProvider")); list.add(new InsnNode(Opcodes.DUP)); list.add(new MethodInsnNode( Opcodes.INVOKESPECIAL, - "cc/polyfrost/oneconfig/lwjgl/plugin/Lwjgl2FunctionProvider", + "cc/polyfrost/oneconfig/internal/plugin/Lwjgl2FunctionProvider", "<init>", "()V", false diff --git a/src/main/java/cc/polyfrost/oneconfig/plugin/asm/tweakers/VigilantTransformer.java b/src/main/java/cc/polyfrost/oneconfig/internal/plugin/asm/tweakers/VigilantTransformer.java index 29cf2fd..f241c74 100644 --- a/src/main/java/cc/polyfrost/oneconfig/plugin/asm/tweakers/VigilantTransformer.java +++ b/src/main/java/cc/polyfrost/oneconfig/internal/plugin/asm/tweakers/VigilantTransformer.java @@ -1,10 +1,10 @@ -package cc.polyfrost.oneconfig.plugin.asm.tweakers; +package cc.polyfrost.oneconfig.internal.plugin.asm.tweakers; -import cc.polyfrost.oneconfig.config.compatibility.VigilanceConfig; +import cc.polyfrost.oneconfig.config.compatibility.vigilance.VigilanceConfig; import cc.polyfrost.oneconfig.config.core.ConfigCore; import cc.polyfrost.oneconfig.config.data.Mod; import cc.polyfrost.oneconfig.config.data.ModType; -import cc.polyfrost.oneconfig.plugin.asm.ITransformer; +import cc.polyfrost.oneconfig.internal.plugin.asm.ITransformer; import gg.essential.vigilance.Vigilant; import gg.essential.vigilance.data.PropertyCollector; import net.minecraft.client.Minecraft; @@ -40,7 +40,7 @@ public class VigilantTransformer implements ITransformer { node.fields.add(new FieldNode(Opcodes.ACC_PUBLIC, "oneconfig$config", Type.getDescriptor(VigilanceConfig.class), null, null)); node.fields.add(new FieldNode(Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, "oneconfig$file", Type.getDescriptor(File.class), null, null)); - node.interfaces.add("cc/polyfrost/oneconfig/config/compatibility/VigilantAccessor"); + node.interfaces.add("cc/polyfrost/oneconfig/config/compatibility/vigilance/VigilantAccessor"); MethodNode methodNode = new MethodNode(Opcodes.ACC_PUBLIC, "getPropertyCollector", "()Lgg/essential/vigilance/data/PropertyCollector;", null, null); LabelNode labelNode = new LabelNode(); methodNode.instructions.add(labelNode); @@ -81,7 +81,7 @@ public class VigilantTransformer implements ITransformer { list.add(new VarInsnNode(Opcodes.ALOAD, 0)); list.add(new VarInsnNode(Opcodes.ALOAD, 0)); list.add(new FieldInsnNode(Opcodes.GETFIELD, "gg/essential/vigilance/Vigilant", "oneconfig$file", Type.getDescriptor(File.class))); - list.add(new MethodInsnNode(Opcodes.INVOKESTATIC, Type.getInternalName(getClass()), "returnNewConfig", "(Lgg/essential/vigilance/Vigilant;Ljava/io/File;)Lcc/polyfrost/oneconfig/config/compatibility/VigilanceConfig;", false)); + list.add(new MethodInsnNode(Opcodes.INVOKESTATIC, Type.getInternalName(getClass()), "returnNewConfig", "(Lgg/essential/vigilance/Vigilant;Ljava/io/File;)Lcc/polyfrost/oneconfig/config/compatibility/vigilance/VigilanceConfig;", false)); list.add(new FieldInsnNode(Opcodes.PUTFIELD, "gg/essential/vigilance/Vigilant", "oneconfig$config", Type.getDescriptor(VigilanceConfig.class))); method.instructions.insertBefore(method.instructions.getLast().getPrevious(), list); } else if (method.name.equals("addDependency") && method.desc.equals("(Lgg/essential/vigilance/data/PropertyData;Lgg/essential/vigilance/data/PropertyData;)V")) { diff --git a/src/main/java/cc/polyfrost/oneconfig/lwjgl/font/FontManager.java b/src/main/java/cc/polyfrost/oneconfig/lwjgl/font/FontManager.java deleted file mode 100644 index 534795b..0000000 --- a/src/main/java/cc/polyfrost/oneconfig/lwjgl/font/FontManager.java +++ /dev/null @@ -1,31 +0,0 @@ -package cc.polyfrost.oneconfig.lwjgl.font; - -import cc.polyfrost.oneconfig.utils.IOUtils; - -import java.io.IOException; -import java.nio.ByteBuffer; - -import static org.lwjgl.nanovg.NanoVG.nvgCreateFontMem; - -public class FontManager { - public static FontManager INSTANCE = new FontManager(); - - public void initialize(long vg) { - for (Fonts fonts : Fonts.values()) { - Font font = fonts.font; - int loaded = -1; - try { - ByteBuffer buffer = IOUtils.resourceToByteBuffer(font.getFileName()); - loaded = nvgCreateFontMem(vg, font.getName(), buffer, 0); - font.setBuffer(buffer); - } catch (IOException e) { - e.printStackTrace(); - } - if (loaded == -1) { - throw new RuntimeException("Failed to initialize font " + font.getName()); - } else { - font.setLoaded(true); - } - } - } -} diff --git a/src/main/java/cc/polyfrost/oneconfig/lwjgl/RenderManager.java b/src/main/java/cc/polyfrost/oneconfig/renderer/RenderManager.java index ef65ecf..20fc8f6 100644 --- a/src/main/java/cc/polyfrost/oneconfig/lwjgl/RenderManager.java +++ b/src/main/java/cc/polyfrost/oneconfig/renderer/RenderManager.java @@ -1,14 +1,14 @@ -package cc.polyfrost.oneconfig.lwjgl; +package cc.polyfrost.oneconfig.renderer; -import cc.polyfrost.oneconfig.config.OneConfigConfig; +import cc.polyfrost.oneconfig.gui.Colors; import cc.polyfrost.oneconfig.config.data.InfoType; import cc.polyfrost.oneconfig.gui.OneConfigGui; -import cc.polyfrost.oneconfig.lwjgl.font.Font; -import cc.polyfrost.oneconfig.lwjgl.font.FontManager; -import cc.polyfrost.oneconfig.lwjgl.font.Fonts; -import cc.polyfrost.oneconfig.lwjgl.image.ImageLoader; -import cc.polyfrost.oneconfig.lwjgl.image.Images; -import cc.polyfrost.oneconfig.lwjgl.image.SVGs; +import cc.polyfrost.oneconfig.renderer.font.Font; +import cc.polyfrost.oneconfig.renderer.font.FontManager; +import cc.polyfrost.oneconfig.renderer.font.Fonts; +import cc.polyfrost.oneconfig.renderer.image.ImageLoader; +import cc.polyfrost.oneconfig.renderer.image.Images; +import cc.polyfrost.oneconfig.renderer.image.SVGs; import cc.polyfrost.oneconfig.utils.InputUtils; import cc.polyfrost.oneconfig.utils.NetworkUtils; import gg.essential.universal.UGraphics; @@ -95,8 +95,8 @@ public final class RenderManager { * @param color The color. */ public static void drawRectangle(long vg, float x, float y, float width, float height, int color) { // TODO make everything use this one day - if (OneConfigConfig.ROUNDED_CORNERS) { - drawRoundedRect(vg, x, y, width, height, color, OneConfigConfig.CORNER_RADIUS); + if (Colors.ROUNDED_CORNERS) { + drawRoundedRect(vg, x, y, width, height, color, Colors.CORNER_RADIUS); } else { drawRect(vg, x, y, width, height, color); } @@ -252,7 +252,7 @@ public final class RenderManager { nvgBeginPath(vg); nvgRoundedRect(vg, x, y, width, height, 8f); NVGColor nvgColor = color(vg, -1); - NVGColor nvgColor2 = color(vg, OneConfigConfig.TRANSPARENT); + NVGColor nvgColor2 = color(vg, Colors.TRANSPARENT); nvgFillPaint(vg, nvgLinearGradient(vg, x, y, x + width, y, nvgColor, nvgColor2, bg)); nvgFill(vg); nvgColor.free(); @@ -261,8 +261,8 @@ public final class RenderManager { NVGPaint bg2 = NVGPaint.create(); nvgBeginPath(vg); nvgRoundedRect(vg, x, y, width, height, 8f); - NVGColor nvgColor3 = color(vg, OneConfigConfig.TRANSPARENT); - NVGColor nvgColor4 = color(vg, OneConfigConfig.BLACK); + NVGColor nvgColor3 = color(vg, Colors.TRANSPARENT); + NVGColor nvgColor4 = color(vg, Colors.BLACK); nvgFillPaint(vg, nvgLinearGradient(vg, x, y, x, y + height, nvgColor3, nvgColor4, bg2)); nvgFill(vg); nvgColor3.free(); @@ -296,7 +296,7 @@ public final class RenderManager { * @param color The color. * @param size The size. * @param font The font. - * @see cc.polyfrost.oneconfig.lwjgl.font.Font + * @see cc.polyfrost.oneconfig.renderer.font.Font */ public static void drawText(long vg, String text, float x, float y, int color, float size, Fonts font) { drawText(vg, text, x, y, color, size, font.font); @@ -312,7 +312,7 @@ public final class RenderManager { * @param color The color. * @param size The size. * @param font The font. - * @see cc.polyfrost.oneconfig.lwjgl.font.Font + * @see cc.polyfrost.oneconfig.renderer.font.Font */ public static void drawText(long vg, String text, float x, float y, int color, float size, Font font) { nvgBeginPath(vg); @@ -385,9 +385,9 @@ public final class RenderManager { * @see InputUtils#isAreaClicked(int, int, int, int) */ public static void drawURL(long vg, String url, float x, float y, float size, Font font) { - drawText(vg, url, x, y, OneConfigConfig.PRIMARY_500, size, font); + drawText(vg, url, x, y, Colors.PRIMARY_500, size, font); float length = getTextWidth(vg, url, size, font); - drawRectangle(vg, x, y + size / 2, length, 1, OneConfigConfig.PRIMARY_500); + drawRectangle(vg, x, y + size / 2, length, 1, Colors.PRIMARY_500); if (InputUtils.isAreaClicked((int) (x - 2), (int) (y - 1), (int) (length + 4), (int) (size / 2 + 3))) { NetworkUtils.browseLink(url); } @@ -713,23 +713,23 @@ public final class RenderManager { switch (type) { case INFO: icon = SVGs.INFO_CIRCLE; - colorOuter = OneConfigConfig.GRAY_400; - colorInner = OneConfigConfig.GRAY_300; + colorOuter = Colors.GRAY_400; + colorInner = Colors.GRAY_300; break; case SUCCESS: icon = SVGs.CHECK_CIRCLE; - colorOuter = OneConfigConfig.SUCCESS_700; - colorInner = OneConfigConfig.SUCCESS_600; + colorOuter = Colors.SUCCESS_700; + colorInner = Colors.SUCCESS_600; break; case WARNING: icon = SVGs.WARNING; - colorOuter = OneConfigConfig.WARNING_600; - colorInner = OneConfigConfig.WARNING_500; + colorOuter = Colors.WARNING_600; + colorInner = Colors.WARNING_500; break; case ERROR: icon = SVGs.ERROR; - colorOuter = OneConfigConfig.ERROR_700; - colorInner = OneConfigConfig.ERROR_600; + colorOuter = Colors.ERROR_700; + colorInner = Colors.ERROR_600; break; } float centerX = x + size / 2f; diff --git a/src/main/java/cc/polyfrost/oneconfig/lwjgl/font/Font.java b/src/main/java/cc/polyfrost/oneconfig/renderer/font/Font.java index 8267ba7..b35708b 100644 --- a/src/main/java/cc/polyfrost/oneconfig/lwjgl/font/Font.java +++ b/src/main/java/cc/polyfrost/oneconfig/renderer/font/Font.java @@ -1,4 +1,4 @@ -package cc.polyfrost.oneconfig.lwjgl.font; +package cc.polyfrost.oneconfig.renderer.font; import java.nio.ByteBuffer; diff --git a/src/main/java/cc/polyfrost/oneconfig/renderer/font/FontManager.java b/src/main/java/cc/polyfrost/oneconfig/renderer/font/FontManager.java new file mode 100644 index 0000000..388911d --- /dev/null +++ b/src/main/java/cc/polyfrost/oneconfig/renderer/font/FontManager.java @@ -0,0 +1,47 @@ +package cc.polyfrost.oneconfig.renderer.font; + +import cc.polyfrost.oneconfig.utils.IOUtils; + +import java.io.IOException; +import java.nio.ByteBuffer; + +import static org.lwjgl.nanovg.NanoVG.nvgCreateFontMem; + +public class FontManager { + public static FontManager INSTANCE = new FontManager(); + + /** + * Load all fonts in the Fonts class + * + * @param vg NanoVG context + */ + + public void initialize(long vg) { + for (Fonts fonts : Fonts.values()) { + loadFont(vg, fonts.font); + } + } + + /** + * Load a font into NanoVG + * + * @param vg NanoVG context + * @param font The font to be loaded + */ + public void loadFont(long vg, Font font) { + if (font.isLoaded()) return; + int loaded = -1; + try { + ByteBuffer buffer = IOUtils.resourceToByteBuffer(font.getFileName()); + loaded = nvgCreateFontMem(vg, font.getName(), buffer, 0); + font.setBuffer(buffer); + } catch (IOException e) { + e.printStackTrace(); + } + if (loaded == -1) { + throw new RuntimeException("Failed to initialize font " + font.getName()); + } else { + font.setLoaded(true); + } + } +} diff --git a/src/main/java/cc/polyfrost/oneconfig/lwjgl/font/Fonts.java b/src/main/java/cc/polyfrost/oneconfig/renderer/font/Fonts.java index 74d7828..9b6193f 100644 --- a/src/main/java/cc/polyfrost/oneconfig/lwjgl/font/Fonts.java +++ b/src/main/java/cc/polyfrost/oneconfig/renderer/font/Fonts.java @@ -1,4 +1,4 @@ -package cc.polyfrost.oneconfig.lwjgl.font; +package cc.polyfrost.oneconfig.renderer.font; public enum Fonts { BOLD(new Font("inter-bold", "/assets/oneconfig/font/Bold.otf")), diff --git a/src/main/java/cc/polyfrost/oneconfig/lwjgl/image/ImageLoader.java b/src/main/java/cc/polyfrost/oneconfig/renderer/image/ImageLoader.java index faf3e13..e8861eb 100644 --- a/src/main/java/cc/polyfrost/oneconfig/lwjgl/image/ImageLoader.java +++ b/src/main/java/cc/polyfrost/oneconfig/renderer/image/ImageLoader.java @@ -1,4 +1,4 @@ -package cc.polyfrost.oneconfig.lwjgl.image; +package cc.polyfrost.oneconfig.renderer.image; import cc.polyfrost.oneconfig.utils.IOUtils; import org.lwjgl.nanovg.NSVGImage; @@ -16,7 +16,7 @@ import java.util.HashMap; /** * Loads images and SVGs from resources into NanoVG. * - * @see cc.polyfrost.oneconfig.lwjgl.RenderManager + * @see cc.polyfrost.oneconfig.renderer.RenderManager * @see Images * @see SVGs */ diff --git a/src/main/java/cc/polyfrost/oneconfig/lwjgl/image/Images.java b/src/main/java/cc/polyfrost/oneconfig/renderer/image/Images.java index 0379b2e..ad1941e 100644 --- a/src/main/java/cc/polyfrost/oneconfig/lwjgl/image/Images.java +++ b/src/main/java/cc/polyfrost/oneconfig/renderer/image/Images.java @@ -1,9 +1,9 @@ -package cc.polyfrost.oneconfig.lwjgl.image; +package cc.polyfrost.oneconfig.renderer.image; /** * An enum of images used in OneConfig. * - * @see cc.polyfrost.oneconfig.lwjgl.RenderManager#drawImage(long, String, float, float, float, float, int) + * @see cc.polyfrost.oneconfig.renderer.RenderManager#drawImage(long, String, float, float, float, float, int) * @see ImageLoader */ public enum Images { diff --git a/src/main/java/cc/polyfrost/oneconfig/lwjgl/image/SVGs.java b/src/main/java/cc/polyfrost/oneconfig/renderer/image/SVGs.java index 28e9f4a..5ba3fcd 100644 --- a/src/main/java/cc/polyfrost/oneconfig/lwjgl/image/SVGs.java +++ b/src/main/java/cc/polyfrost/oneconfig/renderer/image/SVGs.java @@ -1,9 +1,9 @@ -package cc.polyfrost.oneconfig.lwjgl.image; +package cc.polyfrost.oneconfig.renderer.image; /** * An enum of SVGs used in OneConfig. * - * @see cc.polyfrost.oneconfig.lwjgl.RenderManager#drawSvg(long, String, float, float, float, float, int) + * @see cc.polyfrost.oneconfig.renderer.RenderManager#drawSvg(long, String, float, float, float, float, int) * @see ImageLoader */ public enum SVGs { diff --git a/src/main/java/cc/polyfrost/oneconfig/lwjgl/scissor/Scissor.java b/src/main/java/cc/polyfrost/oneconfig/renderer/scissor/Scissor.java index 089268f..179a260 100644 --- a/src/main/java/cc/polyfrost/oneconfig/lwjgl/scissor/Scissor.java +++ b/src/main/java/cc/polyfrost/oneconfig/renderer/scissor/Scissor.java @@ -1,4 +1,4 @@ -package cc.polyfrost.oneconfig.lwjgl.scissor; +package cc.polyfrost.oneconfig.renderer.scissor; /** * A class that represents a scissor rectangle. diff --git a/src/main/java/cc/polyfrost/oneconfig/lwjgl/scissor/ScissorManager.java b/src/main/java/cc/polyfrost/oneconfig/renderer/scissor/ScissorManager.java index 159de96..1f7801b 100644 --- a/src/main/java/cc/polyfrost/oneconfig/lwjgl/scissor/ScissorManager.java +++ b/src/main/java/cc/polyfrost/oneconfig/renderer/scissor/ScissorManager.java @@ -1,4 +1,4 @@ -package cc.polyfrost.oneconfig.lwjgl.scissor; +package cc.polyfrost.oneconfig.renderer.scissor; import org.lwjgl.nanovg.NanoVG; diff --git a/src/main/java/cc/polyfrost/oneconfig/test/ButtonTestPage.java b/src/main/java/cc/polyfrost/oneconfig/test/ButtonTestPage.java index fb137db..3dd74dc 100644 --- a/src/main/java/cc/polyfrost/oneconfig/test/ButtonTestPage.java +++ b/src/main/java/cc/polyfrost/oneconfig/test/ButtonTestPage.java @@ -2,7 +2,7 @@ package cc.polyfrost.oneconfig.test; import cc.polyfrost.oneconfig.gui.elements.BasicButton; import cc.polyfrost.oneconfig.gui.pages.Page; -import cc.polyfrost.oneconfig.lwjgl.image.SVGs; +import cc.polyfrost.oneconfig.renderer.image.SVGs; import cc.polyfrost.oneconfig.utils.color.ColorPalette; import java.util.ArrayList; diff --git a/src/main/java/cc/polyfrost/oneconfig/test/TestConfig.java b/src/main/java/cc/polyfrost/oneconfig/test/TestConfig.java index f632784..2d76a0e 100644 --- a/src/main/java/cc/polyfrost/oneconfig/test/TestConfig.java +++ b/src/main/java/cc/polyfrost/oneconfig/test/TestConfig.java @@ -5,8 +5,9 @@ import cc.polyfrost.oneconfig.config.annotations.Option; import cc.polyfrost.oneconfig.config.core.OneColor; import cc.polyfrost.oneconfig.config.core.OneKeyBind; import cc.polyfrost.oneconfig.config.data.*; -import cc.polyfrost.oneconfig.config.interfaces.Config; -import cc.polyfrost.oneconfig.config.migration.VigilanceMigrator; +import cc.polyfrost.oneconfig.config.Config; +import cc.polyfrost.oneconfig.config.data.ModType; +import cc.polyfrost.oneconfig.config.migration.vigilance.VigilanceMigrator; import net.minecraftforge.fml.common.FMLCommonHandler; public class TestConfig extends Config { diff --git a/src/main/java/cc/polyfrost/oneconfig/test/TestNanoVGGui_Test.java b/src/main/java/cc/polyfrost/oneconfig/test/TestNanoVGGui_Test.java index 504c12f..5ad95c7 100644 --- a/src/main/java/cc/polyfrost/oneconfig/test/TestNanoVGGui_Test.java +++ b/src/main/java/cc/polyfrost/oneconfig/test/TestNanoVGGui_Test.java @@ -1,7 +1,7 @@ package cc.polyfrost.oneconfig.test; -import cc.polyfrost.oneconfig.lwjgl.RenderManager; -import cc.polyfrost.oneconfig.lwjgl.font.Fonts; +import cc.polyfrost.oneconfig.renderer.RenderManager; +import cc.polyfrost.oneconfig.renderer.font.Fonts; import gg.essential.universal.UMatrixStack; import gg.essential.universal.UScreen; import org.jetbrains.annotations.NotNull; diff --git a/src/main/java/cc/polyfrost/oneconfig/utils/TextUtils.java b/src/main/java/cc/polyfrost/oneconfig/utils/TextUtils.java index df37aae..51b42d8 100644 --- a/src/main/java/cc/polyfrost/oneconfig/utils/TextUtils.java +++ b/src/main/java/cc/polyfrost/oneconfig/utils/TextUtils.java @@ -1,8 +1,8 @@ package cc.polyfrost.oneconfig.utils; -import cc.polyfrost.oneconfig.lwjgl.RenderManager; -import cc.polyfrost.oneconfig.lwjgl.font.Font; -import cc.polyfrost.oneconfig.lwjgl.font.Fonts; +import cc.polyfrost.oneconfig.renderer.RenderManager; +import cc.polyfrost.oneconfig.renderer.font.Font; +import cc.polyfrost.oneconfig.renderer.font.Fonts; import java.util.ArrayList; diff --git a/src/main/java/cc/polyfrost/oneconfig/utils/color/ColorPalette.java b/src/main/java/cc/polyfrost/oneconfig/utils/color/ColorPalette.java index a73e9ff..dc15e92 100644 --- a/src/main/java/cc/polyfrost/oneconfig/utils/color/ColorPalette.java +++ b/src/main/java/cc/polyfrost/oneconfig/utils/color/ColorPalette.java @@ -1,18 +1,18 @@ package cc.polyfrost.oneconfig.utils.color; -import cc.polyfrost.oneconfig.config.OneConfigConfig; +import cc.polyfrost.oneconfig.gui.Colors; import cc.polyfrost.oneconfig.config.core.OneColor; import java.awt.*; -import static cc.polyfrost.oneconfig.config.OneConfigConfig.*; +import static cc.polyfrost.oneconfig.gui.Colors.*; public class ColorPalette { /** * Always returns transparent. */ - public static final ColorPalette TRANSPARENT = new ColorPalette(OneConfigConfig.TRANSPARENT, OneConfigConfig.TRANSPARENT, OneConfigConfig.TRANSPARENT); + public static final ColorPalette TRANSPARENT = new ColorPalette(Colors.TRANSPARENT, Colors.TRANSPARENT, Colors.TRANSPARENT); /** * <h1>Primary Color Scheme</h1> Normal: Primary 600,<br> Hover: Primary 700,<br> Clicked: Primary 700 (80%) */ @@ -20,7 +20,7 @@ public class ColorPalette { /** * <h1>Secondary Color Scheme</h1> Normal: Gray 500,<br> Hover: Gray 400,<br> Clicked: Gray 400 (80%) */ - public static final ColorPalette SECONDARY = new ColorPalette(OneConfigConfig.GRAY_500, OneConfigConfig.GRAY_400, OneConfigConfig.GRAY_400_80); + public static final ColorPalette SECONDARY = new ColorPalette(Colors.GRAY_500, Colors.GRAY_400, Colors.GRAY_400_80); /** * <h1>Tertiary Color Scheme</h1> Normal: Transparent (Text=White 90%),<br> Hover: Transparent (Text=White 100%),<br> Clicked: Transparent (Text=White 80%) * <h2>NOTICE this returns the text colors as it is always transparent.</h2> @@ -33,7 +33,7 @@ public class ColorPalette { /** * <h1>Secondary Destructive Color Scheme</h1> Normal: Gray 500,<br> Hover: Error 800,<br> Clicked: Error 800 (80%) */ - public static final ColorPalette SECONDARY_DESTRUCTIVE = new ColorPalette(OneConfigConfig.GRAY_500, ERROR_800, ERROR_800_80); + public static final ColorPalette SECONDARY_DESTRUCTIVE = new ColorPalette(Colors.GRAY_500, ERROR_800, ERROR_800_80); /** * <h1>Tertiary Destructive Color Scheme</h1> Normal: Transparent (Text=White 90%),<br> Hover: Transparent (Text=Error 300),<br> Clicked: Transparent (Text=Error 300 80%) * <h2>NOTICE this returns the text colors as it is always transparent.</h2> diff --git a/src/main/java/cc/polyfrost/oneconfig/utils/commands/annotations/Command.java b/src/main/java/cc/polyfrost/oneconfig/utils/commands/annotations/Command.java index deec7f1..41909c0 100644 --- a/src/main/java/cc/polyfrost/oneconfig/utils/commands/annotations/Command.java +++ b/src/main/java/cc/polyfrost/oneconfig/utils/commands/annotations/Command.java @@ -1,5 +1,6 @@ package cc.polyfrost.oneconfig.utils.commands.annotations; +import cc.polyfrost.oneconfig.internal.command.OneConfigCommand; import cc.polyfrost.oneconfig.utils.commands.CommandManager; import cc.polyfrost.oneconfig.utils.commands.arguments.ArgumentParser; @@ -78,7 +79,7 @@ import java.lang.annotation.Target; * Note: if you're viewing this in IntelliJ or just see the @literal tag everywhere, please ignore that. * </p> * - * @see cc.polyfrost.oneconfig.command.OneConfigCommand + * @see OneConfigCommand * @see Main * @see CommandManager */ diff --git a/src/main/java/cc/polyfrost/oneconfig/utils/GuiUtils.java b/src/main/java/cc/polyfrost/oneconfig/utils/gui/GuiUtils.java index 29c26fb..973e003 100644 --- a/src/main/java/cc/polyfrost/oneconfig/utils/GuiUtils.java +++ b/src/main/java/cc/polyfrost/oneconfig/utils/gui/GuiUtils.java @@ -1,8 +1,9 @@ -package cc.polyfrost.oneconfig.utils; +package cc.polyfrost.oneconfig.utils.gui; import cc.polyfrost.oneconfig.events.EventManager; import cc.polyfrost.oneconfig.events.event.RenderEvent; import cc.polyfrost.oneconfig.events.event.Stage; +import cc.polyfrost.oneconfig.utils.TickDelay; import gg.essential.universal.UMinecraft; import gg.essential.universal.UScreen; import me.kbrewster.eventbus.Subscribe; diff --git a/src/main/java/cc/polyfrost/oneconfig/utils/OneUIScreen.java b/src/main/java/cc/polyfrost/oneconfig/utils/gui/OneUIScreen.java index dac995d..c06f6f3 100644 --- a/src/main/java/cc/polyfrost/oneconfig/utils/OneUIScreen.java +++ b/src/main/java/cc/polyfrost/oneconfig/utils/gui/OneUIScreen.java @@ -1,6 +1,7 @@ -package cc.polyfrost.oneconfig.utils; +package cc.polyfrost.oneconfig.utils.gui; -import cc.polyfrost.oneconfig.lwjgl.RenderManager; +import cc.polyfrost.oneconfig.renderer.RenderManager; +import cc.polyfrost.oneconfig.utils.InputUtils; import gg.essential.universal.UMatrixStack; import gg.essential.universal.UScreen; import net.minecraft.client.gui.GuiScreen; |