diff options
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/gui/elements')
17 files changed, 54 insertions, 54 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicButton.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicButton.java index a84c290..f97cde2 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicButton.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicButton.java @@ -101,7 +101,7 @@ public class BasicButton extends BasicElement { contentWidth += iconSize + xSpacing; } if (text != null) { - RenderManager.drawString(vg, text, middle - contentWidth / 2 + (icon1 == null ? 0 : iconSize + xSpacing), middleYText, textColor, fontSize, Fonts.MEDIUM); + RenderManager.drawText(vg, text, middle - contentWidth / 2 + (icon1 == null ? 0 : iconSize + xSpacing), middleYText, textColor, fontSize, Fonts.MEDIUM); } if (icon1 != null) { RenderManager.drawSvg(vg, icon1, middle - contentWidth / 2, middleYIcon, iconSize, iconSize); @@ -114,7 +114,7 @@ public class BasicButton extends BasicElement { } if (alignment == ALIGNMENT_JUSTIFIED) { if (text != null) { - RenderManager.drawString(vg, text, middle - contentWidth / 2, middleYText, textColor, fontSize, Fonts.MEDIUM); + RenderManager.drawText(vg, text, middle - contentWidth / 2, middleYText, textColor, fontSize, Fonts.MEDIUM); } if (icon1 != null) { RenderManager.drawSvg(vg, icon1, x + xSpacing, middleYIcon, iconSize, iconSize); @@ -132,7 +132,7 @@ public class BasicButton extends BasicElement { contentWidth += iconSize + xSpacing; } if (text != null) { - RenderManager.drawString(vg, text, x + contentWidth, middleYText, textColor, fontSize, Fonts.MEDIUM); + RenderManager.drawText(vg, text, x + contentWidth, middleYText, textColor, fontSize, Fonts.MEDIUM); contentWidth += RenderManager.getTextWidth(vg, text, fontSize, Fonts.MEDIUM) + xSpacing; } if (icon2 != null) { @@ -150,7 +150,7 @@ public class BasicButton extends BasicElement { } if (text != null) { contentWidth -= RenderManager.getTextWidth(vg, text, fontSize, Fonts.MEDIUM); - RenderManager.drawString(vg, text, x + contentWidth, middleYText, textColor, fontSize, Fonts.MEDIUM); + RenderManager.drawText(vg, text, x + contentWidth, middleYText, textColor, fontSize, Fonts.MEDIUM); contentWidth -= xSpacing; } if (icon1 != null) { diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/ColorSelector.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/ColorSelector.java index c734ccb..6c8845c 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/ColorSelector.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/ColorSelector.java @@ -105,7 +105,7 @@ public class ColorSelector { int height = 768; RenderManager.drawHollowRoundRect(vg, x - 3, y - 3, width + 4, height + 4, new Color(204, 204, 204, 77).getRGB(), 20f, 2f); RenderManager.drawRoundedRect(vg, x, y, width, height, OneConfigConfig.GRAY_800, 20f); - RenderManager.drawString(vg, "Color Selector", x + 16, y + 32, OneConfigConfig.WHITE_90, 18f, Fonts.SEMIBOLD); + RenderManager.drawText(vg, "Color Selector", x + 16, y + 32, OneConfigConfig.WHITE_90, 18f, Fonts.SEMIBOLD); if (!closeBtn.isHovered()) RenderManager.setAlpha(vg, 0.8f); closeBtn.draw(vg, x + 368, y + 16); RenderManager.drawSvg(vg, SVGs.X_CIRCLE, x + 368, y + 16, 32, 32, closeBtn.isHovered() ? OneConfigConfig.ERROR_600 : -1); @@ -172,17 +172,17 @@ public class ColorSelector { } percentMove = MathUtils.easeOut(percentMove, mode, 100f); - RenderManager.drawString(vg, "HSB Box", x + 55, y + 81, OneConfigConfig.WHITE, 12f, Fonts.MEDIUM); - RenderManager.drawString(vg, "Color Wheel", x + 172.5f, y + 81, OneConfigConfig.WHITE, 12f, Fonts.MEDIUM); - RenderManager.drawString(vg, "Chroma", x + 313, y + 81, OneConfigConfig.WHITE, 12f, Fonts.MEDIUM); + RenderManager.drawText(vg, "HSB Box", x + 55, y + 81, OneConfigConfig.WHITE, 12f, Fonts.MEDIUM); + RenderManager.drawText(vg, "Color Wheel", x + 172.5f, y + 81, OneConfigConfig.WHITE, 12f, Fonts.MEDIUM); + RenderManager.drawText(vg, "Chroma", x + 313, y + 81, OneConfigConfig.WHITE, 12f, Fonts.MEDIUM); - RenderManager.drawString(vg, "Saturation", x + 224, y + 560, OneConfigConfig.WHITE_80, 12f, Fonts.MEDIUM); + RenderManager.drawText(vg, "Saturation", x + 224, y + 560, OneConfigConfig.WHITE_80, 12f, Fonts.MEDIUM); saturationInput.draw(vg, x + 312, y + 544); - RenderManager.drawString(vg, "Brightness", x + 16, y + 599, OneConfigConfig.WHITE_80, 12f, Fonts.MEDIUM); + RenderManager.drawText(vg, "Brightness", x + 16, y + 599, OneConfigConfig.WHITE_80, 12f, Fonts.MEDIUM); brightnessInput.draw(vg, x + 104, y + 584); - RenderManager.drawString(vg, "Alpha (%)", x + 224, y + 599, OneConfigConfig.WHITE_80, 12f, Fonts.MEDIUM); + RenderManager.drawText(vg, "Alpha (%)", x + 224, y + 599, OneConfigConfig.WHITE_80, 12f, Fonts.MEDIUM); alphaInput.draw(vg, x + 312, y + 584); - RenderManager.drawString(vg, color.getDataBit() == -1 ? "Hex (RGB):" : "Color Code:", x + 16, y + 641, OneConfigConfig.WHITE_80, 12f, Fonts.MEDIUM); + RenderManager.drawText(vg, color.getDataBit() == -1 ? "Hex (RGB):" : "Color Code:", x + 16, y + 641, OneConfigConfig.WHITE_80, 12f, Fonts.MEDIUM); hexInput.draw(vg, x + 104, y + 624); copyBtn.draw(vg, x + 204, y + 624); @@ -218,14 +218,14 @@ public class ColorSelector { if (mode == 0) { topSlider.setColor(color); topSlider.draw(vg, x + 16, y + 424); - RenderManager.drawString(vg, "Hue", x + 16, y + 560, OneConfigConfig.WHITE_80, 12f, Fonts.MEDIUM); + RenderManager.drawText(vg, "Hue", x + 16, y + 560, OneConfigConfig.WHITE_80, 12f, Fonts.MEDIUM); hueInput.draw(vg, x + 104, y + 544); } if (mode == 2) { speedSlider.draw(vg, x + 60, y + 424); - RenderManager.drawString(vg, "SLOW", x + 16, y + 429, OneConfigConfig.WHITE_80, 12f, Fonts.REGULAR); - RenderManager.drawString(vg, "FAST", x + 370, y + 429, OneConfigConfig.WHITE_80, 12f, Fonts.REGULAR); - RenderManager.drawString(vg, "Speed (s)", x + 16, y + 560, OneConfigConfig.WHITE_80, 12f, Fonts.MEDIUM); + RenderManager.drawText(vg, "SLOW", x + 16, y + 429, OneConfigConfig.WHITE_80, 12f, Fonts.REGULAR); + RenderManager.drawText(vg, "FAST", x + 370, y + 429, OneConfigConfig.WHITE_80, 12f, Fonts.REGULAR); + RenderManager.drawText(vg, "Speed (s)", x + 16, y + 560, OneConfigConfig.WHITE_80, 12f, Fonts.MEDIUM); hueInput.draw(vg, x + 104, y + 544); if (!speedSlider.isDragging()) { color.setChromaSpeed((int) Math.abs(speedSlider.getValue() - 29)); @@ -262,7 +262,7 @@ public class ColorSelector { color.setHSBA(dragging ? angle : color.getHue(), saturation, (int) (topSlider.getValue() / 360 * 100), (int) ((bottomSlider.getValue() / 100f) * 255)); topSlider.setGradient(OneConfigConfig.BLACK, color.getRGBMax(true)); topSlider.setImage(null); - RenderManager.drawString(vg, "Hue", x + 16, y + 560, OneConfigConfig.WHITE_80, 12f, Fonts.MEDIUM); + RenderManager.drawText(vg, "Hue", x + 16, y + 560, OneConfigConfig.WHITE_80, 12f, Fonts.MEDIUM); hueInput.draw(vg, x + 104, y + 544); topSlider.draw(vg, x + 16, y + 424); break; 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 cc8c54d..d3326a5 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java @@ -53,7 +53,7 @@ public class ModCard extends BasicElement { favoriteHitbox.currentColor = ColorUtils.getColor(favoriteHitbox.currentColor, favoriteHitbox.colorPalette, favoriteHitbox.hovered, favoriteHitbox.clicked); RenderManager.drawRoundedRectVaried(vg, x + 212, y + 87, 32, 32, favoriteHitbox.currentColor, 0f, 0f, 12f, 0f); favorite = favoriteHitbox.isToggled(); - RenderManager.drawString(vg, modData.name, x + 12, y + 103, OneConfigConfig.WHITE, 14f, Fonts.MEDIUM); + RenderManager.drawText(vg, modData.name, x + 12, y + 103, OneConfigConfig.WHITE, 14f, Fonts.MEDIUM); if (favorite) { RenderManager.drawSvg(vg, SVGs.HEART_FILL, x + 220, y + 95, 16, 16); } else { diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigButton.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigButton.java index 3ad7f51..a10e3a0 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigButton.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigButton.java @@ -28,7 +28,7 @@ public class ConfigButton extends BasicOption { public void draw(long vg, int x, int y) { button.disable(!isEnabled()); if (!isEnabled()) RenderManager.setAlpha(vg, 0.5f); - RenderManager.drawString(vg, name, x, y + 17, OneConfigConfig.WHITE, 14f, Fonts.MEDIUM); + RenderManager.drawText(vg, name, x, y + 17, OneConfigConfig.WHITE, 14f, Fonts.MEDIUM); button.draw(vg, x + (size == 1 ? 352 : 736), y); RenderManager.setAlpha(vg, 1f); } diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigCheckbox.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigCheckbox.java index f8c34e1..f7e0f90 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigCheckbox.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigCheckbox.java @@ -45,7 +45,7 @@ public class ConfigCheckbox extends BasicOption { RenderManager.drawRoundedRect(vg, x, y + 4, 24, 24, color, 6f); RenderManager.drawHollowRoundRect(vg, x, y + 4, 23.5f, 23.5f, OneConfigConfig.GRAY_300, 6f, 1f); // the 0.5f is to make it look better ok } - RenderManager.drawString(vg, name, x + 32, y + 17, OneConfigConfig.WHITE_90, 14f, Fonts.MEDIUM); + RenderManager.drawText(vg, name, x + 32, y + 17, OneConfigConfig.WHITE_90, 14f, Fonts.MEDIUM); percentOn = MathUtils.clamp(MathUtils.easeOut(percentOn, toggled ? 1f : 0f, 50f)); if (percentOn != 0 && percentOn != 1f) { RenderManager.drawRoundedRect(vg, x, y + 4, 24, 24, ColorUtils.setAlpha(OneConfigConfig.PRIMARY_500, (int) (percentOn * 255)), 6f); 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 5ecaa9e..0d420e8 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 @@ -35,7 +35,7 @@ public class ConfigColorElement extends BasicOption { } catch (IllegalAccessException e) { return; } - RenderManager.drawString(vg, name, x, y + 16, OneConfigConfig.WHITE_90, 14f, Fonts.MEDIUM); + RenderManager.drawText(vg, name, x, y + 16, OneConfigConfig.WHITE_90, 14f, Fonts.MEDIUM); if (!hexField.isToggled()) hexField.setInput("#" + color.getHex()); hexField.setErrored(false); if (hexField.isToggled()) { diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigDropdown.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigDropdown.java index a36a829..9024516 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigDropdown.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigDropdown.java @@ -26,7 +26,7 @@ public class ConfigDropdown extends BasicOption { // TODO: remove dividers and f @Override public void draw(long vg, int x, int y) { if (!isEnabled()) RenderManager.setAlpha(vg, 0.5f); - RenderManager.drawString(vg, name, x, y + 16, OneConfigConfig.WHITE_90, 14f, Fonts.MEDIUM); + RenderManager.drawText(vg, name, x, y + 16, OneConfigConfig.WHITE_90, 14f, Fonts.MEDIUM); boolean hovered; if (size == 1) hovered = InputUtils.isAreaHovered(x + 224, y, 256, 32) && isEnabled(); @@ -50,12 +50,12 @@ public class ConfigDropdown extends BasicOption { // TODO: remove dividers and f if (hovered && Mouse.isButtonDown(0)) RenderManager.setAlpha(vg, 0.8f); if (size == 1) { RenderManager.drawRoundedRect(vg, x + 224, y, 256, 32, backgroundColor, 12); - RenderManager.drawString(vg, options[selected], x + 236, y + 16, OneConfigConfig.WHITE_80, 14f, Fonts.MEDIUM); + RenderManager.drawText(vg, options[selected], x + 236, y + 16, OneConfigConfig.WHITE_80, 14f, Fonts.MEDIUM); RenderManager.drawRoundedRect(vg, x + 452, y + 4, 24, 24, OneConfigConfig.PRIMARY_600, 8); RenderManager.drawSvg(vg, SVGs.DROPDOWN_LIST, x + 452, y + 4, 24, 24); } else { RenderManager.drawRoundedRect(vg, x + 352, y, 640, 32, backgroundColor, 12); - RenderManager.drawString(vg, options[selected], x + 364, y + 16, OneConfigConfig.WHITE_80, 14f, Fonts.MEDIUM); + RenderManager.drawText(vg, options[selected], x + 364, y + 16, OneConfigConfig.WHITE_80, 14f, Fonts.MEDIUM); RenderManager.drawRoundedRect(vg, x + 964, y + 4, 24, 24, OneConfigConfig.PRIMARY_600, 8); RenderManager.drawSvg(vg, SVGs.DROPDOWN_LIST, x + 964, y + 4, 24, 24); } @@ -80,7 +80,7 @@ public class ConfigDropdown extends BasicOption { // TODO: remove dividers and f if (hovered && Mouse.isButtonDown(0)) RenderManager.setAlpha(vg, 0.8f); if (size == 1) { RenderManager.drawRoundedRect(vg, x + 224, y, 256, 32, backgroundColor, 12); - RenderManager.drawString(vg, options[selected], x + 236, y + 16, OneConfigConfig.WHITE_80, 14f, Fonts.MEDIUM); + RenderManager.drawText(vg, options[selected], x + 236, y + 16, OneConfigConfig.WHITE_80, 14f, Fonts.MEDIUM); if (hovered && Mouse.isButtonDown(0)) RenderManager.setAlpha(vg, 0.8f); RenderManager.drawRoundedRect(vg, x + 452, y + 4, 24, 24, OneConfigConfig.PRIMARY_600, 8); RenderManager.drawSvg(vg, SVGs.DROPDOWN_LIST, x + 452, y + 4, 24, 24); @@ -107,12 +107,12 @@ public class ConfigDropdown extends BasicOption { // TODO: remove dividers and f InputUtils.blockClicks(false); } - RenderManager.drawString(vg, option, x + 240, optionY + 18, color, 14, Fonts.MEDIUM); + RenderManager.drawText(vg, option, x + 240, optionY + 18, color, 14, Fonts.MEDIUM); optionY += 32; } } else { RenderManager.drawRoundedRect(vg, x + 352, y, 640, 32, backgroundColor, 12); - RenderManager.drawString(vg, options[selected], x + 364, y + 16, OneConfigConfig.WHITE_80, 14f, Fonts.MEDIUM); + RenderManager.drawText(vg, options[selected], x + 364, y + 16, OneConfigConfig.WHITE_80, 14f, Fonts.MEDIUM); if (hovered && Mouse.isButtonDown(0)) RenderManager.setAlpha(vg, 0.8f); RenderManager.drawRoundedRect(vg, x + 964, y + 4, 24, 24, OneConfigConfig.PRIMARY_600, 8); RenderManager.drawSvg(vg, SVGs.DROPDOWN_LIST, x + 964, y + 4, 24, 24); @@ -131,7 +131,7 @@ public class ConfigDropdown extends BasicOption { // TODO: remove dividers and f color = OneConfigConfig.WHITE; } - RenderManager.drawString(vg, option, x + 368, optionY + 18, color, 14, Fonts.MEDIUM); + RenderManager.drawText(vg, option, x + 368, optionY + 18, color, 14, Fonts.MEDIUM); if (optionHovered && InputUtils.isClicked(true)) { try { diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigDualOption.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigDualOption.java index f8aa0d6..76601f7 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigDualOption.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigDualOption.java @@ -35,15 +35,15 @@ public class ConfigDualOption extends BasicOption { if (!isEnabled()) RenderManager.setAlpha(vg, 0.5f); boolean hoveredLeft = InputUtils.isAreaHovered(x + 226, y, 128, 32) && isEnabled(); boolean hoveredRight = InputUtils.isAreaHovered(x + 354, y, 128, 32) && isEnabled(); - RenderManager.drawString(vg, name, x, y + 16, OneConfigConfig.WHITE_90, 14f, Fonts.MEDIUM); + RenderManager.drawText(vg, name, x, y + 16, OneConfigConfig.WHITE_90, 14f, Fonts.MEDIUM); RenderManager.drawRoundedRect(vg, x + 226, y, 256, 32, OneConfigConfig.GRAY_600, 12f); int x1 = (int) (x + 228 + (percentMove * 128)); RenderManager.drawRoundedRect(vg, x1, y + 2, 124, 28, OneConfigConfig.PRIMARY_600, 10f); if (!hoveredLeft && isEnabled()) RenderManager.setAlpha(vg, 0.8f); - RenderManager.drawString(vg, left, x + 290 - RenderManager.getTextWidth(vg, left, 12f, Fonts.MEDIUM) / 2, y + 17, OneConfigConfig.WHITE, 12f, Fonts.MEDIUM); + RenderManager.drawText(vg, left, x + 290 - RenderManager.getTextWidth(vg, left, 12f, Fonts.MEDIUM) / 2, y + 17, OneConfigConfig.WHITE, 12f, Fonts.MEDIUM); if (isEnabled()) RenderManager.setAlpha(vg, 1f); if (!hoveredRight && isEnabled()) RenderManager.setAlpha(vg, 0.8f); - RenderManager.drawString(vg, right, x + 418 - RenderManager.getTextWidth(vg, right, 12f, Fonts.MEDIUM) / 2, y + 17, OneConfigConfig.WHITE, 12f, Fonts.MEDIUM); + RenderManager.drawText(vg, right, x + 418 - RenderManager.getTextWidth(vg, right, 12f, Fonts.MEDIUM) / 2, y + 17, OneConfigConfig.WHITE, 12f, Fonts.MEDIUM); RenderManager.setAlpha(vg, 1); if ((hoveredLeft && toggled || hoveredRight && !toggled) && InputUtils.isClicked()) { diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigHeader.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigHeader.java index c7c7ea9..445424e 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigHeader.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigHeader.java @@ -18,7 +18,7 @@ public class ConfigHeader extends BasicOption { @Override public void draw(long vg, int x, int y) { Scissor scissor = ScissorManager.scissor(vg, x, y, size == 1 ? 480 : 992, 32); - RenderManager.drawString(vg, name, x, y + 17, OneConfigConfig.WHITE_90, 24, Fonts.MEDIUM); + RenderManager.drawText(vg, name, x, y + 17, OneConfigConfig.WHITE_90, 24, Fonts.MEDIUM); ScissorManager.resetScissor(vg, scissor); } 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 6564e9e..6a6c4f2 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 @@ -22,7 +22,7 @@ public class ConfigInfo extends BasicOption { public void draw(long vg, int x, int y) { Scissor scissor = ScissorManager.scissor(vg, x, y, size == 1 ? 448 : 960, 32); RenderManager.drawInfo(vg, type, x, y + 4, 24); - RenderManager.drawString(vg, name, x + 32, y + 18, OneConfigConfig.WHITE_90, 14, Fonts.MEDIUM); + RenderManager.drawText(vg, name, x + 32, y + 18, OneConfigConfig.WHITE_90, 14, Fonts.MEDIUM); ScissorManager.resetScissor(vg, scissor); } diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigKeyBind.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigKeyBind.java index cb90165..78ef0b3 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigKeyBind.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigKeyBind.java @@ -26,7 +26,7 @@ public class ConfigKeyBind extends BasicOption { @Override public void draw(long vg, int x, int y) { if (!isEnabled()) RenderManager.setAlpha(vg, 0.5f); - RenderManager.drawString(vg, name, x, y + 17, OneConfigConfig.WHITE, 14f, Fonts.MEDIUM); + RenderManager.drawText(vg, name, x, y + 17, OneConfigConfig.WHITE, 14f, Fonts.MEDIUM); OneKeyBind keyBind = getKeyBind(); String text = keyBind.getDisplay(); button.disable(!isEnabled()); diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigPageButton.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigPageButton.java index 61729b9..ec13566 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigPageButton.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigPageButton.java @@ -36,9 +36,9 @@ public class ConfigPageButton extends BasicOption { if (!isEnabled()) RenderManager.setAlpha(vg, 0.5f); RenderManager.drawRoundedRect(vg, x - 16, y, 1024, height, backgroundColor, 20); - RenderManager.drawString(vg, name, x + 10, y + 32, OneConfigConfig.WHITE_90, 24, Fonts.MEDIUM); + RenderManager.drawText(vg, name, x + 10, y + 32, OneConfigConfig.WHITE_90, 24, Fonts.MEDIUM); if (!description.equals("")) - RenderManager.drawString(vg, name, x + 10, y + 70, OneConfigConfig.WHITE_90, 14, Fonts.MEDIUM); + RenderManager.drawText(vg, name, x + 10, y + 70, OneConfigConfig.WHITE_90, 14, Fonts.MEDIUM); RenderManager.drawSvg(vg, SVGs.CHEVRON_RIGHT, x + 981f, y + (description.equals("") ? 20f : 36f), 13, 22); if (clicked) OneConfigGui.INSTANCE.openPage(new ModConfigPage(page)); diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigSlider.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigSlider.java index e5b3d90..08761fb 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigSlider.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigSlider.java @@ -67,7 +67,7 @@ public class ConfigSlider extends BasicOption { } if (!inputField.isToggled()) inputField.setCurrentValue(value); - RenderManager.drawString(vg, name, x, y + 17, OneConfigConfig.WHITE_90, 14f, Fonts.MEDIUM); + RenderManager.drawText(vg, name, x, y + 17, OneConfigConfig.WHITE_90, 14f, Fonts.MEDIUM); RenderManager.drawRoundedRect(vg, x + 352, y + 13, 512, 6, OneConfigConfig.GRAY_300, 4f); RenderManager.drawRoundedRect(vg, x + 352, y + 13, xCoordinate - x - 352, 6, OneConfigConfig.PRIMARY_500, 4f); if (step > 0) { diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigSwitch.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigSwitch.java index f802680..61c0dd5 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigSwitch.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigSwitch.java @@ -35,7 +35,7 @@ public class ConfigSwitch extends BasicOption { if (percentOn != 0) RenderManager.drawRoundedRect(vg, x, y + 4, 42, 24, ColorUtils.setAlpha(colorEnabled, (int) (255 * percentOn)), 12f); RenderManager.drawRoundedRect(vg, x2, y + 7, 18, 18, OneConfigConfig.WHITE, 9f); - RenderManager.drawString(vg, name, x + 50, y + 17, OneConfigConfig.WHITE, 14f, Fonts.MEDIUM); + RenderManager.drawText(vg, name, x + 50, y + 17, OneConfigConfig.WHITE, 14f, Fonts.MEDIUM); if (InputUtils.isAreaClicked(x, y, 42, 32) && isEnabled()) { toggled = !toggled; 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 4fa57b8..966a85e 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 @@ -27,7 +27,7 @@ public class ConfigTextBox extends BasicOption { public void draw(long vg, int x, int y) { if (!isEnabled()) RenderManager.setAlpha(vg, 0.5f); textField.disable(!isEnabled()); - RenderManager.drawString(vg, name, x, y + 16, OneConfigConfig.WHITE_90, 14, Fonts.MEDIUM); + RenderManager.drawText(vg, name, x, y + 16, OneConfigConfig.WHITE_90, 14, Fonts.MEDIUM); try { String value = (String) get(); diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigUniSelector.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigUniSelector.java index f11a3fd..ce048c9 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigUniSelector.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigUniSelector.java @@ -39,15 +39,15 @@ public class ConfigUniSelector extends BasicOption { } if (!isEnabled()) RenderManager.setAlpha(vg, 0.5f); String option = options[selected] + " " + (selected + 1) + "/" + options.length; - RenderManager.drawString(vg, name, x, y + 16, OneConfigConfig.WHITE_90, 14f, Fonts.MEDIUM); + RenderManager.drawText(vg, name, x, y + 16, OneConfigConfig.WHITE_90, 14f, Fonts.MEDIUM); Scissor scissor = ScissorManager.scissor(vg, x + 256, y, 192, 32); if (previous == -1) { - RenderManager.drawString(vg, option, x + 352 - RenderManager.getTextWidth(vg, option, 14f, Fonts.MEDIUM) / 2f, y + 15, OneConfigConfig.WHITE_90, 14f, Fonts.MEDIUM); + RenderManager.drawText(vg, option, x + 352 - RenderManager.getTextWidth(vg, option, 14f, Fonts.MEDIUM) / 2f, y + 15, OneConfigConfig.WHITE_90, 14f, Fonts.MEDIUM); } else { String prevOption = options[previous] + " " + (previous + 1) + "/" + options.length; - RenderManager.drawString(vg, selected < previous ? prevOption : option, x + 352 - RenderManager.getTextWidth(vg, selected < previous ? prevOption : option, 14f, Fonts.MEDIUM) / 2f + 192 * percentMove, y + 15, OneConfigConfig.WHITE_90, 14f, Fonts.MEDIUM); - RenderManager.drawString(vg, selected < previous ? option : prevOption, x + 352 - RenderManager.getTextWidth(vg, selected < previous ? option : prevOption, 14f, Fonts.MEDIUM) / 2f - 192 * (1 - percentMove), y + 15, OneConfigConfig.WHITE_90, 14f, Fonts.MEDIUM); + RenderManager.drawText(vg, selected < previous ? prevOption : option, x + 352 - RenderManager.getTextWidth(vg, selected < previous ? prevOption : option, 14f, Fonts.MEDIUM) / 2f + 192 * percentMove, y + 15, OneConfigConfig.WHITE_90, 14f, Fonts.MEDIUM); + RenderManager.drawText(vg, selected < previous ? option : prevOption, x + 352 - RenderManager.getTextWidth(vg, selected < previous ? option : prevOption, 14f, Fonts.MEDIUM) / 2f - 192 * (1 - percentMove), y + 15, OneConfigConfig.WHITE_90, 14f, Fonts.MEDIUM); } ScissorManager.resetScissor(vg, scissor); diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/text/TextInputField.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/text/TextInputField.java index a7dbf62..ff82879 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/text/TextInputField.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/text/TextInputField.java @@ -127,18 +127,18 @@ public class TextInputField extends BasicElement { float width; StringBuilder s = new StringBuilder(); if (multiLine) { - wrappedText = TextUtils.wrapText(vg, input, this.width - 24, 14f, Fonts.REGULAR); + wrappedText = TextUtils.wrapText(vg, input, this.width - 24, 14f, Fonts.REGULAR.font); lines = wrappedText.size(); if (!toggled) caretPos = wrappedText.get(wrappedText.size() - 1).length(); int caretLine = (int) MathUtils.clamp(getCaretLine(caretPos), 0, wrappedText.size() - 1); - width = RenderManager.getTextWidth(vg, wrappedText.get(caretLine).substring(0, getLineCaret(caretPos, caretLine)), 14f, Fonts.REGULAR); + width = RenderManager.getTextWidth(vg, wrappedText.get(caretLine).substring(0, getLineCaret(caretPos, caretLine)), 14f, Fonts.REGULAR.font); } else if (!password) { - width = RenderManager.getTextWidth(vg, input.substring(0, caretPos), 14f, Fonts.REGULAR); + width = RenderManager.getTextWidth(vg, input.substring(0, caretPos), 14f, Fonts.REGULAR.font); } else { for (int i = 0; i < input.length(); i++) { s.append("*"); } - width = RenderManager.getTextWidth(vg, s.substring(0, caretPos), 14f, Fonts.REGULAR); + width = RenderManager.getTextWidth(vg, s.substring(0, caretPos), 14f, Fonts.REGULAR.font); } if (hovered) { while (Mouse.next()) { @@ -222,11 +222,11 @@ public class TextInputField extends BasicElement { if (input.equals("")) { if (multiLine) { - RenderManager.drawString(vg, defaultText, x + 12, y + 16, color, 14f, Fonts.REGULAR); + RenderManager.drawText(vg, defaultText, x + 12, y + 16, color, 14f, Fonts.REGULAR); } else if (!centered) { - RenderManager.drawString(vg, defaultText, x + 12, y + height / 2f + 1, color, 14f, Fonts.REGULAR); + RenderManager.drawText(vg, defaultText, x + 12, y + height / 2f + 1, color, 14f, Fonts.REGULAR); } else { - RenderManager.drawString(vg, defaultText, x + this.width / 2f - halfTextWidth, y + height / 2f + 1, color, 14f, Fonts.REGULAR); + RenderManager.drawText(vg, defaultText, x + this.width / 2f - halfTextWidth, y + height / 2f + 1, color, 14f, Fonts.REGULAR); } } @@ -234,16 +234,16 @@ public class TextInputField extends BasicElement { if (multiLine) { int textY = y + 20; for (String line : wrappedText) { - RenderManager.drawString(vg, line, x + 12, textY, color, 14f, Fonts.REGULAR); + RenderManager.drawText(vg, line, x + 12, textY, color, 14f, Fonts.REGULAR); textY += 24; } } else if (!centered) { - RenderManager.drawString(vg, input, x + 12, y + height / 2f + 1, color, 14f, Fonts.REGULAR); + RenderManager.drawText(vg, input, x + 12, y + height / 2f + 1, color, 14f, Fonts.REGULAR); } else { - RenderManager.drawString(vg, input, x + this.width / 2f - halfTextWidth, y + height / 2f + 1, color, 14f, Fonts.REGULAR); + RenderManager.drawText(vg, input, x + this.width / 2f - halfTextWidth, y + height / 2f + 1, color, 14f, Fonts.REGULAR); } } else { - RenderManager.drawString(vg, s.toString(), x + 12, y + height / 2f + 1, color, 14f, Fonts.REGULAR); + RenderManager.drawText(vg, s.toString(), x + 12, y + height / 2f + 1, color, 14f, Fonts.REGULAR); } ScissorManager.resetScissor(vg, scissor); } catch ( |