diff options
author | nextdaydelivery <79922345+nxtdaydelivery@users.noreply.github.com> | 2022-05-01 12:36:56 +0100 |
---|---|---|
committer | nextdaydelivery <79922345+nxtdaydelivery@users.noreply.github.com> | 2022-05-01 12:36:56 +0100 |
commit | 9694fd2bf0aa538652b9c65472c5f2017efce195 (patch) | |
tree | a8c9dba6e4dd5359dd01942cba47fd54c84d452b /src/main/java/io/polyfrost/oneconfig/gui/elements/config | |
parent | 60f1c29872465a25be4f2c4ca8c5eb1abf69f988 (diff) | |
parent | fb9d2f2633c185faba162d85e4ae71c2a347fbb5 (diff) | |
download | OneConfig-9694fd2bf0aa538652b9c65472c5f2017efce195.tar.gz OneConfig-9694fd2bf0aa538652b9c65472c5f2017efce195.tar.bz2 OneConfig-9694fd2bf0aa538652b9c65472c5f2017efce195.zip |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src/main/java/io/polyfrost/oneconfig/gui/elements/config')
-rw-r--r-- | src/main/java/io/polyfrost/oneconfig/gui/elements/config/ConfigCheckbox.java | 20 |
1 files changed, 10 insertions, 10 deletions
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); } } |