From fe8261cf7c10af90c0154633a6a8f18b3e5bfb12 Mon Sep 17 00:00:00 2001 From: DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> Date: Sun, 1 May 2022 11:23:06 +0200 Subject: icons sidebar, categories in config, fix some other issues --- .../gui/elements/config/ConfigCheckbox.java | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/main/java/io/polyfrost/oneconfig/gui/elements/config') diff --git a/src/main/java/io/polyfrost/oneconfig/gui/elements/config/ConfigCheckbox.java b/src/main/java/io/polyfrost/oneconfig/gui/elements/config/ConfigCheckbox.java index 6832236..93f4378 100644 --- a/src/main/java/io/polyfrost/oneconfig/gui/elements/config/ConfigCheckbox.java +++ b/src/main/java/io/polyfrost/oneconfig/gui/elements/config/ConfigCheckbox.java @@ -26,10 +26,10 @@ public class ConfigCheckbox extends BasicOption { toggled = (boolean) get(); } catch (IllegalAccessException ignored) { } - boolean hover = InputUtils.isAreaHovered(x, y, 24, 24); + boolean hover = InputUtils.isAreaHovered(x, y + 4, 24, 24); boolean clicked = InputUtils.isClicked() && hover; - if(clicked) { + if (clicked) { toggled = !toggled; try { set(toggled); @@ -38,18 +38,18 @@ public class ConfigCheckbox extends BasicOption { e.printStackTrace(); } } - if(percentOn != 1f) { // performance - RenderManager.drawRoundedRect(vg, x, y, 24, 24, color, 6f); - RenderManager.drawHollowRoundRect(vg, x, y, 23.5f, 23.5f, OneConfigConfig.GRAY_300, 6f, 1f); // the 0.5f is to make it look better ok + 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 } color = ColorUtils.smoothColor(color, OneConfigConfig.GRAY_600, OneConfigConfig.GRAY_400, hover, 40f); - RenderManager.drawString(vg, name, x + 32, y + 14, OneConfigConfig.WHITE_90, 18f, Fonts.INTER_MEDIUM); + RenderManager.drawString(vg, name, x + 32, y + 17, OneConfigConfig.WHITE_90, 18f, Fonts.INTER_MEDIUM); percentOn = MathUtils.clamp(MathUtils.easeOut(percentOn, toggled ? 1f : 0f, 5f)); - if(percentOn == 0f) return; - if(percentOn != 1f) { - RenderManager.drawImage(vg, "/assets/oneconfig/textures/check.png", x, y, 24, 24, new Color(1f, 1f, 1f, percentOn).getRGB()); + if (percentOn == 0f) return; + if (percentOn != 1f) { + RenderManager.drawImage(vg, "/assets/oneconfig/textures/check.png", x, y + 4, 24, 24, new Color(1f, 1f, 1f, percentOn).getRGB()); } else { // performance, that color could cause havoc am I right definitely - RenderManager.drawImage(vg, "/assets/oneconfig/textures/check.png", x, y, 24, 24); + RenderManager.drawImage(vg, "/assets/oneconfig/textures/check.png", x, y + 4, 24, 24); } } -- cgit