From 9521fb420ad494a9cbe0d3c439976fc842fa9194 Mon Sep 17 00:00:00 2001 From: DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> Date: Sun, 15 May 2022 20:29:49 +0200 Subject: new scaling logic and also some other stuff --- .../oneconfig/gui/elements/config/ConfigInfo.java | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'src/main/java/cc/polyfrost/oneconfig/gui/elements') diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigInfo.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigInfo.java index 68ebf37..7810d57 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigInfo.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigInfo.java @@ -13,30 +13,17 @@ import cc.polyfrost.oneconfig.lwjgl.scissor.ScissorManager; import java.lang.reflect.Field; public class ConfigInfo extends BasicOption { - private SVGs image; + private InfoType type; public ConfigInfo(Field field, Object parent, String name, int size, InfoType type) { super(field, parent, name, size); - switch (type) { - case INFO: - image = SVGs.INFO_CIRCLE; - break; - case SUCCESS: - image = SVGs.CHECK_CIRCLE; - break; - case WARNING: - image = SVGs.WARNING; - break; - case ERROR: - image = SVGs.ERROR; - break; - } + this.type = type; } @Override public void draw(long vg, int x, int y) { Scissor scissor = ScissorManager.scissor(vg, x, y, size == 1 ? 448 : 960, 32); - RenderManager.drawSvg(vg, image, x, y + 4, 24, 24); + RenderManager.drawInfo(vg, type, x, y + 4, 24); RenderManager.drawString(vg, name, x + 32, y + 18, OneConfigConfig.WHITE_90, 14, Fonts.MEDIUM); ScissorManager.resetScissor(vg, scissor); } -- cgit