diff options
author | Wyvest <45589059+Wyvest@users.noreply.github.com> | 2022-06-12 17:21:36 +0700 |
---|---|---|
committer | Wyvest <45589059+Wyvest@users.noreply.github.com> | 2022-06-12 17:21:36 +0700 |
commit | 636df2c2b3b8e4aa0de64cf3b9aa5c089afd70a9 (patch) | |
tree | 521d8bc2f6e6f307f62e12a3deb7a05f0f72213e /src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java | |
parent | da5288bd5c80611acfeb1ebe33af1860f27f23fc (diff) | |
parent | cf8b1a7f962ad3a9c31e6698fb7caf82aac42a18 (diff) | |
download | OneConfig-636df2c2b3b8e4aa0de64cf3b9aa5c089afd70a9.tar.gz OneConfig-636df2c2b3b8e4aa0de64cf3b9aa5c089afd70a9.tar.bz2 OneConfig-636df2c2b3b8e4aa0de64cf3b9aa5c089afd70a9.zip |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java')
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java | 5 |
1 files changed, 3 insertions, 2 deletions
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 e5d187f..ac12f07 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java @@ -44,6 +44,7 @@ public class ModCard extends BasicElement { @Override public void draw(long vg, int x, int y) { super.update(x, y); + String cleanName = modData.name.replaceAll("ยง.", ""); Scissor scissor = ScissorManager.scissor(vg, x, y, width, height); isHoveredMain = InputUtils.isAreaHovered(x, y, width, 87); @@ -57,11 +58,11 @@ public class ModCard extends BasicElement { 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.drawText(vg, modData.name, x + 122 - RenderManager.getTextWidth(vg, modData.name, 16, Fonts.MINECRAFT_BOLD) / 2f, y + 44, ColorUtils.setAlpha(Colors.WHITE, (int) (colorFrame.getAlpha() * 255)), 16, Fonts.MINECRAFT_BOLD); + RenderManager.drawText(vg, cleanName, x + Math.max(0, (244 - RenderManager.getTextWidth(vg, cleanName, 16, Fonts.MINECRAFT_BOLD))) / 2f, y + 44, ColorUtils.setAlpha(Colors.WHITE, (int) (colorFrame.getAlpha() * 255)), 16, Fonts.MINECRAFT_BOLD); } favoriteButton.draw(vg, x + 212, y + 87); favorite = favoriteButton.isToggled(); - RenderManager.drawText(vg, modData.name, x + 12, y + 103, ColorUtils.setAlpha(Colors.WHITE, (int) (colorToggle.getAlpha() * 255)), 14f, Fonts.MEDIUM); + RenderManager.drawText(vg, cleanName, x + 12, y + 103, ColorUtils.setAlpha(Colors.WHITE, (int) (colorToggle.getAlpha() * 255)), 14f, Fonts.MEDIUM); if (favorite) favoriteButton.setLeftIcon(SVGs.HEART_FILL); else favoriteButton.setLeftIcon(SVGs.HEART_OUTLINE); |