From e35f31f24ecc4030087733522f9c62bc39624984 Mon Sep 17 00:00:00 2001 From: DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> Date: Sat, 4 Jun 2022 14:25:58 +0200 Subject: OC-68 --- .../java/cc/polyfrost/oneconfig/gui/elements/ModCard.java | 12 ++++++------ src/main/java/cc/polyfrost/oneconfig/lwjgl/font/Fonts.java | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/main/java/cc/polyfrost') diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java index 21d2004..e8d4b2d 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java @@ -11,7 +11,6 @@ import cc.polyfrost.oneconfig.lwjgl.RenderManager; import cc.polyfrost.oneconfig.lwjgl.font.Fonts; import cc.polyfrost.oneconfig.lwjgl.image.SVGs; import cc.polyfrost.oneconfig.utils.color.ColorPalette; -import cc.polyfrost.oneconfig.utils.color.ColorUtils; import cc.polyfrost.oneconfig.utils.InputUtils; import net.minecraftforge.client.ClientCommandHandler; import net.minecraftforge.fml.common.ModMetadata; @@ -24,8 +23,8 @@ public class ModCard extends BasicElement { private final Mod modData; private final BasicButton favoriteButton = new BasicButton(32, 32, SVGs.HEART_OUTLINE, BasicButton.ALIGNMENT_CENTER, ColorPalette.TERTIARY); private boolean active, disabled, favorite; - private final ColorAnimation colorGray = new ColorAnimation(ColorPalette.SECONDARY); - private final ColorAnimation colorPrimary = new ColorAnimation(ColorPalette.PRIMARY); + private final ColorAnimation colorFrame = new ColorAnimation(ColorPalette.SECONDARY); + private final ColorAnimation colorToggle = new ColorAnimation(ColorPalette.PRIMARY); private boolean isHoveredMain = false; public ModCard(@NotNull Mod mod, boolean active, boolean disabled, boolean favorite) { @@ -45,15 +44,15 @@ public class ModCard extends BasicElement { isHoveredMain = InputUtils.isAreaHovered(x, y, width, 87); boolean isHoveredSecondary = InputUtils.isAreaHovered(x, y + 87, width - 32, 32) && !disabled; if (disabled) RenderManager.setAlpha(vg, 0.5f); - RenderManager.drawRoundedRectVaried(vg, x, y, width, 87, colorGray.getColor(isHoveredMain, isHoveredMain && Mouse.isButtonDown(0)), 12f, 12f, 0f, 0f); - RenderManager.drawRoundedRectVaried(vg, x, y + 87, width, 32, colorPrimary.getColor(isHoveredSecondary, isHoveredSecondary && Mouse.isButtonDown(0)), 0f, 0f, 12f, 12f); + RenderManager.drawRoundedRectVaried(vg, x, y, width, 87, colorFrame.getColor(isHoveredMain, isHoveredMain && Mouse.isButtonDown(0)), 12f, 12f, 0f, 0f); + RenderManager.drawRoundedRectVaried(vg, x, y + 87, width, 32, colorToggle.getColor(isHoveredSecondary, isHoveredSecondary && Mouse.isButtonDown(0)), 0f, 0f, 12f, 12f); RenderManager.drawLine(vg, x, y + 86, x + width, y + 86, 2, OneConfigConfig.GRAY_300); if (modData.modIcon != null) { if (modData.modIcon.toLowerCase().endsWith(".svg")) RenderManager.drawSvg(vg, modData.modIcon, x + 98, y + 19, 48, 48); else RenderManager.drawImage(vg, modData.modIcon, x + 98, y + 19, 48, 48); } else { - RenderManager.drawSvg(vg, SVGs.BOX, x + 98, y + 19, 48, 48); + RenderManager.drawText(vg, modData.name, x + 122 - RenderManager.getTextWidth(vg, modData.name, 24, Fonts.MINECRAFT) / 2f, y + 44, OneConfigConfig.WHITE, 24, Fonts.MINECRAFT); } favoriteButton.draw(vg, x + 212, y + 87); favorite = favoriteButton.isToggled(); @@ -69,6 +68,7 @@ public class ModCard extends BasicElement { if (!active & disabled) toggled = false; active = toggled; + colorToggle.setPalette(active ? ColorPalette.PRIMARY : ColorPalette.SECONDARY); RenderManager.setAlpha(vg, 1f); } diff --git a/src/main/java/cc/polyfrost/oneconfig/lwjgl/font/Fonts.java b/src/main/java/cc/polyfrost/oneconfig/lwjgl/font/Fonts.java index ca6c971..03352a9 100644 --- a/src/main/java/cc/polyfrost/oneconfig/lwjgl/font/Fonts.java +++ b/src/main/java/cc/polyfrost/oneconfig/lwjgl/font/Fonts.java @@ -4,8 +4,8 @@ public enum Fonts { BOLD(new Font("inter-bold", "/assets/oneconfig/font/Bold.otf")), SEMIBOLD(new Font("inter-semibold", "/assets/oneconfig/font/SemiBold.otf")), MEDIUM(new Font("inter-medium", "/assets/oneconfig/font/Medium.otf")), - REGULAR(new Font("inter-regular", "/assets/oneconfig/font/Regular.otf")); - + REGULAR(new Font("inter-regular", "/assets/oneconfig/font/Regular.otf")), + MINECRAFT(new Font("mc-regular", "/assets/oneconfig/font/Minecraft.otf")); public final Font font; Fonts(Font font) { -- cgit