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 --- .../polyfrost/oneconfig/lwjgl/RenderManager.java | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'src/main/java/cc/polyfrost/oneconfig/lwjgl') diff --git a/src/main/java/cc/polyfrost/oneconfig/lwjgl/RenderManager.java b/src/main/java/cc/polyfrost/oneconfig/lwjgl/RenderManager.java index a2da805..153fc52 100644 --- a/src/main/java/cc/polyfrost/oneconfig/lwjgl/RenderManager.java +++ b/src/main/java/cc/polyfrost/oneconfig/lwjgl/RenderManager.java @@ -1,6 +1,7 @@ package cc.polyfrost.oneconfig.lwjgl; import cc.polyfrost.oneconfig.config.OneConfigConfig; +import cc.polyfrost.oneconfig.config.data.InfoType; import cc.polyfrost.oneconfig.gui.OneConfigGui; import cc.polyfrost.oneconfig.lwjgl.font.FontManager; import cc.polyfrost.oneconfig.lwjgl.font.Fonts; @@ -344,6 +345,40 @@ public final class RenderManager { drawSvg(vg, svg.filePath, x, y, width, height, color); } + public static void drawInfo(long vg, InfoType type, float x, float y, float size) { + SVGs icon = null; + int colorOuter = 0; + int colorInner = 0; + switch (type) { + case INFO: + icon = SVGs.INFO_CIRCLE; + colorOuter = OneConfigConfig.GRAY_400; + colorInner = OneConfigConfig.GRAY_300; + break; + case SUCCESS: + icon = SVGs.CHECK_CIRCLE; + colorOuter = OneConfigConfig.SUCCESS_700; + colorInner = OneConfigConfig.SUCCESS_600; + break; + case WARNING: + icon = SVGs.WARNING; + colorOuter = OneConfigConfig.WARNING_600; + colorInner = OneConfigConfig.WARNING_500; + break; + case ERROR: + icon = SVGs.ERROR; + colorOuter = OneConfigConfig.ERROR_700; + colorInner = OneConfigConfig.ERROR_600; + break; + } + float centerX = x + size / 2f; + float centerY = y + size / 2f; + drawCircle(vg, centerX, centerY, size / 2, colorOuter); + drawCircle(vg, centerX, centerY, size / 2 - size / 12, colorInner); + float iconSize = size / 1.75f; + drawSvg(vg, icon, centerX - iconSize / 2f, centerY - iconSize / 2f, iconSize, iconSize); + } + /*public static void drawSvg(long vg, String filename) { if (ImageLoader.INSTANCE.loadSVGImage(filename)) { try { -- cgit