aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/polyfrost/oneconfig/gui
diff options
context:
space:
mode:
authornextdaydelivery <79922345+nxtdaydelivery@users.noreply.github.com>2022-05-26 18:05:16 +0100
committernextdaydelivery <79922345+nxtdaydelivery@users.noreply.github.com>2022-05-26 18:05:16 +0100
commitc1010e9c2c6d82bd3f40c246e45cfe8e9b039d7b (patch)
treed634326c96182929c417225c1311005d5e195543 /src/main/java/cc/polyfrost/oneconfig/gui
parent6160224ebc584194526f1f31b9a0d63c0ba017d4 (diff)
downloadOneConfig-c1010e9c2c6d82bd3f40c246e45cfe8e9b039d7b.tar.gz
OneConfig-c1010e9c2c6d82bd3f40c246e45cfe8e9b039d7b.tar.bz2
OneConfig-c1010e9c2c6d82bd3f40c246e45cfe8e9b039d7b.zip
Color Utils fixes and more
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/gui')
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/SideBar.java31
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicButton.java73
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicElement.java2
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/ColorSelector.java24
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java10
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigButton.java5
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigCheckbox.java2
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigDropdown.java2
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigKeyBind.java3
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigPageButton.java2
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigSwitch.java2
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/text/NumberInputField.java4
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/pages/CreditsPage.java29
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/pages/HomePage.java19
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/pages/ModConfigPage.java3
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/pages/ModsPage.java15
16 files changed, 131 insertions, 95 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/SideBar.java b/src/main/java/cc/polyfrost/oneconfig/gui/SideBar.java
index bc18253..5729de3 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/SideBar.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/SideBar.java
@@ -7,6 +7,7 @@ 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.utils.ColorUtils;
import cc.polyfrost.oneconfig.utils.MathUtils;
import cc.polyfrost.oneconfig.libs.universal.UScreen;
@@ -21,25 +22,25 @@ public class SideBar {
private float targetY = 0, currentY = 0;
public SideBar() {
- btnList.add(new BasicButton(192, SIZE_36, "Dashboard", SVGs.DASHBOARD, null, ALIGNMENT_LEFT, -2));
+ btnList.add(new BasicButton(192, SIZE_36, "Dashboard", SVGs.DASHBOARD, null, ALIGNMENT_LEFT, ColorUtils.TERTIARY));
btnList.get(0).setClickAction(new HomePage());
- btnList.add(new BasicButton(192, SIZE_36, "Global Search", SVGs.SEARCH, null, ALIGNMENT_LEFT, -2));
- btnList.add(new BasicButton(192, SIZE_36, "Screenshots", SVGs.IMAGE, null, ALIGNMENT_LEFT, -2));
- btnList.add(new BasicButton(192, SIZE_36, "Preferences", SVGs.SETTINGS, null, ALIGNMENT_LEFT, -2));
- btnList.add(new BasicButton(192, 36, "Mods", SVGs.MODS, null, ALIGNMENT_LEFT, -2));
+ btnList.add(new BasicButton(192, SIZE_36, "Global Search", SVGs.SEARCH, null, ALIGNMENT_LEFT, ColorUtils.TERTIARY));
+ btnList.add(new BasicButton(192, SIZE_36, "Screenshots", SVGs.IMAGE, null, ALIGNMENT_LEFT, ColorUtils.TERTIARY));
+ btnList.add(new BasicButton(192, SIZE_36, "Preferences", SVGs.SETTINGS, null, ALIGNMENT_LEFT, ColorUtils.TERTIARY));
+ btnList.add(new BasicButton(192, 36, "Mods", SVGs.MODS, null, ALIGNMENT_LEFT, ColorUtils.TERTIARY));
btnList.get(4).setClickAction(new ModsPage());
- btnList.add(new BasicButton(192, SIZE_36, "Performance", SVGs.PERFORMANCE, null, ALIGNMENT_LEFT, -2));
- btnList.add(new BasicButton(192, SIZE_36, "Profiles", SVGs.PROFILES, null, ALIGNMENT_LEFT, -2));
- btnList.add(new BasicButton(192, SIZE_36, "Updates", SVGs.UPDATE, null, ALIGNMENT_LEFT, -2));
- btnList.add(new BasicButton(192, SIZE_36, "Themes Library", SVGs.THEME, null, ALIGNMENT_LEFT, -2));
- btnList.add(new BasicButton(192, SIZE_36, "Themes Browser", SVGs.SEARCH, null, ALIGNMENT_LEFT, -2));
- btnList.add(new BasicButton(192, SIZE_36, "Packs Library", SVGs.BOX, null, ALIGNMENT_LEFT, -2));
- btnList.add(new BasicButton(192, SIZE_36, "Packs Browser", SVGs.SEARCH, null, ALIGNMENT_LEFT, -2));
- btnList.add(new BasicButton(192, SIZE_36, "Close", SVGs.X_CIRCLE, null, ALIGNMENT_LEFT, -1));
+ btnList.add(new BasicButton(192, SIZE_36, "Performance", SVGs.PERFORMANCE, null, ALIGNMENT_LEFT, ColorUtils.TERTIARY));
+ btnList.add(new BasicButton(192, SIZE_36, "Profiles", SVGs.PROFILES, null, ALIGNMENT_LEFT, ColorUtils.TERTIARY));
+ btnList.add(new BasicButton(192, SIZE_36, "Updates", SVGs.UPDATE, null, ALIGNMENT_LEFT, ColorUtils.TERTIARY));
+ btnList.add(new BasicButton(192, SIZE_36, "Themes Library", SVGs.THEME, null, ALIGNMENT_LEFT, ColorUtils.TERTIARY));
+ btnList.add(new BasicButton(192, SIZE_36, "Themes Browser", SVGs.SEARCH, null, ALIGNMENT_LEFT, ColorUtils.TERTIARY));
+ btnList.add(new BasicButton(192, SIZE_36, "Packs Library", SVGs.BOX, null, ALIGNMENT_LEFT, ColorUtils.TERTIARY));
+ btnList.add(new BasicButton(192, SIZE_36, "Packs Browser", SVGs.SEARCH, null, ALIGNMENT_LEFT, ColorUtils.TERTIARY));
+ btnList.add(new BasicButton(192, SIZE_36, "Close", SVGs.X_CIRCLE, null, ALIGNMENT_LEFT, ColorUtils.SECONDARY_TRANSPARENT));
btnList.get(12).setClickAction(() -> UScreen.displayScreen(null));
- btnList.add(new BasicButton(192, SIZE_36, "Minimize", SVGs.MINIMISE, null, ALIGNMENT_LEFT, -1));
+ btnList.add(new BasicButton(192, SIZE_36, "Minimize", SVGs.MINIMISE, null, ALIGNMENT_LEFT, ColorUtils.SECONDARY_TRANSPARENT));
btnList.get(13).setClickAction(() -> UScreen.displayScreen(null));
- btnList.add(new BasicButton(192, SIZE_36, "Edit HUD", SVGs.HUD, null, ALIGNMENT_LEFT, -1));
+ btnList.add(new BasicButton(192, SIZE_36, "Edit HUD", SVGs.HUD, null, ALIGNMENT_LEFT, ColorUtils.SECONDARY_TRANSPARENT));
btnList.get(14).setClickAction(() -> UScreen.displayScreen(new HudGui()));
}
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 a4b8ecf..579841e 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicButton.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicButton.java
@@ -1,7 +1,7 @@
package cc.polyfrost.oneconfig.gui.elements;
-import cc.polyfrost.oneconfig.gui.OneConfigGui;
import cc.polyfrost.oneconfig.config.OneConfigConfig;
+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;
@@ -38,14 +38,14 @@ public class BasicButton extends BasicElement {
public BasicButton(int width, int size, String text, SVGs icon1, SVGs icon2, int align, int colorPalette) {
super(width, 32, colorPalette, true);
- if(text != null) this.text = text;
+ if (text != null) this.text = text;
if (icon1 != null) this.icon1 = icon1;
if (icon2 != null) this.icon2 = icon2;
this.colorPalette = colorPalette;
this.alignment = align;
this.cornerRadius = size == SIZE_48 ? 16f : 12f;
this.xSpacing = size == SIZE_48 ? 12 : 8;
- if(size == SIZE_36 || size == SIZE_40) {
+ if (size == SIZE_36 || size == SIZE_40) {
this.xPadding = 16;
} else this.xPadding = size == SIZE_48 ? 20 : 12;
this.height = size;
@@ -79,8 +79,8 @@ public class BasicButton extends BasicElement {
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 == -2) {
+ if (this.text != null) {
+ if (this.colorPalette == ColorUtils.TERTIARY) {
textColor = OneConfigConfig.WHITE_80;
if (hovered) textColor = OneConfigConfig.WHITE;
if (clicked) textColor = OneConfigConfig.WHITE_80;
@@ -88,67 +88,72 @@ public class BasicButton extends BasicElement {
}
contentWidth += RenderManager.getTextWidth(vg, text, fontSize, Fonts.MEDIUM);
}
- if(alignment == ALIGNMENT_CENTER) {
- if (icon1 != null) {
- contentWidth += iconSize + xSpacing;
- }
- if (icon2 != null) {
- contentWidth += iconSize + xSpacing;
- }
- if(text != null) {
- RenderManager.drawString(vg, text, middle - contentWidth / 2 + (icon1 == null ? 0 : iconSize + xSpacing), middleYText, textColor, fontSize, Fonts.MEDIUM);
- }
- if(icon1 != null) {
- RenderManager.drawSvg(vg, icon1, middle - contentWidth / 2, middleYIcon, iconSize, iconSize);
- }
- if(icon2 != null) {
- RenderManager.drawSvg(vg, icon2, middle + contentWidth / 2 - iconSize, middleYIcon, iconSize, iconSize);
- }
+ if (alignment == ALIGNMENT_CENTER) {
+ if(icon1 != null && icon2 == null && text == null) {
+ RenderManager.drawSvg(vg, icon1, middle - iconSize / 2f, middleYIcon, iconSize, iconSize);
+ this.update(x, y);
+ return;
+ }
+ if (icon1 != null) {
+ contentWidth += iconSize + xSpacing;
+ }
+ if (icon2 != null) {
+ contentWidth += iconSize + xSpacing;
+ }
+ if (text != null) {
+ RenderManager.drawString(vg, text, middle - contentWidth / 2 + (icon1 == null ? 0 : iconSize + xSpacing), middleYText, textColor, fontSize, Fonts.MEDIUM);
+ }
+ if (icon1 != null) {
+ RenderManager.drawSvg(vg, icon1, middle - contentWidth / 2, middleYIcon, iconSize, iconSize);
+ }
+ if (icon2 != null) {
+ RenderManager.drawSvg(vg, icon2, middle + contentWidth / 2 - iconSize, middleYIcon, iconSize, iconSize);
+ }
this.update(x, y);
return;
}
- if(alignment == ALIGNMENT_JUSTIFIED) {
- if(text != null) {
+ if (alignment == ALIGNMENT_JUSTIFIED) {
+ if (text != null) {
RenderManager.drawString(vg, text, middle - contentWidth / 2, middleYText, textColor, fontSize, Fonts.MEDIUM);
}
- if(icon1 != null) {
+ if (icon1 != null) {
RenderManager.drawSvg(vg, icon1, x + xSpacing, middleYIcon, iconSize, iconSize);
}
- if(icon2 != null) {
+ if (icon2 != null) {
RenderManager.drawSvg(vg, icon2, x + width - xSpacing - iconSize, middleYIcon, iconSize, iconSize);
}
this.update(x, y);
return;
}
- if(alignment == ALIGNMENT_LEFT) {
+ if (alignment == ALIGNMENT_LEFT) {
contentWidth = xSpacing;
- if(icon1 != null) {
+ if (icon1 != null) {
RenderManager.drawSvg(vg, icon1, x + contentWidth, middleYIcon, iconSize, iconSize);
contentWidth += iconSize + xSpacing;
}
- if(text != null) {
+ if (text != null) {
RenderManager.drawString(vg, text, x + contentWidth, middleYText, textColor, fontSize, Fonts.MEDIUM);
contentWidth += RenderManager.getTextWidth(vg, text, fontSize, Fonts.MEDIUM) + xSpacing;
}
- if(icon2 != null) {
+ if (icon2 != null) {
RenderManager.drawSvg(vg, icon2, x + contentWidth, middleYIcon, iconSize, iconSize);
}
this.update(x, y);
return;
}
- if(alignment == ALIGNMENT_RIGHT) {
+ if (alignment == ALIGNMENT_RIGHT) {
contentWidth = width - xSpacing;
- if(icon2 != null) {
+ if (icon2 != null) {
contentWidth -= iconSize;
RenderManager.drawSvg(vg, icon2, x + contentWidth, middleYIcon, iconSize, iconSize);
contentWidth -= xSpacing;
}
- if(text != null) {
+ if (text != null) {
contentWidth -= RenderManager.getTextWidth(vg, text, fontSize, Fonts.MEDIUM);
RenderManager.drawString(vg, text, x + contentWidth, middleYText, textColor, fontSize, Fonts.MEDIUM);
contentWidth -= xSpacing;
}
- if(icon1 != null) {
+ if (icon1 != null) {
contentWidth -= iconSize;
RenderManager.drawSvg(vg, icon1, x + contentWidth, middleYIcon, iconSize, iconSize);
}
@@ -171,7 +176,7 @@ public class BasicButton extends BasicElement {
public void update(int x, int y) {
super.update(x, y);
if (hoverFx) {
- if (colorPalette == -2) {
+ if (colorPalette == ColorUtils.TERTIARY) {
currentColor = OneConfigConfig.TRANSPARENT;
return;
}
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 887d8d2..f6c9e35 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicElement.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicElement.java
@@ -31,7 +31,7 @@ public class BasicElement {
}
public BasicElement(int width, int height, boolean hoverFx) {
- this(width, height, -1, hoverFx, 12f);
+ this(width, height, ColorUtils.TRANSPARENT, hoverFx, 12f);
}
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 3607d24..e85e223 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/ColorSelector.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/ColorSelector.java
@@ -9,6 +9,7 @@ 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.utils.ColorUtils;
import cc.polyfrost.oneconfig.utils.InputUtils;
import cc.polyfrost.oneconfig.utils.InternetUtils;
import cc.polyfrost.oneconfig.utils.MathUtils;
@@ -28,11 +29,11 @@ public class ColorSelector {
private final ArrayList<BasicElement> buttons = new ArrayList<>();
private final BasicElement closeBtn = new BasicElement(32, 32, false);
- private final BasicElement copyBtn = new BasicElement(32, 32, 2, true);
- private final BasicElement pasteBtn = new BasicElement(32, 32, 2, true);
- private final BasicButton guideBtn = new BasicButton(112, 32, "Guide", null, null, 0, BasicButton.ALIGNMENT_CENTER);
- private final BasicElement faveBtn = new BasicElement(32, 32, 2, true);
- private final BasicElement recentBtn = new BasicElement(32, 32, 2, true);
+ 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 NumberInputField hueInput = new NumberInputField(90, 32, 0, 0, 360, 1);
private final NumberInputField saturationInput = new NumberInputField(90, 32, 100, 0, 100, 1);
@@ -51,9 +52,9 @@ public class ColorSelector {
public ColorSelector(OneColor color, int mouseX, int mouseY) {
this.color = color;
- buttons.add(new BasicElement(124, 28, 2, true, 10f));
- buttons.add(new BasicElement(124, 28, 2, true, 10f));
- buttons.add(new BasicElement(124, 28, 2, 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, ColorUtils.SECONDARY, true, 10f));
hueInput.setCurrentValue(color.getHue());
saturationInput.setCurrentValue(color.getSaturation());
brightnessInput.setCurrentValue(color.getBrightness());
@@ -138,9 +139,7 @@ public class ColorSelector {
// TODO favorite stuff
faveBtn.draw(vg, x + 16, y + 672);
- RenderManager.drawSvg(vg, SVGs.HEART_OUTLINE, x + 23, y + 679, 18, 18);
recentBtn.draw(vg, x + 16, y + 720);
- RenderManager.drawSvg(vg, SVGs.HISTORY, x + 23, y + 727, 18, 18);
for(int i = 0; i < 7; i++) {
favoriteColors.get(i).draw(vg, x + 104 + i * 44, y + 672);
}
@@ -188,12 +187,9 @@ public class ColorSelector {
copyBtn.draw(vg, x + 204, y + 624);
pasteBtn.draw(vg, x + 244, y + 624);
- RenderManager.drawSvg(vg, SVGs.COPY, x + 211, y + 631, 18, 18);
- RenderManager.drawSvg(vg, SVGs.PASTE, x + 251, y + 631, 18, 18);
+
guideBtn.draw(vg, x + 288, y + 624);
- RenderManager.drawSvg(vg, SVGs.HELP_CIRCLE, x + 301, y + 631, 18, 18);
- RenderManager.drawSvg(vg, SVGs.POP_OUT, x + 369, y + 631, 18, 18);
boolean isMouseDown = Mouse.isButtonDown(0);
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 5853585..c60286d 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java
@@ -63,12 +63,12 @@ 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, 0, isHoveredMain, clicked && isHoveredMain);
+ colorGray = ColorUtils.getColor(colorGray, ColorUtils.SECONDARY, isHoveredMain, clicked && isHoveredMain);
if (active && !disabled) {
- colorPrimary = ColorUtils.getColor(colorPrimary, 1, isHoveredSecondary, clicked && isHoveredSecondary);
- } else
- colorPrimary = ColorUtils.smoothColor(colorPrimary, OneConfigConfig.GRAY_500, OneConfigConfig.GRAY_400, isHoveredSecondary, 20f);
-
+ colorPrimary = ColorUtils.getColor(colorPrimary, ColorUtils.PRIMARY, isHoveredSecondary, clicked && isHoveredSecondary);
+ } else {
+ colorPrimary = ColorUtils.getColor(colorPrimary, ColorUtils.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 3caa51f..a0ba444 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,6 +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 java.lang.reflect.Field;
@@ -13,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, 1);
+ this.button = new BasicButton(size == 1 ? 128 : 256, 32, text, BasicButton.ALIGNMENT_CENTER, ColorUtils.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, 1);
+ this.button = new BasicButton(size == 1 ? 128 : 256, 32, text, BasicButton.ALIGNMENT_CENTER, ColorUtils.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 764edcf..91c3cff 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
@@ -40,7 +40,7 @@ public class ConfigCheckbox extends BasicOption {
e.printStackTrace();
}
}
- color = ColorUtils.smoothColor(color, OneConfigConfig.GRAY_600, OneConfigConfig.GRAY_400, hover, 40f);
+ color = ColorUtils.getColor(color, ColorUtils.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 51d43ea..a36a829 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
@@ -40,7 +40,7 @@ public class ConfigDropdown extends BasicOption { // TODO: remove dividers and f
}
if (opened) return;
- backgroundColor = ColorUtils.smoothColor(backgroundColor, OneConfigConfig.GRAY_500, OneConfigConfig.GRAY_400, hovered, 100);
+ backgroundColor = ColorUtils.getColor(backgroundColor, ColorUtils.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 898d6d7..905aabf 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,6 +9,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.libs.universal.UKeyboard;
+import cc.polyfrost.oneconfig.utils.ColorUtils;
import java.lang.reflect.Field;
@@ -18,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, 0);
+ button = new BasicButton(256, 32, "", SVGs.KEYSTROKE, null, BasicButton.ALIGNMENT_LEFT, ColorUtils.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 edd44e1..61729b9 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
@@ -30,7 +30,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.smoothColor(backgroundColor, OneConfigConfig.GRAY_500, OneConfigConfig.GRAY_400, hovered, 100);
+ backgroundColor = ColorUtils.getColor(backgroundColor, ColorUtils.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 2fcf62e..f802680 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
@@ -28,7 +28,7 @@ public class ConfigSwitch extends BasicOption {
}
int x2 = x + 3 + (int) (percentOn * 18);
boolean hovered = InputUtils.isAreaHovered(x, y, 42, 32);
- colorDisabled = ColorUtils.smoothColor(colorDisabled, OneConfigConfig.GRAY_400, OneConfigConfig.GRAY_300, hovered, 40f);
+ colorDisabled = ColorUtils.getColor(colorDisabled, ColorUtils.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/text/NumberInputField.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/text/NumberInputField.java
index 3b6fa43..925f61d 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
@@ -47,8 +47,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, 2, upArrow.isHovered(), upArrow.isClicked());
- colorBottom = ColorUtils.getColor(colorBottom, 2, downArrow.isHovered(), downArrow.isClicked());
+ colorTop = ColorUtils.getColor(colorTop, ColorUtils.SECONDARY, upArrow.isHovered(), upArrow.isClicked());
+ colorBottom = ColorUtils.getColor(colorBottom, ColorUtils.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/CreditsPage.java b/src/main/java/cc/polyfrost/oneconfig/gui/pages/CreditsPage.java
index ec02dce..d6c00ab 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/pages/CreditsPage.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/pages/CreditsPage.java
@@ -1,5 +1,9 @@
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;
+
public class CreditsPage extends Page {
CreditsPage() {
super("Credits");
@@ -7,6 +11,31 @@ public class CreditsPage extends Page {
@Override
public void draw(long vg, int x, int y) {
+ RenderManager.drawSvg(vg, SVGs.ONECONFIG, x + 20f, y + 20f, 96, 96);
+ RenderManager.drawString(vg, "OneConfig", x + 130, y + 46, -1, 42, Fonts.BOLD);
+ RenderManager.drawString(vg, "ALPHA - By Polyfrost", x + 132, y + 76, -1, 18, Fonts.MEDIUM);
+ RenderManager.drawString(vg, "v0.1", x + 132, y + 96, -1, 18, Fonts.MEDIUM);
+
+ RenderManager.drawString(vg, "Development Team", x + 20, y + 180, -1, 24, Fonts.SEMIBOLD);
+ RenderManager.drawString(vg, " - MoonTidez - Founder and lead designer", x + 20, y + 205, -1, 12, Fonts.REGULAR);
+ RenderManager.drawString(vg, " - DeDiamondPro - Config backend, GUI frontend, HUD", x + 20, y + 220, -1, 12, Fonts.REGULAR); // +15/line
+ RenderManager.drawString(vg, " - nextdaydelivery - GUI frontend, Render Manager, Utilities", x + 20, y + 235, -1, 12, Fonts.REGULAR);
+ RenderManager.drawString(vg, " - Wyvest - Gradle, Render Manager, VCAL, Utilities", x + 20, y + 250, -1, 12, Fonts.REGULAR);
+ RenderManager.drawString(vg, " - Ethan - Utilities", x + 20, y + 265, -1, 12, Fonts.REGULAR);
+
+ RenderManager.drawString(vg, "Libraries", x + 20, y + 318, -1, 24, Fonts.SEMIBOLD);
+ RenderManager.drawString(vg, " - LWJGLTwoPointFive (DJTheRedstoner) - LWJGL3 loading hack", x + 20, y + 340, -1, 12, Fonts.REGULAR);
+ RenderManager.drawString(vg, " - #getResourceAsStream (SpinyOwl) - IO Utility", x + 20, y + 355, -1, 12, Fonts.REGULAR);
+ RenderManager.drawString(vg, " - NanoVG (memononen) - NanoVG Library", x + 20, y + 370, -1, 12, Fonts.REGULAR);
+ RenderManager.drawString(vg, " - UniversalCraft (Sk1er LLC) - Multiversioning bindings", x + 20, y + 385, -1, 12, Fonts.REGULAR);
+ RenderManager.drawString(vg, " - Easing Functions (jesusgollonet)", x + 20, y + 400, -1, 12, Fonts.REGULAR);
+ RenderManager.drawString(vg, " - Quiltflower (W-OVERFLOW) - Gradle toolkit", x + 20, y + 415, -1, 12, Fonts.REGULAR);
+
+ RenderManager.drawString(vg, "Terms Of Service & Licensing", x + 20, y + 517, -1, 24, Fonts.SEMIBOLD);
+ RenderManager.drawString(vg, " - License Summary goes here", x + 20, y + 540, -1, 12, Fonts.REGULAR);
+
+ RenderManager.drawImage(vg, "https://i.insider.com/602ee9ced3ad27001837f2ac?width=700", x + 600, y + 20, 350, 263);
+
}
}
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 050b055..f576b7b 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/pages/HomePage.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/pages/HomePage.java
@@ -8,25 +8,26 @@ import cc.polyfrost.oneconfig.config.core.OneColor;
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.InternetUtils;
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, 1);
- private final BasicButton discordBtn = new BasicButton(184, 36, "Discord", SVGs.WEBSITE, SVGs.LINK_DIAGONAL, BasicButton.ALIGNMENT_CENTER, 1);
- private final BasicButton webBtn = new BasicButton(184, 36, "Website", SVGs.WEBSITE, null, BasicButton.ALIGNMENT_CENTER, 1);
- private final BasicButton creditsBtn = new BasicButton(184, 36, "Credits", SVGs.AUDIO_PLAY, SVGs.LINK_DIAGONAL, BasicButton.ALIGNMENT_CENTER, 0);
- private final BasicButton guideBtn = new BasicButton(184, 36, "Online Guide", SVGs.HELP_CIRCLE, null, BasicButton.ALIGNMENT_CENTER, 0);
- private final BasicButton button1 = new BasicButton(184, BasicButton.SIZE_32, "HELLO", SVGs.MICROSOFT_ICON, SVGs.AUDIO_PLAY, BasicButton.ALIGNMENT_CENTER, 1);
- private final BasicButton button2 = new BasicButton(184, BasicButton.SIZE_36, "TESTING", SVGs.MICROSOFT_ICON, null, BasicButton.ALIGNMENT_LEFT, 1);
- private final BasicButton button3 = new BasicButton(184, BasicButton.SIZE_40, "BOBFISH", SVGs.MICROSOFT_ICON, null, BasicButton.ALIGNMENT_CENTER, -2);
+ private final BasicButton socialsBtn = new BasicButton(184, 36, "Socials", SVGs.SHARE, SVGs.POP_OUT, BasicButton.ALIGNMENT_CENTER, ColorUtils.PRIMARY);
+ private final BasicButton discordBtn = new BasicButton(184, 36, "Discord", SVGs.WEBSITE, SVGs.LINK_DIAGONAL, BasicButton.ALIGNMENT_CENTER, ColorUtils.PRIMARY);
+ private final BasicButton webBtn = new BasicButton(184, 36, "Website", SVGs.WEBSITE, null, BasicButton.ALIGNMENT_CENTER, ColorUtils.PRIMARY);
+ private final BasicButton creditsBtn = new BasicButton(184, 36, "Credits", SVGs.AUDIO_PLAY, SVGs.LINK_DIAGONAL, BasicButton.ALIGNMENT_CENTER, ColorUtils.SECONDARY);
+ private final BasicButton guideBtn = new BasicButton(184, 36, "Online Guide", SVGs.HELP_CIRCLE, null, BasicButton.ALIGNMENT_CENTER, ColorUtils.SECONDARY);
+ private final BasicButton button1 = new BasicButton(184, BasicButton.SIZE_32, "HELLO", SVGs.MICROSOFT_ICON, SVGs.AUDIO_PLAY, BasicButton.ALIGNMENT_CENTER, ColorUtils.SECONDARY_TRANSPARENT);
+ private final BasicButton button2 = new BasicButton(184, BasicButton.SIZE_36, "TESTING", SVGs.MICROSOFT_ICON, null, BasicButton.ALIGNMENT_LEFT, ColorUtils.PRIMARY_DESTRUCTIVE);
+ private final BasicButton button3 = new BasicButton(184, BasicButton.SIZE_40, "BOBFISH", SVGs.MICROSOFT_ICON, null, BasicButton.ALIGNMENT_CENTER, ColorUtils.SECONDARY_DESTRUCTIVE);
private final BasicButton button4 = new BasicButton(184, BasicButton.SIZE_48, "THIS is cool", null, SVGs.AUDIO_PLAY, BasicButton.ALIGNMENT_CENTER, 1);
private final BasicButton button5 = new BasicButton(184, BasicButton.SIZE_36, "dhwuai", SVGs.MICROSOFT_ICON, SVGs.AUDIO_PLAY, BasicButton.ALIGNMENT_JUSTIFIED, 1);
private final BasicButton button6 = new BasicButton(184, BasicButton.SIZE_32, "yes", SVGs.MICROSOFT_ICON, SVGs.AUDIO_PLAY, BasicButton.ALIGNMENT_RIGHT, 1);
private final BasicButton button7 = new BasicButton(184, BasicButton.SIZE_32, "HELLO", SVGs.MICROSOFT_ICON, SVGs.AUDIO_PLAY, BasicButton.ALIGNMENT_CENTER, 1);
- private final BasicButton button8 = new BasicButton(184, BasicButton.SIZE_40, "HELLO", SVGs.MICROSOFT_ICON, SVGs.AUDIO_PLAY, BasicButton.ALIGNMENT_CENTER, 1);
+ private final BasicButton button8 = new BasicButton(184, BasicButton.SIZE_40, "HELLO", SVGs.MICROSOFT_ICON, SVGs.AUDIO_PLAY, BasicButton.ALIGNMENT_CENTER, ColorUtils.SECONDARY_DESTRUCTIVE);
public HomePage() {
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 d024fb4..e3301bb 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModConfigPage.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModConfigPage.java
@@ -6,6 +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 java.util.ArrayList;
@@ -27,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, 0);
+ BasicButton button = new BasicButton(0, SIZE_32, category, BasicButton.ALIGNMENT_CENTER, ColorUtils.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 1065731..91b8d88 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModsPage.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModsPage.java
@@ -9,6 +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 java.util.ArrayList;
import java.util.List;
@@ -24,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, 0));
- modCategories.add(new BasicButton(80, 32, "Combat", BasicButton.ALIGNMENT_CENTER, 0));
- modCategories.add(new BasicButton(64, 32, "HUD", BasicButton.ALIGNMENT_CENTER, 0));
- modCategories.add(new BasicButton(104, 32, "Utility & QoL", BasicButton.ALIGNMENT_CENTER, 0));
- modCategories.add(new BasicButton(80, 32, "Hypixel", BasicButton.ALIGNMENT_CENTER, 0));
- modCategories.add(new BasicButton(80, 32, "Skyblock", BasicButton.ALIGNMENT_CENTER, 0));
- modCategories.add(new BasicButton(88, 32, "3rd Party", BasicButton.ALIGNMENT_CENTER, 0));
+ 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.get(0).setToggled(true);
int i = 0;
for(BasicButton button : modCategories) {