diff options
| author | hannibal2 <24389977+hannibal002@users.noreply.github.com> | 2023-03-04 03:03:33 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-04 13:03:33 +1100 |
| commit | 5a79ff410eb64e906c555751b32bef87cc7caee9 (patch) | |
| tree | f2c2e40a7cca305959b04d2dfba99ebc3e822949 /src/main/java/io/github/moulberry/notenoughupdates/miscfeatures | |
| parent | 5dd063fbba6bde64806a7620541dc2d9bdf42871 (diff) | |
| download | notenoughupdates-5a79ff410eb64e906c555751b32bef87cc7caee9.tar.gz notenoughupdates-5a79ff410eb64e906c555751b32bef87cc7caee9.tar.bz2 notenoughupdates-5a79ff410eb64e906c555751b32bef87cc7caee9.zip | |
I hate FontRenderer. (#612)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscfeatures')
9 files changed, 22 insertions, 92 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AbiphoneWarning.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AbiphoneWarning.java index 2c28bcd1..69b0a1b6 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AbiphoneWarning.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AbiphoneWarning.java @@ -120,29 +120,24 @@ public class AbiphoneWarning extends GuiElement { int neuLength = Minecraft.getMinecraft().fontRendererObj.getStringWidth("\u00a7lNEU"); Minecraft.getMinecraft().fontRendererObj.drawString( "\u00a7lNEU", - width / 2 + 90 - neuLength - 3, - height / 2 - 45 + 4, - 0xff000000 + width / 2 + 90 - neuLength - 3, height / 2 - 45 + 4, 0xff000000 ); - TextRenderUtils.drawStringCenteredScaledMaxWidth("Are you SURE?", Minecraft.getMinecraft().fontRendererObj, + TextRenderUtils.drawStringCenteredScaledMaxWidth( + "Are you SURE?", width / 2, height / 2 - 45 + 10, false, 170, 0xffff4040 ); String sellLine = "\u00a77[ \u00a7r" + contactName + "\u00a77 ]"; - TextRenderUtils.drawStringCenteredScaledMaxWidth(sellLine, Minecraft.getMinecraft().fontRendererObj, + TextRenderUtils.drawStringCenteredScaledMaxWidth( + sellLine, width / 2, height / 2 - 45 + 25, false, 170, 0xffffffff ); TextRenderUtils.drawStringCenteredScaledMaxWidth( "Continue removing this contact?", - Minecraft.getMinecraft().fontRendererObj, - width / 2, - height / 2 - 45 + 50, - false, - 170, - 0xffa0a0a0 + width / 2, height / 2 - 45 + 50, false, 170, 0xffa0a0a0 ); RenderUtils.drawFloatingRectDark(width / 2 - 43, height / 2 + 23, 40, 16, false); @@ -150,21 +145,11 @@ public class AbiphoneWarning extends GuiElement { TextRenderUtils.drawStringCenteredScaledMaxWidth( EnumChatFormatting.GREEN + "[Y]es", - Minecraft.getMinecraft().fontRendererObj, - width / 2 - 23, - height / 2 + 31, - true, - 36, - 0xff00ff00 + width / 2 - 23, height / 2 + 31, true, 36, 0xff00ff00 ); TextRenderUtils.drawStringCenteredScaledMaxWidth( EnumChatFormatting.RED + "[N]o", - Minecraft.getMinecraft().fontRendererObj, - width / 2 + 23, - height / 2 + 31, - true, - 36, - 0xffff0000 + width / 2 + 23, height / 2 + 31, true, 36, 0xffff0000 ); GlStateManager.popMatrix(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionBINWarning.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionBINWarning.java index 7282aad7..2b292aec 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionBINWarning.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionBINWarning.java @@ -183,7 +183,7 @@ public class AuctionBINWarning extends GuiElement { 0xff000000 ); - TextRenderUtils.drawStringCenteredScaledMaxWidth("Are you SURE?", Minecraft.getMinecraft().fontRendererObj, + TextRenderUtils.drawStringCenteredScaledMaxWidth("Are you SURE?", width / 2, height / 2 - 45 + 10, false, 170, 0xffff4040 ); @@ -203,19 +203,14 @@ public class AuctionBINWarning extends GuiElement { String sellLine = "\u00a77[ \u00a7r" + sellingName + "\u00a77 ]"; - TextRenderUtils.drawStringCenteredScaledMaxWidth(sellLine, Minecraft.getMinecraft().fontRendererObj, + TextRenderUtils.drawStringCenteredScaledMaxWidth(sellLine, width / 2, height / 2 - 45 + 25, false, 170, 0xffffffff ); TextRenderUtils.drawStringCenteredScaledMaxWidth( (lowestPrice > 0 ? "has a lowest BIN of \u00a76" + lowestPriceStr + "\u00a7r coins" : "\u00a7cWarning: No lowest BIN found!"), - Minecraft.getMinecraft().fontRendererObj, - width / 2, - height / 2 - 45 + 34, - false, - 170, - 0xffa0a0a0 + width / 2, height / 2 - 45 + 34, false, 170, 0xffa0a0a0 ); if (sellingPrice > lowestPrice * sellStackAmount) { @@ -229,22 +224,12 @@ public class AuctionBINWarning extends GuiElement { TextRenderUtils.drawStringCenteredScaledMaxWidth( "Continue selling it for", - Minecraft.getMinecraft().fontRendererObj, - width / 2, - height / 2 - 45 + 50, - false, - 170, - 0xffa0a0a0 + width / 2, height / 2 - 45 + 50, false, 170, 0xffa0a0a0 ); TextRenderUtils.drawStringCenteredScaledMaxWidth( "\u00a76" + sellingPriceStr + "\u00a7r coins?" + (lowestPrice > 0 ? "(\u00a7" + (isALoss ? "c-" : "a+") + (buyPercentage >= 100 ? buyPercentage - 100 : buyPercentage) + "%\u00a7r)" : ""), - Minecraft.getMinecraft().fontRendererObj, - width / 2, - height / 2 - 45 + 59, - false, - 170, - 0xffa0a0a0 + width / 2, height / 2 - 45 + 59, false, 170, 0xffa0a0a0 ); RenderUtils.drawFloatingRectDark(width / 2 - 43, height / 2 + 23, 40, 16, false); @@ -252,21 +237,11 @@ public class AuctionBINWarning extends GuiElement { TextRenderUtils.drawStringCenteredScaledMaxWidth( EnumChatFormatting.GREEN + "[Y]es", - Minecraft.getMinecraft().fontRendererObj, - width / 2 - 23, - height / 2 + 31, - true, - 36, - 0xff00ff00 + width / 2 - 23, height / 2 + 31, true, 36, 0xff00ff00 ); TextRenderUtils.drawStringCenteredScaledMaxWidth( EnumChatFormatting.RED + "[N]o", - Minecraft.getMinecraft().fontRendererObj, - width / 2 + 23, - height / 2 + 31, - true, - 36, - 0xffff0000 + width / 2 + 23, height / 2 + 31, true, 36, 0xffff0000 ); if (sellingTooltip != null) { @@ -277,15 +252,7 @@ public class AuctionBINWarning extends GuiElement { if (mouseX >= width / 2 - sellLineLength / 2 && mouseX <= width / 2 + sellLineLength / 2 && mouseY >= height / 2 - 45 + 20 && mouseY <= height / 2 - 45 + 30) { - Utils.drawHoveringText( - sellingTooltip, - mouseX, - mouseY, - width, - height, - -1, - Minecraft.getMinecraft().fontRendererObj - ); + Utils.drawHoveringText(sellingTooltip, mouseX, mouseY, width, height, -1); } } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionSortModeWarning.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionSortModeWarning.java index ed05ee79..e840acdf 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionSortModeWarning.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionSortModeWarning.java @@ -82,9 +82,7 @@ public class AuctionSortModeWarning { RenderUtils.drawFloatingRectDark(centerX - warningLength / 2 - 4, centerY - 6, warningLength + 8, 12, false ); - TextRenderUtils.drawStringCenteredScaledMaxWidth(warningText, Minecraft.getMinecraft().fontRendererObj, - centerX, centerY, true, chest.width / 2, 0xffffffff - ); + TextRenderUtils.drawStringCenteredScaledMaxWidth(warningText, centerX, centerY, true, chest.width / 2, 0xffffffff); GlStateManager.popMatrix(); } } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DungeonNpcProfitOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DungeonNpcProfitOverlay.java index 711d5235..c4b03b84 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DungeonNpcProfitOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DungeonNpcProfitOverlay.java @@ -221,15 +221,7 @@ public class DungeonNpcProfitOverlay { int mouseY = Utils.getMouseY(); if (Utils.isWithinRect(mouseX, mouseY, x, y, 160, 10)) - Utils.drawHoveringText( - chestProfit.lore, - mouseX, - mouseY, - width, - height, - -1, - Minecraft.getMinecraft().fontRendererObj - ); + Utils.drawHoveringText(chestProfit.lore, mouseX, mouseY, width, height, -1); } } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/EnchantingSolvers.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/EnchantingSolvers.java index 695c9851..a5c96e4a 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/EnchantingSolvers.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/EnchantingSolvers.java @@ -277,7 +277,7 @@ public class EnchantingSolvers { GlStateManager.disableDepth(); GlStateManager.enableBlend(); GlStateManager.disableLighting(); - Utils.drawStringScaled((solveIndex + 1) + "", Minecraft.getMinecraft().fontRendererObj, + Utils.drawStringScaled((solveIndex + 1) + "", x + 8.5f - w / 2f, y + 8.5f - 4, true, 0xffc0c0c0, 1f ); return true; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java index 800e25b1..b43b0e78 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java @@ -174,11 +174,7 @@ public class FishingHelper { Utils.drawStringCentered( String.format("%.02fs", seconds), - Minecraft.getMinecraft().fontRendererObj, - 0, - -baseHeight - Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT, - false, - color + 0, -baseHeight - Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT, false, color ); } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/MiningStuff.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/MiningStuff.java index 2cbd3125..9217dcae 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/MiningStuff.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/MiningStuff.java @@ -152,12 +152,7 @@ public class MiningStuff { if (alpha > 10) { TextRenderUtils.drawStringCenteredScaledMaxWidth( "Titanium has spawned nearby!", - Minecraft.getMinecraft().fontRendererObj, - 0, - 0, - true, - width / 4 - 20, - colour | (colour << 8) | (colour << 16) | (alpha << 24) + 0, 0, true, width / 4 - 20, colour | (colour << 8) | (colour << 16) | (alpha << 24) ); } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SunTzu.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SunTzu.java index 736d5058..8d1c06f3 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SunTzu.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SunTzu.java @@ -96,7 +96,6 @@ public class SunTzu { int height = Utils.renderStringTrimWidth( EnumChatFormatting.YELLOW + getQuote(), - Minecraft.getMinecraft().fontRendererObj, true, sr.getScaledWidth() / 2 - 100, 5, diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/entityviewer/EntityViewer.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/entityviewer/EntityViewer.java index 2f091304..1e7dc319 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/entityviewer/EntityViewer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/entityviewer/EntityViewer.java @@ -25,7 +25,6 @@ import com.google.gson.JsonObject; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.util.Utils; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.OpenGlHelper; @@ -208,7 +207,6 @@ public class EntityViewer extends GuiScreen { @Override public void drawScreen(int mouseX, int mouseY, float partialTicks) { drawDefaultBackground(); - FontRenderer fontRenderer = Minecraft.getMinecraft().fontRendererObj; this.guiLeft = (width - this.xSize) / 2; this.guiTop = (height - this.ySize) / 2; @@ -216,7 +214,7 @@ public class EntityViewer extends GuiScreen { Minecraft.getMinecraft().getTextureManager().bindTexture(BACKGROUND); drawTexturedModalRect(guiLeft, guiTop, 0, 0, this.xSize, this.ySize); - Utils.drawStringScaledMaxWidth(label, fontRenderer, guiLeft + 10, guiTop + 10, false, 100, 0xFF00FF); + Utils.drawStringScaledMaxWidth(label, guiLeft + 10, guiTop + 10, false, 100, 0xFF00FF); renderEntity(entity, guiLeft + 90, guiTop + 75, mouseX, mouseY); } |
