aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/polyfrost/oneconfig/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/gui')
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/OneConfigGui.java2
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java2
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigDropdown.java20
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/text/TextInputField.java4
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/pages/ModsPage.java3
5 files changed, 17 insertions, 14 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/OneConfigGui.java b/src/main/java/cc/polyfrost/oneconfig/gui/OneConfigGui.java
index be473f9..6c37229 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/OneConfigGui.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/OneConfigGui.java
@@ -169,7 +169,7 @@ public class OneConfigGui extends UScreen {
long end = System.nanoTime() - start;
String s = (" draw: " + end / 1000000f + "ms");
- RenderManager.drawText(vg, s, x + 1170, y + 790, OneConfigConfig.GRAY_300, 10f, Fonts.MEDIUM);
+ RenderManager.drawText(vg, s, x + 1170, y + 792, OneConfigConfig.GRAY_300, 10f, Fonts.MEDIUM);
if (currentColorSelector != null) {
currentColorSelector.draw(vg);
}
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 d3326a5..410f98f 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java
@@ -19,7 +19,7 @@ import java.util.ArrayList;
public class ModCard extends BasicElement {
private final Mod modData;
- private final BasicElement favoriteHitbox = new BasicElement(32, 32, -2, true);
+ private final BasicElement favoriteHitbox = new BasicElement(32, 32, ColorUtils.PRIMARY, true);
private boolean active, disabled, favorite;
private int colorGray = OneConfigConfig.GRAY_600;
private int colorPrimary = OneConfigConfig.PRIMARY_600;
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 9024516..4a986d7 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
@@ -51,12 +51,12 @@ public class ConfigDropdown extends BasicOption { // TODO: remove dividers and f
if (size == 1) {
RenderManager.drawRoundedRect(vg, x + 224, y, 256, 32, backgroundColor, 12);
RenderManager.drawText(vg, options[selected], x + 236, y + 16, OneConfigConfig.WHITE_80, 14f, Fonts.MEDIUM);
- RenderManager.drawRoundedRect(vg, x + 452, y + 4, 24, 24, OneConfigConfig.PRIMARY_600, 8);
+ RenderManager.drawRoundedRect(vg, x + 452, y + 4, 24, 24, hovered ? OneConfigConfig.PRIMARY_500 : OneConfigConfig.PRIMARY_600, 8);
RenderManager.drawSvg(vg, SVGs.DROPDOWN_LIST, x + 452, y + 4, 24, 24);
} else {
RenderManager.drawRoundedRect(vg, x + 352, y, 640, 32, backgroundColor, 12);
RenderManager.drawText(vg, options[selected], x + 364, y + 16, OneConfigConfig.WHITE_80, 14f, Fonts.MEDIUM);
- RenderManager.drawRoundedRect(vg, x + 964, y + 4, 24, 24, OneConfigConfig.PRIMARY_600, 8);
+ RenderManager.drawRoundedRect(vg, x + 964, y + 4, 24, 24, hovered ? OneConfigConfig.PRIMARY_500 : OneConfigConfig.PRIMARY_600, 8);
RenderManager.drawSvg(vg, SVGs.DROPDOWN_LIST, x + 964, y + 4, 24, 24);
}
RenderManager.setAlpha(vg, 1f);
@@ -82,13 +82,13 @@ public class ConfigDropdown extends BasicOption { // TODO: remove dividers and f
RenderManager.drawRoundedRect(vg, x + 224, y, 256, 32, backgroundColor, 12);
RenderManager.drawText(vg, options[selected], x + 236, y + 16, OneConfigConfig.WHITE_80, 14f, Fonts.MEDIUM);
if (hovered && Mouse.isButtonDown(0)) RenderManager.setAlpha(vg, 0.8f);
- RenderManager.drawRoundedRect(vg, x + 452, y + 4, 24, 24, OneConfigConfig.PRIMARY_600, 8);
+ RenderManager.drawRoundedRect(vg, x + 452, y + 4, 24, 24, hovered ? OneConfigConfig.PRIMARY_500 : OneConfigConfig.PRIMARY_600, 8);
RenderManager.drawSvg(vg, SVGs.DROPDOWN_LIST, x + 452, y + 4, 24, 24);
RenderManager.setAlpha(vg, 1f);
- RenderManager.drawRoundedRect(vg, x + 224, y + 48, 256, options.length * 32 + 8, OneConfigConfig.GRAY_700, 12);
- RenderManager.drawHollowRoundRect(vg, x + 223, y + 47, 258, options.length * 32 + 10, new Color(204, 204, 204, 77).getRGB(), 12, 1);
- int optionY = y + 52;
+ RenderManager.drawRoundedRect(vg, x + 224, y + 40, 256, options.length * 32 + 8, OneConfigConfig.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;
boolean optionHovered = InputUtils.isAreaHovered(x + 224, optionY, 252, 32);
@@ -114,13 +114,13 @@ public class ConfigDropdown extends BasicOption { // TODO: remove dividers and f
RenderManager.drawRoundedRect(vg, x + 352, y, 640, 32, backgroundColor, 12);
RenderManager.drawText(vg, options[selected], x + 364, y + 16, OneConfigConfig.WHITE_80, 14f, Fonts.MEDIUM);
if (hovered && Mouse.isButtonDown(0)) RenderManager.setAlpha(vg, 0.8f);
- RenderManager.drawRoundedRect(vg, x + 964, y + 4, 24, 24, OneConfigConfig.PRIMARY_600, 8);
+ RenderManager.drawRoundedRect(vg, x + 964, y + 4, 24, 24, hovered ? OneConfigConfig.PRIMARY_500 : OneConfigConfig.PRIMARY_600, 8);
RenderManager.drawSvg(vg, SVGs.DROPDOWN_LIST, x + 964, y + 4, 24, 24);
RenderManager.setAlpha(vg, 1f);
- RenderManager.drawRoundedRect(vg, x + 352, y + 48, 640, options.length * 32 + 8, OneConfigConfig.GRAY_700, 12);
- RenderManager.drawHollowRoundRect(vg, x + 351, y + 47, 642, options.length * 32 + 10, new Color(204, 204, 204, 77).getRGB(), 12, 1);
- int optionY = y + 52;
+ RenderManager.drawRoundedRect(vg, x + 352, y + 40, 640, options.length * 32 + 8, OneConfigConfig.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;
boolean optionHovered = InputUtils.isAreaHovered(x + 352, optionY, 640, 36);
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 ff82879..91a8ff2 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
@@ -103,9 +103,9 @@ public class TextInputField extends BasicElement {
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, OneConfigConfig.PRIMARY_600, 16);
+ RenderManager.drawRoundedRect(vg, x - 4, y - 4, width + 8, height + 8, errored ? OneConfigConfig.ERROR_600 : OneConfigConfig.PRIMARY_600, 16);
RenderManager.setAlpha(vg, 1f);
- RenderManager.drawHollowRoundRect(vg, x, y, width - 0.5f, height - 0.5f, OneConfigConfig.PRIMARY_600, 12f, 2f);
+ RenderManager.drawHollowRoundRect(vg, x, y, width - 0.5f, height - 0.5f, errored ? OneConfigConfig.ERROR_600 : OneConfigConfig.PRIMARY_600, 12f, 2f);
}
Scissor scissor = ScissorManager.scissor(vg, x, y, width, height);
super.update(x, y);
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 67a1124..cc087a3 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModsPage.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModsPage.java
@@ -65,10 +65,13 @@ public class ModsPage extends Page {
@Override
public int drawStatic(long vg, int x, int y) {
int iXCat = x + 16;
+ boolean selected = false;
for (BasicButton btn : modCategories) {
btn.draw(vg, iXCat, y + 16);
iXCat += btn.getWidth() + 8;
+ if(btn.isToggled()) selected = true;
}
+ if(!selected) modCategories.get(0).setToggled(true);
return 60;
}