aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/cc')
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/SideBar.java16
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicButton.java5
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/utils/ColorUtils.java2
3 files changed, 19 insertions, 4 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/SideBar.java b/src/main/java/cc/polyfrost/oneconfig/gui/SideBar.java
index 6f474c7..2c2abd8 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/SideBar.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/SideBar.java
@@ -1,8 +1,11 @@
package cc.polyfrost.oneconfig.gui;
+import cc.polyfrost.oneconfig.config.OneConfigConfig;
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.utils.GuiUtils;
@@ -32,12 +35,12 @@ public class SideBar {
buttons.get(2).setClickAction(new ModsPage());
HUDButton.setClickAction(() -> GuiUtils.displayScreen(new HudGui()));
CloseButton.setClickAction(GuiUtils::closeScreen);
- for (BasicButton button : buttons) button.setToggleable(true);
}
public void draw(long vg, int x, int y) {
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);
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);
@@ -47,5 +50,16 @@ public class SideBar {
buttons.get(8).draw(vg, x + 16, y + 448);
HUDButton.draw(vg, x + 16, y + 704);
CloseButton.draw(vg, x + 16, y + 748);
+
+ for (BasicButton button : buttons) {
+ if (button.isClicked()) {
+ button.setColorPalette(PRIMARY);
+ for (BasicButton button1 : buttons) {
+ if (button.equals(button1)) continue;
+ button1.setColorPalette(TERTIARY);
+ }
+ break;
+ }
+ }
}
}
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 c2bda06..f8edf78 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicButton.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicButton.java
@@ -7,6 +7,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.utils.ColorUtils;
+import org.lwjgl.input.Mouse;
public class BasicButton extends BasicElement {
@@ -181,11 +182,11 @@ public class BasicButton extends BasicElement {
return;
}
if (!toggleable) {
- currentColor = ColorUtils.getColor(currentColor, colorPalette, hovered, clicked);
+ currentColor = ColorUtils.getColor(currentColor, colorPalette, hovered, hovered && Mouse.isButtonDown(0));
} else {
if (toggled) {
currentColor = ColorUtils.smoothColor(currentColor, OneConfigConfig.GRAY_500, OneConfigConfig.PRIMARY_600, true, 30f);
- } else currentColor = ColorUtils.getColor(currentColor, colorPalette, hovered, clicked);
+ } else currentColor = ColorUtils.getColor(currentColor, colorPalette, hovered, hovered && Mouse.isButtonDown(0));
}
}
diff --git a/src/main/java/cc/polyfrost/oneconfig/utils/ColorUtils.java b/src/main/java/cc/polyfrost/oneconfig/utils/ColorUtils.java
index 88653fc..7095869 100644
--- a/src/main/java/cc/polyfrost/oneconfig/utils/ColorUtils.java
+++ b/src/main/java/cc/polyfrost/oneconfig/utils/ColorUtils.java
@@ -82,7 +82,7 @@ public final class ColorUtils {
case PRIMARY_DESTRUCTIVE:
return getColorComponents(color, splitColor(OneConfigConfig.ERROR_700), splitColor(OneConfigConfig.ERROR_600), hover, 100f);
case SECONDARY_DESTRUCTIVE:
- return getColorComponents(color, splitColor(OneConfigConfig.GRAY_500), splitColor(OneConfigConfig.ERROR_800), hover, 100f);
+ return getColorComponents(color, splitColor(OneConfigConfig.ERROR_800), splitColor(OneConfigConfig.GRAY_500), !hover, 100f);
case TERTIARY_DESTRUCTIVE:
return getColorComponents(color, splitColor(OneConfigConfig.WHITE_90), splitColor(OneConfigConfig.ERROR_300), hover, 100f);
}