From 045ca00486e62c89a4da5f880f6f52016e4dd14a Mon Sep 17 00:00:00 2001 From: Wyvest <45589059+Wyvest@users.noreply.github.com> Date: Mon, 25 Jul 2022 22:01:01 +0900 Subject: fix: stop using internal asset classes everywhere (#69) * fix: stop using internal asset classes everywhere new: add wrapper classes for NanoVG rendering and rename original Image wrapper to OneImage * I love regex Co-authored-by: DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> --- .../cc/polyfrost/oneconfig/gui/elements/config/ConfigColorElement.java | 2 +- .../java/cc/polyfrost/oneconfig/gui/elements/config/ConfigTextBox.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src/main/java/cc/polyfrost/oneconfig/gui/elements/config') diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigColorElement.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigColorElement.java index a3b45bf..ce6b378 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigColorElement.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigColorElement.java @@ -84,7 +84,7 @@ public class ConfigColorElement extends BasicOption { element.update(x1 + 416, y); RenderManager.drawHollowRoundRect(vg, x1 + 415, y - 1, 64, 32, Colors.GRAY_300, 12f, 2f); - RenderManager.drawRoundImage(vg, Images.ALPHA_GRID, x1 + 420, y + 4, 56, 24, 8f); + RenderManager.drawRoundImage(vg, Images.ALPHA_GRID.filePath, x1 + 420, y + 4, 56, 24, 8f); RenderManager.drawRoundedRect(vg, x1 + 420, y + 4, 56, 24, color.getRGB(), 8f); if (element.isClicked() && !open) { open = true; diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigTextBox.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigTextBox.java index 3d9602b..4f7d0f5 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigTextBox.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigTextBox.java @@ -6,6 +6,7 @@ import cc.polyfrost.oneconfig.config.elements.BasicOption; import cc.polyfrost.oneconfig.gui.elements.text.TextInputField; import cc.polyfrost.oneconfig.platform.Platform; import cc.polyfrost.oneconfig.renderer.RenderManager; +import cc.polyfrost.oneconfig.renderer.SVG; import cc.polyfrost.oneconfig.renderer.font.Fonts; import cc.polyfrost.oneconfig.internal.assets.SVGs; import cc.polyfrost.oneconfig.utils.InputUtils; @@ -46,7 +47,7 @@ public class ConfigTextBox extends BasicOption { textField.draw(vg, x + (size == 1 ? 224 : 352), y); if (secure) { - SVGs icon = textField.getPassword() ? SVGs.EYE_OFF : SVGs.EYE; + final SVG icon = textField.getPassword() ? SVGs.EYE_OFF : SVGs.EYE; boolean hovered = InputUtils.isAreaHovered(x + 967, y + 7, 18, 18) && isEnabled(); int color = hovered ? Colors.WHITE : Colors.WHITE_80; if (hovered && InputUtils.isClicked()) textField.setPassword(!textField.getPassword()); -- cgit