From 89c1cc675b0412cfb93e1916836f52368236c76f Mon Sep 17 00:00:00 2001 From: haykam821 <24855774+haykam821@users.noreply.github.com> Date: Sun, 28 Apr 2024 11:26:28 -0400 Subject: [PATCH] Consistently draw text with shadows --- .../terraformersmc/modmenu/gui/ModsScreen.java | 16 ++++++++-------- .../modmenu/gui/widget/entries/ModListEntry.java | 2 +- .../terraformersmc/modmenu/util/DrawingUtil.java | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/terraformersmc/modmenu/gui/ModsScreen.java b/src/main/java/com/terraformersmc/modmenu/gui/ModsScreen.java index c2d6b3332..e356722ce 100644 --- a/src/main/java/com/terraformersmc/modmenu/gui/ModsScreen.java +++ b/src/main/java/com/terraformersmc/modmenu/gui/ModsScreen.java @@ -313,17 +313,17 @@ public void render(DrawContext DrawContext, int mouseX, int mouseY, float delta) if (!ModMenuConfig.CONFIG_MODE.getValue() && this.updateFiltersX()) { if (this.filterOptionsShown) { if (!ModMenuConfig.SHOW_LIBRARIES.getValue() || textRenderer.getWidth(fullModCount) <= this.filtersX - 5) { - DrawContext.drawText(textRenderer, fullModCount.asOrderedText(), this.searchBoxX, 52, 0xFFFFFF, false); + DrawContext.drawText(textRenderer, fullModCount.asOrderedText(), this.searchBoxX, 52, 0xFFFFFF, true); } else { - DrawContext.drawText(textRenderer, computeModCountText(false).asOrderedText(), this.searchBoxX, 46, 0xFFFFFF, false); - DrawContext.drawText(textRenderer, computeLibraryCountText().asOrderedText(), this.searchBoxX, 57, 0xFFFFFF, false); + DrawContext.drawText(textRenderer, computeModCountText(false).asOrderedText(), this.searchBoxX, 46, 0xFFFFFF, true); + DrawContext.drawText(textRenderer, computeLibraryCountText().asOrderedText(), this.searchBoxX, 57, 0xFFFFFF, true); } } else { if (!ModMenuConfig.SHOW_LIBRARIES.getValue() || textRenderer.getWidth(fullModCount) <= modList.getWidth() - 5) { - DrawContext.drawText(textRenderer, fullModCount.asOrderedText(), this.searchBoxX, 52, 0xFFFFFF, false); + DrawContext.drawText(textRenderer, fullModCount.asOrderedText(), this.searchBoxX, 52, 0xFFFFFF, true); } else { - DrawContext.drawText(textRenderer, computeModCountText(false).asOrderedText(), this.searchBoxX, 46, 0xFFFFFF, false); - DrawContext.drawText(textRenderer, computeLibraryCountText().asOrderedText(), this.searchBoxX, 57, 0xFFFFFF, false); + DrawContext.drawText(textRenderer, computeModCountText(false).asOrderedText(), this.searchBoxX, 46, 0xFFFFFF, true); + DrawContext.drawText(textRenderer, computeLibraryCountText().asOrderedText(), this.searchBoxX, 57, 0xFFFFFF, true); } } } @@ -347,7 +347,7 @@ public void render(DrawContext DrawContext, int mouseX, int mouseY, float delta) StringVisitable ellipsis = StringVisitable.plain("..."); trimmedName = StringVisitable.concat(textRenderer.trimToWidth(name, maxNameWidth - textRenderer.getWidth(ellipsis)), ellipsis); } - DrawContext.drawText(textRenderer, Language.getInstance().reorder(trimmedName), x + imageOffset, RIGHT_PANE_Y + 1, 0xFFFFFF, false); + DrawContext.drawText(textRenderer, Language.getInstance().reorder(trimmedName), x + imageOffset, RIGHT_PANE_Y + 1, 0xFFFFFF, true); if (mouseX > x + imageOffset && mouseY > RIGHT_PANE_Y + 1 && mouseY < RIGHT_PANE_Y + 1 + textRenderer.fontHeight && mouseX < x + imageOffset + textRenderer.getWidth(trimmedName)) { this.setTooltip(ModMenuScreenTexts.modIdTooltip(mod.getId())); } @@ -359,7 +359,7 @@ public void render(DrawContext DrawContext, int mouseX, int mouseY, float delta) modBadgeRenderer.draw(DrawContext, mouseX, mouseY); } if (mod.isReal()) { - DrawContext.drawText(textRenderer, mod.getPrefixedVersion(), x + imageOffset, RIGHT_PANE_Y + 2 + lineSpacing, 0x808080, false); + DrawContext.drawText(textRenderer, mod.getPrefixedVersion(), x + imageOffset, RIGHT_PANE_Y + 2 + lineSpacing, 0x808080, true); } String authors; List names = mod.getAuthors(); diff --git a/src/main/java/com/terraformersmc/modmenu/gui/widget/entries/ModListEntry.java b/src/main/java/com/terraformersmc/modmenu/gui/widget/entries/ModListEntry.java index 5641ed4d9..3d8e98886 100644 --- a/src/main/java/com/terraformersmc/modmenu/gui/widget/entries/ModListEntry.java +++ b/src/main/java/com/terraformersmc/modmenu/gui/widget/entries/ModListEntry.java @@ -67,7 +67,7 @@ public void render(DrawContext DrawContext, int index, int y, int x, int rowWidt StringVisitable ellipsis = StringVisitable.plain("..."); trimmedName = StringVisitable.concat(font.trimToWidth(name, maxNameWidth - font.getWidth(ellipsis)), ellipsis); } - DrawContext.drawText(font, Language.getInstance().reorder(trimmedName), x + iconSize + 3, y + 1, 0xFFFFFF, false); + DrawContext.drawText(font, Language.getInstance().reorder(trimmedName), x + iconSize + 3, y + 1, 0xFFFFFF, true); var updateBadgeXOffset = 0; if (ModMenuConfig.UPDATE_CHECKER.getValue() && !ModMenuConfig.DISABLE_UPDATE_CHECKER.getValue().contains(modId) && (mod.hasUpdate() || mod.getChildHasUpdate())) { UpdateAvailableBadge.renderBadge(DrawContext, x + iconSize + 3 + font.getWidth(name) + 2, y); diff --git a/src/main/java/com/terraformersmc/modmenu/util/DrawingUtil.java b/src/main/java/com/terraformersmc/modmenu/util/DrawingUtil.java index 79168842a..40b4fd3f8 100644 --- a/src/main/java/com/terraformersmc/modmenu/util/DrawingUtil.java +++ b/src/main/java/com/terraformersmc/modmenu/util/DrawingUtil.java @@ -49,7 +49,7 @@ public static void drawWrappedString(DrawContext DrawContext, String string, int int width = CLIENT.textRenderer.getWidth(line); x1 += (float) (wrapWidth - width); } - DrawContext.drawText(CLIENT.textRenderer, line, x1, y + i * CLIENT.textRenderer.fontHeight, color, false); + DrawContext.drawText(CLIENT.textRenderer, line, x1, y + i * CLIENT.textRenderer.fontHeight, color, true); } }