aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/polyfrost/oneconfig/gui
diff options
context:
space:
mode:
authorDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-06-01 18:41:55 +0200
committerDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-06-01 18:41:55 +0200
commitb722c1eff0bda4de2c15d451423367cf2be2f15a (patch)
tree3b87f41c52b144cd101fb40036ad1a3a22618eaf /src/main/java/cc/polyfrost/oneconfig/gui
parentb72b3dca39631a995b422e0b3495e8d3618e91d8 (diff)
parente48cd4479f832cdd341ab0a289d1b4a88ab21a3c (diff)
downloadOneConfig-b722c1eff0bda4de2c15d451423367cf2be2f15a.tar.gz
OneConfig-b722c1eff0bda4de2c15d451423367cf2be2f15a.tar.bz2
OneConfig-b722c1eff0bda4de2c15d451423367cf2be2f15a.zip
merge
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/gui')
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/OneConfigGui.java16
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/SideBar.java30
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicButton.java29
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicElement.java16
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/ColorSelector.java18
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java11
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigButton.java6
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigCheckbox.java5
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigDropdown.java5
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigKeyBind.java4
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigPageButton.java5
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigSwitch.java5
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigUniSelector.java2
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/text/NumberInputField.java7
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/pages/HomePage.java9
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/pages/ModConfigPage.java4
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/pages/ModsPage.java16
17 files changed, 91 insertions, 97 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/OneConfigGui.java b/src/main/java/cc/polyfrost/oneconfig/gui/OneConfigGui.java
index 67bb3ad..63fbd39 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/OneConfigGui.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/OneConfigGui.java
@@ -7,7 +7,6 @@ import cc.polyfrost.oneconfig.gui.animations.EaseInOutQuad;
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.gui.pages.HomePage;
import cc.polyfrost.oneconfig.gui.pages.ModsPage;
import cc.polyfrost.oneconfig.gui.pages.Page;
import cc.polyfrost.oneconfig.libs.universal.*;
@@ -15,6 +14,7 @@ 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.color.ColorPalette;
import cc.polyfrost.oneconfig.utils.InputUtils;
import cc.polyfrost.oneconfig.utils.MathUtils;
import org.jetbrains.annotations.NotNull;
@@ -31,8 +31,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, -1, false);
- private final BasicElement forwardArrow = new BasicElement(40, 40, -1, false);
+ 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 ArrayList<Page> parents = new ArrayList<>();
public ColorSelector currentColorSelector;
public boolean mouseDown;
@@ -103,7 +103,7 @@ public class OneConfigGui extends UScreen {
textInputField.draw(vg, x + 1020, y + 16);
sideBar.draw(vg, x, y);
backArrow.draw(vg, x + 240, y + 16);
- forwardArrow.draw(vg, x + 280, y + 16);
+ forwardArrow.draw(vg, x + 288, y + 16);
if (previousPages.size() == 0) {
backArrow.disable(true);
@@ -112,7 +112,7 @@ public class OneConfigGui extends UScreen {
backArrow.disable(false);
if (!backArrow.isHovered() || Mouse.isButtonDown(0)) RenderManager.setAlpha(vg, 0.8f);
}
- RenderManager.drawSvg(vg, SVGs.ARROW_CIRCLE_LEFT, x + 249, y + 25, 22, 22);
+ RenderManager.drawSvg(vg, SVGs.CHEVRON_LEFT, x + 246, y + 22, 28, 28);
RenderManager.setAlpha(vg, 1f);
if (nextPages.size() == 0) {
forwardArrow.disable(true);
@@ -121,7 +121,7 @@ public class OneConfigGui extends UScreen {
forwardArrow.disable(false);
if (!forwardArrow.isHovered() || Mouse.isButtonDown(0)) RenderManager.setAlpha(vg, 0.8f);
}
- RenderManager.drawSvg(vg, SVGs.ARROW_CIRCLE_RIGHT, x + 289, y + 25, 22, 22);
+ RenderManager.drawSvg(vg, SVGs.CHEVRON_RIGHT, x + 294, y + 22, 28, 28);
RenderManager.setAlpha(vg, 1f);
if (backArrow.isClicked() && previousPages.size() > 0) {
@@ -153,13 +153,13 @@ public class OneConfigGui extends UScreen {
}
ScissorManager.clearScissors(vg);
- float breadcrumbX = x + 336;
+ float breadcrumbX = x + 352;
for (int i = 0; i < parents.size(); i++) {
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_95;
+ if (i == parents.size() - 1) color = OneConfigConfig.WHITE;
else if (hovered && !Mouse.isButtonDown(0)) color = OneConfigConfig.WHITE_80;
RenderManager.drawText(vg, title, breadcrumbX, y + 38, color, 24f, Fonts.SEMIBOLD);
if (i != 0)
diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/SideBar.java b/src/main/java/cc/polyfrost/oneconfig/gui/SideBar.java
index 6ddda29..078a2d7 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/SideBar.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/SideBar.java
@@ -6,33 +6,31 @@ 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.libs.universal.UMinecraft;
import cc.polyfrost.oneconfig.lwjgl.RenderManager;
import cc.polyfrost.oneconfig.lwjgl.font.Fonts;
import cc.polyfrost.oneconfig.lwjgl.image.SVGs;
import cc.polyfrost.oneconfig.utils.GuiUtils;
-import cc.polyfrost.oneconfig.utils.MathUtils;
+import cc.polyfrost.oneconfig.utils.color.ColorPalette;
import java.util.ArrayList;
import static cc.polyfrost.oneconfig.gui.elements.BasicButton.ALIGNMENT_LEFT;
import static cc.polyfrost.oneconfig.gui.elements.BasicButton.SIZE_36;
-import static cc.polyfrost.oneconfig.utils.ColorUtils.*;
public class SideBar {
private final ArrayList<BasicButton> buttons = new ArrayList<BasicButton>() {{
- add(new BasicButton(192, SIZE_36, "Credits", SVGs.COPYRIGHT_FILL, null, ALIGNMENT_LEFT, TERTIARY));
- add(new BasicButton(192, SIZE_36, "Global Search", SVGs.MAGNIFYING_GLASS_BOLD, null, ALIGNMENT_LEFT, TERTIARY));
- add(new BasicButton(192, SIZE_36, "Mods", SVGs.FADERS_HORIZONTAL_BOLD, null, ALIGNMENT_LEFT, PRIMARY));
- add(new BasicButton(192, SIZE_36, "Profiles", SVGs.USER_SWITCH_FILL, null, ALIGNMENT_LEFT, TERTIARY));
- add(new BasicButton(192, SIZE_36, "Performance", SVGs.GAUGE_FILL, null, ALIGNMENT_LEFT, TERTIARY));
- add(new BasicButton(192, SIZE_36, "Updates", SVGs.ARROWS_CLOCKWISE_BOLD, null, ALIGNMENT_LEFT, TERTIARY));
- add(new BasicButton(192, SIZE_36, "Themes", SVGs.PAINT_BRUSH_BROAD_FILL, null, ALIGNMENT_LEFT, TERTIARY));
- add(new BasicButton(192, SIZE_36, "Screenshots", SVGs.APERTURE_FILL, null, ALIGNMENT_LEFT, TERTIARY));
- add(new BasicButton(192, SIZE_36, "Preferences", SVGs.GEAR_SIX_FILL, null, ALIGNMENT_LEFT, TERTIARY));
+ add(new BasicButton(192, SIZE_36, "Credits", SVGs.COPYRIGHT_FILL, null, ALIGNMENT_LEFT, ColorPalette.TERTIARY));
+ add(new BasicButton(192, SIZE_36, "Global Search", SVGs.MAGNIFYING_GLASS_BOLD, null, ALIGNMENT_LEFT, ColorPalette.TERTIARY));
+ add(new BasicButton(192, SIZE_36, "Mods", SVGs.FADERS_HORIZONTAL_BOLD, null, ALIGNMENT_LEFT, ColorPalette.PRIMARY));
+ add(new BasicButton(192, SIZE_36, "Profiles", SVGs.USER_SWITCH_FILL, null, ALIGNMENT_LEFT, ColorPalette.TERTIARY));
+ add(new BasicButton(192, SIZE_36, "Performance", SVGs.GAUGE_FILL, null, ALIGNMENT_LEFT, ColorPalette.TERTIARY));
+ add(new BasicButton(192, SIZE_36, "Updates", SVGs.ARROWS_CLOCKWISE_BOLD, null, ALIGNMENT_LEFT, ColorPalette.TERTIARY));
+ add(new BasicButton(192, SIZE_36, "Themes", SVGs.PAINT_BRUSH_BROAD_FILL, null, ALIGNMENT_LEFT, ColorPalette.TERTIARY));
+ add(new BasicButton(192, SIZE_36, "Screenshots", SVGs.APERTURE_FILL, null, ALIGNMENT_LEFT, ColorPalette.TERTIARY));
+ add(new BasicButton(192, SIZE_36, "Preferences", SVGs.GEAR_SIX_FILL, null, ALIGNMENT_LEFT, ColorPalette.TERTIARY));
}};
- private final BasicButton HUDButton = new BasicButton(192, SIZE_36, "Edit HUD", SVGs.NOTE_PENCIL_BOLD, null, ALIGNMENT_LEFT, SECONDARY);
- private final BasicButton CloseButton = new BasicButton(192, SIZE_36, "Close", SVGs.X_CIRCLE_BOLD, null, ALIGNMENT_LEFT, SECONDARY_DESTRUCTIVE);
+ private final BasicButton HUDButton = new BasicButton(192, SIZE_36, "Edit HUD", SVGs.NOTE_PENCIL_BOLD, null, ALIGNMENT_LEFT, ColorPalette.SECONDARY);
+ private final BasicButton CloseButton = new BasicButton(192, SIZE_36, "Close", SVGs.X_CIRCLE_BOLD, null, ALIGNMENT_LEFT, ColorPalette.SECONDARY_DESTRUCTIVE);
private int selected = 2;
private Animation moveAnimation = null;
@@ -48,7 +46,7 @@ public class SideBar {
for (BasicButton button : buttons) {
if (!button.isClicked()) continue;
if (button.equals(buttons.get(selected))) break;
- buttons.get(selected).setColorPalette(TERTIARY);
+ buttons.get(selected).setColorPalette(ColorPalette.TERTIARY);
moveAnimation = new EaseInOutQuart(300, buttons.get(selected).x, button.x, false);
selected = buttons.indexOf(button);
}
@@ -56,7 +54,7 @@ public class SideBar {
RenderManager.drawRoundedRect(vg, x + 16, moveAnimation.get(), 192, 36, OneConfigConfig.PRIMARY_600, 12);
if (moveAnimation.isFinished()) {
moveAnimation = null;
- buttons.get(selected).setColorPalette(PRIMARY);
+ buttons.get(selected).setColorPalette(ColorPalette.PRIMARY);
}
}
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 f8edf78..8166883 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicButton.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicButton.java
@@ -6,7 +6,9 @@ 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.utils.ColorUtils;
+import cc.polyfrost.oneconfig.utils.color.ColorPalette;
+import cc.polyfrost.oneconfig.utils.color.ColorUtils;
+import org.jetbrains.annotations.NotNull;
import org.lwjgl.input.Mouse;
@@ -14,7 +16,7 @@ public class BasicButton extends BasicElement {
protected String text;
protected SVGs icon1, icon2;
- private final int alignment, colorPalette;
+ private final int alignment;
private final float fontSize, cornerRadius;
private final int xSpacing, xPadding;
private final int iconSize;
@@ -29,15 +31,17 @@ public class BasicButton extends BasicElement {
public static final int SIZE_36 = 36;
public static final int SIZE_40 = 40;
public static final int SIZE_48 = 48;
+
+ public static final int CUSTOM_COLOR = -100;
private boolean toggleable = false;
private Page page;
private Runnable runnable;
- public BasicButton(int width, int size, String text, int align, int colorPalette) {
+ public BasicButton(int width, int size, String text, int align, @NotNull ColorPalette colorPalette) {
this(width, size, text, null, null, align, colorPalette);
}
- public BasicButton(int width, int size, String text, SVGs icon1, SVGs icon2, int align, int colorPalette) {
+ public BasicButton(int width, int size, String text, SVGs icon1, SVGs icon2, int align, @NotNull ColorPalette colorPalette) {
super(width, 32, colorPalette, true);
if (text != null) this.text = text;
if (icon1 != null) this.icon1 = icon1;
@@ -54,7 +58,7 @@ public class BasicButton extends BasicElement {
this.fontSize = size == SIZE_48 ? 20 : (float) (size / 2 - 4);
}
- public BasicButton(int width, int size, SVGs icon, int align, int colorPalette) {
+ public BasicButton(int width, int size, SVGs icon, int align, @NotNull ColorPalette colorPalette) {
this(width, size, null, icon, null, align, colorPalette);
}
@@ -74,19 +78,16 @@ public class BasicButton extends BasicElement {
public void draw(long vg, int x, int y) {
this.x = x;
this.y = y;
- RenderManager.drawRoundedRect(vg, x, y, this.width, this.height, currentColor, this.cornerRadius);
+ RenderManager.drawRoundedRect(vg, x, y, this.width, this.height, colorPalette == ColorPalette.TERTIARY || colorPalette == ColorPalette.TERTIARY_DESTRUCTIVE ? OneConfigConfig.TRANSPARENT : currentColor, this.cornerRadius);
float contentWidth = 0f;
int color = -1;
+ if(colorPalette == ColorPalette.TERTIARY || colorPalette == ColorPalette.TERTIARY_DESTRUCTIVE) {
+ color = currentColor;
+ }
final float middle = x + width / 2f;
final float middleYIcon = y + height / 2f - iconSize / 2f;
final float middleYText = y + height / 2f + fontSize / 8f;
if (this.text != null) {
- if (this.colorPalette == ColorUtils.TERTIARY) {
- color = OneConfigConfig.WHITE_80;
- if (hovered) color = OneConfigConfig.WHITE;
- if (clicked) color = OneConfigConfig.WHITE_80;
- if (page == null) color = OneConfigConfig.WHITE_50;
- }
contentWidth += RenderManager.getTextWidth(vg, text, fontSize, Fonts.MEDIUM);
}
if (alignment == ALIGNMENT_CENTER) {
@@ -177,10 +178,6 @@ public class BasicButton extends BasicElement {
public void update(int x, int y) {
super.update(x, y);
if (hoverFx) {
- if (colorPalette == ColorUtils.TERTIARY) {
- currentColor = OneConfigConfig.TRANSPARENT;
- return;
- }
if (!toggleable) {
currentColor = ColorUtils.getColor(currentColor, colorPalette, hovered, hovered && Mouse.isButtonDown(0));
} else {
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 8b86827..93e2c07 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicElement.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicElement.java
@@ -1,27 +1,29 @@
package cc.polyfrost.oneconfig.gui.elements;
import cc.polyfrost.oneconfig.lwjgl.RenderManager;
-import cc.polyfrost.oneconfig.utils.ColorUtils;
+import cc.polyfrost.oneconfig.utils.color.ColorPalette;
+import cc.polyfrost.oneconfig.utils.color.ColorUtils;
import cc.polyfrost.oneconfig.utils.InputUtils;
+import org.jetbrains.annotations.NotNull;
public class BasicElement {
protected int width, height;
- protected int colorPalette;
+ protected ColorPalette colorPalette;
protected int hitBoxX, hitBoxY;
protected boolean hoverFx;
protected boolean hovered = false;
protected boolean clicked = false;
protected boolean toggled = false;
protected boolean disabled = false;
- protected int currentColor;
+ public int currentColor;
protected final float radius;
private boolean block = false;
- public BasicElement(int width, int height, int colorPalette, boolean hoverFx) {
+ public BasicElement(int width, int height, @NotNull ColorPalette colorPalette, boolean hoverFx) {
this(width, height, colorPalette, hoverFx, 12f);
}
- public BasicElement(int width, int height, int colorPalette, boolean hoverFx, float radius) {
+ public BasicElement(int width, int height, @NotNull ColorPalette colorPalette, boolean hoverFx, float radius) {
this.height = height;
this.width = width;
this.colorPalette = colorPalette;
@@ -30,7 +32,7 @@ public class BasicElement {
}
public BasicElement(int width, int height, boolean hoverFx) {
- this(width, height, ColorUtils.TRANSPARENT, hoverFx, 12f);
+ this(width, height, ColorPalette.TRANSPARENT, hoverFx, 12f);
}
@@ -80,7 +82,7 @@ public class BasicElement {
this.height = height;
}
- public void setColorPalette(int colorPalette) {
+ public void setColorPalette(ColorPalette colorPalette) {
this.colorPalette = colorPalette;
}
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 edd145e..8cc8165 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/ColorSelector.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/ColorSelector.java
@@ -11,7 +11,7 @@ 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.utils.ColorUtils;
+import cc.polyfrost.oneconfig.utils.color.ColorPalette;
import cc.polyfrost.oneconfig.utils.InputUtils;
import cc.polyfrost.oneconfig.utils.MathUtils;
import cc.polyfrost.oneconfig.utils.NetworkUtils;
@@ -31,11 +31,11 @@ public class ColorSelector {
private final ArrayList<BasicElement> buttons = new ArrayList<>();
private final BasicElement closeBtn = new BasicElement(32, 32, false);
- private final BasicButton copyBtn = new BasicButton(32, 32, SVGs.COPY, BasicButton.ALIGNMENT_CENTER, ColorUtils.SECONDARY);
- private final BasicButton pasteBtn = new BasicButton(32, 32, SVGs.PASTE, BasicButton.ALIGNMENT_CENTER, ColorUtils.SECONDARY);
- private final BasicButton guideBtn = new BasicButton(112, 32, "Guide", SVGs.HELP_CIRCLE, SVGs.POP_OUT, BasicButton.ALIGNMENT_CENTER, ColorUtils.SECONDARY);
- private final BasicButton faveBtn = new BasicButton(32, 32, SVGs.HEART_OUTLINE, BasicButton.ALIGNMENT_CENTER, ColorUtils.SECONDARY);
- private final BasicButton recentBtn = new BasicButton(32, 32, SVGs.HISTORY, BasicButton.ALIGNMENT_CENTER, ColorUtils.SECONDARY);
+ private final BasicButton copyBtn = new BasicButton(32, 32, SVGs.COPY, BasicButton.ALIGNMENT_CENTER, ColorPalette.SECONDARY);
+ private final BasicButton pasteBtn = new BasicButton(32, 32, SVGs.PASTE, BasicButton.ALIGNMENT_CENTER, ColorPalette.SECONDARY);
+ private final BasicButton guideBtn = new BasicButton(112, 32, "Guide", SVGs.HELP_CIRCLE, SVGs.POP_OUT, BasicButton.ALIGNMENT_CENTER, ColorPalette.SECONDARY);
+ private final BasicButton faveBtn = new BasicButton(32, 32, SVGs.HEART_OUTLINE, BasicButton.ALIGNMENT_CENTER, ColorPalette.SECONDARY);
+ private final BasicButton recentBtn = new BasicButton(32, 32, SVGs.HISTORY, BasicButton.ALIGNMENT_CENTER, ColorPalette.SECONDARY);
private final NumberInputField hueInput = new NumberInputField(90, 32, 0, 0, 360, 1);
private final NumberInputField saturationInput = new NumberInputField(90, 32, 100, 0, 100, 1);
@@ -56,9 +56,9 @@ public class ColorSelector {
public ColorSelector(OneColor color, int mouseX, int mouseY) {
this.color = color;
- buttons.add(new BasicElement(124, 28, ColorUtils.SECONDARY, true, 10f));
- buttons.add(new BasicElement(124, 28, ColorUtils.SECONDARY, true, 10f));
- buttons.add(new BasicElement(124, 28, ColorUtils.SECONDARY, true, 10f));
+ buttons.add(new BasicElement(124, 28, ColorPalette.SECONDARY, true, 10f));
+ buttons.add(new BasicElement(124, 28, ColorPalette.SECONDARY, true, 10f));
+ buttons.add(new BasicElement(124, 28, ColorPalette.SECONDARY, true, 10f));
hueInput.setCurrentValue(color.getHue());
saturationInput.setCurrentValue(color.getSaturation());
brightnessInput.setCurrentValue(color.getBrightness());
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 410f98f..d5e8895 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java
@@ -9,7 +9,8 @@ import cc.polyfrost.oneconfig.libs.universal.wrappers.UPlayer;
import cc.polyfrost.oneconfig.lwjgl.RenderManager;
import cc.polyfrost.oneconfig.lwjgl.font.Fonts;
import cc.polyfrost.oneconfig.lwjgl.image.SVGs;
-import cc.polyfrost.oneconfig.utils.ColorUtils;
+import cc.polyfrost.oneconfig.utils.color.ColorPalette;
+import cc.polyfrost.oneconfig.utils.color.ColorUtils;
import cc.polyfrost.oneconfig.utils.InputUtils;
import net.minecraftforge.client.ClientCommandHandler;
import net.minecraftforge.fml.common.ModMetadata;
@@ -19,7 +20,7 @@ import java.util.ArrayList;
public class ModCard extends BasicElement {
private final Mod modData;
- private final BasicElement favoriteHitbox = new BasicElement(32, 32, ColorUtils.PRIMARY, true);
+ private final BasicElement favoriteHitbox = new BasicElement(32, 32, ColorPalette.PRIMARY, true);
private boolean active, disabled, favorite;
private int colorGray = OneConfigConfig.GRAY_600;
private int colorPrimary = OneConfigConfig.PRIMARY_600;
@@ -62,11 +63,11 @@ public class ModCard extends BasicElement {
super.update(x, y);
isHoveredMain = InputUtils.isAreaHovered(x, y, width, 87);
boolean isHoveredSecondary = InputUtils.isAreaHovered(x, y + 87, width - 32, 32) && !disabled;
- colorGray = ColorUtils.getColor(colorGray, ColorUtils.SECONDARY, isHoveredMain, clicked && isHoveredMain);
+ colorGray = ColorUtils.getColor(colorGray, ColorPalette.SECONDARY, isHoveredMain, clicked && isHoveredMain);
if (active && !disabled) {
- colorPrimary = ColorUtils.getColor(colorPrimary, ColorUtils.PRIMARY, isHoveredSecondary, clicked && isHoveredSecondary);
+ colorPrimary = ColorUtils.getColor(colorPrimary, ColorPalette.PRIMARY, isHoveredSecondary, clicked && isHoveredSecondary);
} else {
- colorPrimary = ColorUtils.getColor(colorPrimary, ColorUtils.SECONDARY, isHoveredSecondary, false);
+ colorPrimary = ColorUtils.getColor(colorPrimary, ColorPalette.SECONDARY, isHoveredSecondary, false);
}
if (clicked && isHoveredMain) {
if (!active) toggled = false;
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 a10e3a0..d58852f 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
@@ -5,7 +5,7 @@ import cc.polyfrost.oneconfig.config.interfaces.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.utils.ColorUtils;
+import cc.polyfrost.oneconfig.utils.color.ColorPalette;
import java.lang.reflect.Field;
@@ -14,13 +14,13 @@ public class ConfigButton extends BasicOption {
public ConfigButton(Runnable runnable, Object parent, String name, int size, String text) {
super(null, parent, name, size);
- this.button = new BasicButton(size == 1 ? 128 : 256, 32, text, BasicButton.ALIGNMENT_CENTER, ColorUtils.PRIMARY);
+ this.button = new BasicButton(size == 1 ? 128 : 256, 32, text, BasicButton.ALIGNMENT_CENTER, ColorPalette.PRIMARY);
this.button.setClickAction(runnable);
}
public ConfigButton(Field field, Object parent, String name, int size, String text) {
super(field, parent, name, size);
- this.button = new BasicButton(size == 1 ? 128 : 256, 32, text, BasicButton.ALIGNMENT_CENTER, ColorUtils.PRIMARY);
+ this.button = new BasicButton(size == 1 ? 128 : 256, 32, text, BasicButton.ALIGNMENT_CENTER, ColorPalette.PRIMARY);
this.button.setClickAction(getRunnableFromField(field, parent));
}
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 0f1a2bb..543a8e0 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
@@ -5,7 +5,8 @@ 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.image.SVGs;
-import cc.polyfrost.oneconfig.utils.ColorUtils;
+import cc.polyfrost.oneconfig.utils.color.ColorPalette;
+import cc.polyfrost.oneconfig.utils.color.ColorUtils;
import cc.polyfrost.oneconfig.utils.InputUtils;
import cc.polyfrost.oneconfig.utils.MathUtils;
@@ -40,7 +41,7 @@ public class ConfigCheckbox extends BasicOption {
e.printStackTrace();
}
}
- color = ColorUtils.getColor(color, ColorUtils.SECONDARY, hover, false);
+ color = ColorUtils.getColor(color, ColorPalette.SECONDARY, hover, false);
if (percentOn != 1f) { // performance
RenderManager.drawRoundedRect(vg, x, y + 4, 24, 24, color, 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
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 4a986d7..51d3fec 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
@@ -5,7 +5,8 @@ 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.image.SVGs;
-import cc.polyfrost.oneconfig.utils.ColorUtils;
+import cc.polyfrost.oneconfig.utils.color.ColorPalette;
+import cc.polyfrost.oneconfig.utils.color.ColorUtils;
import cc.polyfrost.oneconfig.utils.InputUtils;
import org.lwjgl.input.Mouse;
@@ -40,7 +41,7 @@ public class ConfigDropdown extends BasicOption { // TODO: remove dividers and f
}
if (opened) return;
- backgroundColor = ColorUtils.getColor(backgroundColor, ColorUtils.SECONDARY, hovered, false);
+ backgroundColor = ColorUtils.getColor(backgroundColor, ColorPalette.SECONDARY, hovered, false);
int selected = 0;
try {
selected = (int) get();
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 78ef0b3..b10cf2c 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
@@ -9,7 +9,7 @@ import cc.polyfrost.oneconfig.libs.universal.UKeyboard;
import cc.polyfrost.oneconfig.lwjgl.RenderManager;
import cc.polyfrost.oneconfig.lwjgl.font.Fonts;
import cc.polyfrost.oneconfig.lwjgl.image.SVGs;
-import cc.polyfrost.oneconfig.utils.ColorUtils;
+import cc.polyfrost.oneconfig.utils.color.ColorPalette;
import java.lang.reflect.Field;
@@ -19,7 +19,7 @@ public class ConfigKeyBind extends BasicOption {
public ConfigKeyBind(Field field, Object parent, String name, int size) {
super(field, parent, name, size);
- button = new BasicButton(256, 32, "", SVGs.KEYSTROKE, null, BasicButton.ALIGNMENT_LEFT, ColorUtils.SECONDARY);
+ button = new BasicButton(256, 32, "", SVGs.KEYSTROKE, null, BasicButton.ALIGNMENT_LEFT, ColorPalette.SECONDARY);
button.setToggleable(true);
}
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 ec13566..a68370a 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
@@ -8,7 +8,8 @@ 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.utils.ColorUtils;
+import cc.polyfrost.oneconfig.utils.color.ColorPalette;
+import cc.polyfrost.oneconfig.utils.color.ColorUtils;
import cc.polyfrost.oneconfig.utils.InputUtils;
import org.lwjgl.input.Mouse;
@@ -30,7 +31,7 @@ public class ConfigPageButton extends BasicOption {
int height = description.equals("") ? 64 : 96;
boolean hovered = InputUtils.isAreaHovered(x - 2, y, 1024, height) && isEnabled();
boolean clicked = hovered && InputUtils.isClicked();
- backgroundColor = ColorUtils.getColor(backgroundColor, ColorUtils.SECONDARY, hovered, false);
+ backgroundColor = ColorUtils.getColor(backgroundColor, ColorPalette.SECONDARY, hovered, false);
if (hovered && Mouse.isButtonDown(0)) RenderManager.setAlpha(vg, 0.8f);
if (!isEnabled()) RenderManager.setAlpha(vg, 0.5f);
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 61c0dd5..8a0d85e 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
@@ -4,7 +4,8 @@ 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.utils.ColorUtils;
+import cc.polyfrost.oneconfig.utils.color.ColorPalette;
+import cc.polyfrost.oneconfig.utils.color.ColorUtils;
import cc.polyfrost.oneconfig.utils.InputUtils;
import cc.polyfrost.oneconfig.utils.MathUtils;
@@ -28,7 +29,7 @@ public class ConfigSwitch extends BasicOption {
}
int x2 = x + 3 + (int) (percentOn * 18);
boolean hovered = InputUtils.isAreaHovered(x, y, 42, 32);
- colorDisabled = ColorUtils.getColor(colorDisabled, ColorUtils.SECONDARY, hovered, false);
+ colorDisabled = ColorUtils.getColor(colorDisabled, ColorPalette.SECONDARY, hovered, false);
colorEnabled = ColorUtils.smoothColor(colorEnabled, OneConfigConfig.PRIMARY_600, OneConfigConfig.PRIMARY_500, hovered, 40f);
if (!isEnabled()) RenderManager.setAlpha(vg, 0.5f);
RenderManager.drawRoundedRect(vg, x, y + 4, 42, 24, colorDisabled, 12f);
diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigUniSelector.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigUniSelector.java
index ce048c9..698d04b 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigUniSelector.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigUniSelector.java
@@ -7,7 +7,7 @@ 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.utils.ColorUtils;
+import cc.polyfrost.oneconfig.utils.color.ColorUtils;
import cc.polyfrost.oneconfig.utils.InputUtils;
import cc.polyfrost.oneconfig.utils.MathUtils;
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 925f61d..bdf3dfa 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
@@ -4,7 +4,8 @@ import cc.polyfrost.oneconfig.config.OneConfigConfig;
import cc.polyfrost.oneconfig.gui.elements.BasicElement;
import cc.polyfrost.oneconfig.lwjgl.RenderManager;
import cc.polyfrost.oneconfig.lwjgl.image.SVGs;
-import cc.polyfrost.oneconfig.utils.ColorUtils;
+import cc.polyfrost.oneconfig.utils.color.ColorPalette;
+import cc.polyfrost.oneconfig.utils.color.ColorUtils;
public class NumberInputField extends TextInputField {
private final BasicElement upArrow = new BasicElement(12, 14, false);
@@ -47,8 +48,8 @@ public class NumberInputField extends TextInputField {
if (current == max) colorTop = OneConfigConfig.GRAY_500_80;
if (current == min) colorBottom = OneConfigConfig.GRAY_500_80;
- colorTop = ColorUtils.getColor(colorTop, ColorUtils.SECONDARY, upArrow.isHovered(), upArrow.isClicked());
- colorBottom = ColorUtils.getColor(colorBottom, ColorUtils.SECONDARY, downArrow.isHovered(), downArrow.isClicked());
+ colorTop = ColorUtils.getColor(colorTop, ColorPalette.SECONDARY, upArrow.isHovered(), upArrow.isClicked());
+ colorBottom = ColorUtils.getColor(colorBottom, ColorPalette.SECONDARY, downArrow.isHovered(), downArrow.isClicked());
if (upArrow.isClicked()) {
current += step;
if (current > max) current = max;
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 3e15e83..bd73c1e 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/pages/HomePage.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/pages/HomePage.java
@@ -1,18 +1,9 @@
package cc.polyfrost.oneconfig.gui.pages;
import cc.polyfrost.oneconfig.config.OneConfigConfig;
-import cc.polyfrost.oneconfig.config.core.OneColor;
-import cc.polyfrost.oneconfig.gui.OneConfigGui;
-import cc.polyfrost.oneconfig.gui.elements.BasicButton;
-import cc.polyfrost.oneconfig.gui.elements.ColorSelector;
import cc.polyfrost.oneconfig.lwjgl.RenderManager;
import cc.polyfrost.oneconfig.lwjgl.font.Fonts;
import cc.polyfrost.oneconfig.lwjgl.image.SVGs;
-import cc.polyfrost.oneconfig.utils.ColorUtils;
-import cc.polyfrost.oneconfig.utils.InputUtils;
-import cc.polyfrost.oneconfig.utils.NetworkUtils;
-
-import java.awt.*;
public class HomePage extends Page {
/*private final BasicButton socialsBtn = new BasicButton(184, 36, "Socials", SVGs.SHARE, SVGs.POP_OUT, BasicButton.ALIGNMENT_CENTER, ColorUtils.PRIMARY);
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 205de07..b5f2256 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModConfigPage.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModConfigPage.java
@@ -6,7 +6,7 @@ import cc.polyfrost.oneconfig.config.interfaces.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.utils.ColorUtils;
+import cc.polyfrost.oneconfig.utils.color.ColorPalette;
import java.util.ArrayList;
@@ -28,7 +28,7 @@ public class ModConfigPage extends Page {
}
if (page.categories.size() < 2) return;
for (String category : page.categories.keySet()) {
- BasicButton button = new BasicButton(0, SIZE_32, category, BasicButton.ALIGNMENT_CENTER, ColorUtils.SECONDARY);
+ BasicButton button = new BasicButton(0, SIZE_32, category, BasicButton.ALIGNMENT_CENTER, ColorPalette.SECONDARY);
button.setClickAction(() -> switchCategory(category));
button.setToggleable(true);
if (category.equals(selectedCategory)) button.setToggled(true);
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 cc087a3..6df01e1 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModsPage.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModsPage.java
@@ -9,7 +9,7 @@ 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.utils.ColorUtils;
+import cc.polyfrost.oneconfig.utils.color.ColorPalette;
import java.util.ArrayList;
import java.util.List;
@@ -25,13 +25,13 @@ public class ModsPage extends Page {
for (Mod modData : OneConfig.loadedMods) {
modCards.add(OneConfigConfig.favoriteMods.contains(modData.name) ? 0 : modCards.size(), new ModCard(modData, modData.config == null || modData.config.enabled, false, OneConfigConfig.favoriteMods.contains(modData.name)));
}
- modCategories.add(new BasicButton(64, 32, "All", BasicButton.ALIGNMENT_CENTER, ColorUtils.SECONDARY));
- modCategories.add(new BasicButton(80, 32, "Combat", BasicButton.ALIGNMENT_CENTER, ColorUtils.SECONDARY));
- modCategories.add(new BasicButton(64, 32, "HUD", BasicButton.ALIGNMENT_CENTER, ColorUtils.SECONDARY));
- modCategories.add(new BasicButton(104, 32, "Utility & QoL", BasicButton.ALIGNMENT_CENTER, ColorUtils.SECONDARY));
- modCategories.add(new BasicButton(80, 32, "Hypixel", BasicButton.ALIGNMENT_CENTER, ColorUtils.SECONDARY));
- modCategories.add(new BasicButton(80, 32, "Skyblock", BasicButton.ALIGNMENT_CENTER, ColorUtils.SECONDARY));
- modCategories.add(new BasicButton(88, 32, "3rd Party", BasicButton.ALIGNMENT_CENTER, ColorUtils.SECONDARY));
+ modCategories.add(new BasicButton(64, 32, "All", BasicButton.ALIGNMENT_CENTER, ColorPalette.SECONDARY));
+ modCategories.add(new BasicButton(80, 32, "Combat", BasicButton.ALIGNMENT_CENTER, ColorPalette.SECONDARY));
+ modCategories.add(new BasicButton(64, 32, "HUD", BasicButton.ALIGNMENT_CENTER, ColorPalette.SECONDARY));
+ modCategories.add(new BasicButton(104, 32, "Utility & QoL", BasicButton.ALIGNMENT_CENTER, ColorPalette.SECONDARY));
+ modCategories.add(new BasicButton(80, 32, "Hypixel", BasicButton.ALIGNMENT_CENTER, ColorPalette.SECONDARY));
+ modCategories.add(new BasicButton(80, 32, "Skyblock", BasicButton.ALIGNMENT_CENTER, ColorPalette.SECONDARY));
+ modCategories.add(new BasicButton(88, 32, "3rd Party", BasicButton.ALIGNMENT_CENTER, ColorPalette.SECONDARY));
modCategories.get(0).setToggled(true);
int i = 0;
for (BasicButton button : modCategories) {