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 | |
| 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')
74 files changed, 756 insertions, 2160 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java index 927b5e76..ce7b21b2 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java @@ -1665,7 +1665,7 @@ public class NEUOverlay extends Gui { buttonXSize, ySize, 1 - leftPressed, leftPressed, 1 - leftPressed, leftPressed ); GlStateManager.bindTexture(0); - Utils.drawStringCenteredScaled(EnumChatFormatting.BOLD + "Prev", fr, + Utils.drawStringCenteredScaled(EnumChatFormatting.BOLD + "Prev", leftSide - 1 + buttonXSize * 300 / 480f + leftPressed, top + ySize / 2f + leftPressed, false, (int) (buttonXSize * 240 / 480f), Color.BLACK.getRGB() @@ -1684,7 +1684,7 @@ public class NEUOverlay extends Gui { buttonXSize, ySize, 1 - rightPressed, rightPressed, 1 - rightPressed, rightPressed ); GlStateManager.bindTexture(0); - Utils.drawStringCenteredScaled(EnumChatFormatting.BOLD + "Next", fr, + Utils.drawStringCenteredScaled(EnumChatFormatting.BOLD + "Next", rightSide + 1 - buttonXSize * 300 / 480f + rightPressed, top + ySize / 2f + rightPressed, false, (int) (buttonXSize * 240 / 480f), Color.BLACK.getRGB() @@ -1699,7 +1699,7 @@ public class NEUOverlay extends Gui { new Color(50, 50, 50).getRGB() ); drawRect(leftSide + buttonXSize + 3, top + 1, rightSide - buttonXSize - 3, top + ySize - 1, fg.getRGB()); - Utils.drawStringCenteredScaledMaxWidth(pageText, fr, (leftSide + rightSide) / 2, + Utils.drawStringCenteredScaledMaxWidth(pageText, (leftSide + rightSide) / 2, top + ySize / 2f, false, strMaxLen, Color.BLACK.getRGB() ); } @@ -1845,8 +1845,6 @@ public class NEUOverlay extends Gui { } GlStateManager.enableDepth(); - FontRenderer fr = Minecraft.getMinecraft().fontRendererObj; - Utils.resetGuiScale(); Utils.pushGuiScale(NotEnoughUpdates.INSTANCE.config.itemlist.paneGuiScale); @@ -2238,7 +2236,7 @@ public class NEUOverlay extends Gui { textToDisplay = text; } if (textToDisplay != null) { - Utils.drawHoveringText(textToDisplay, mouseX, mouseY, width, height, -1, fr); + Utils.drawHoveringText(textToDisplay, mouseX, mouseY, width, height, -1); textToDisplay = null; } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/auction/CustomAH.java b/src/main/java/io/github/moulberry/notenoughupdates/auction/CustomAH.java index 07ec4a59..e1ccdef7 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/auction/CustomAH.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/auction/CustomAH.java @@ -580,6 +580,7 @@ public class CustomAH extends Gui { } List<String> tooltipToRender = null; + int black = Color.BLACK.getRGB(); if (Minecraft.getMinecraft().currentScreen instanceof GuiChest) { resetCurrAucIdTimer = System.currentTimeMillis(); GuiChest auctionView = (GuiChest) Minecraft.getMinecraft().currentScreen; @@ -620,9 +621,7 @@ public class CustomAH extends Gui { endsInStr = EnumChatFormatting.DARK_PURPLE + prettyTime( auctionViewEndsIn + lastGuiScreenSwitch - System.currentTimeMillis()); } - Utils.drawStringCenteredScaledMaxWidth(endsInStr, Minecraft.getMinecraft().fontRendererObj, - auctionViewLeft + 39, guiTop + 20, false, 70, 4210752 - ); + Utils.drawStringCenteredScaledMaxWidth(endsInStr, auctionViewLeft + 39, guiTop + 20, false, 70, 4210752); } Utils.drawItemStack(leftStack, auctionViewLeft + 31, guiTop + 100); @@ -790,9 +789,7 @@ public class CustomAH extends Gui { } } - Utils.drawStringCenteredScaledMaxWidth(containerName, Minecraft.getMinecraft().fontRendererObj, - auctionViewLeft + 39, guiTop + 10, false, 70, 4210752 - ); + Utils.drawStringCenteredScaledMaxWidth(containerName, auctionViewLeft + 39, guiTop + 10, false, 70, 4210752); } else if (isEditingPrice()) { hasPopup = true; resetCurrAucIdTimer = System.currentTimeMillis(); @@ -810,9 +807,7 @@ public class CustomAH extends Gui { this.drawTexturedModalRect(auctionViewLeft, guiTop, 0, 0, 96, 99); priceField.drawTextBox(); - Utils.drawStringCenteredScaledMaxWidth("Bid Amount", Minecraft.getMinecraft().fontRendererObj, - auctionViewLeft + 39, guiTop + 10, false, 70, 4210752 - ); + Utils.drawStringCenteredScaledMaxWidth("Bid Amount", auctionViewLeft + 39, guiTop + 10, false, 70, 4210752); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); Minecraft.getMinecraft().getTextureManager().bindTexture(auction_view_buttons); @@ -822,22 +817,11 @@ public class CustomAH extends Gui { this.drawTexturedModalRect(auctionViewLeft + 16 + 34, guiTop + 50, 0, 16, 30, 16); this.drawTexturedModalRect(auctionViewLeft + 16, guiTop + 68, 0, 32, 64, 16); - FontRenderer fr = Minecraft.getMinecraft().fontRendererObj; - Utils.drawStringCentered("x2", fr, auctionViewLeft + 16 + 15, guiTop + 32 + 8, false, - Color.BLACK.getRGB() - ); - Utils.drawStringCentered("+50%", fr, auctionViewLeft + 16 + 34 + 15, guiTop + 32 + 8, false, - Color.BLACK.getRGB() - ); - Utils.drawStringCentered("+25%", fr, auctionViewLeft + 16 + 15, guiTop + 50 + 8, false, - Color.BLACK.getRGB() - ); - Utils.drawStringCentered("+10%", fr, auctionViewLeft + 16 + 34 + 15, guiTop + 50 + 8, false, - Color.BLACK.getRGB() - ); - Utils.drawStringCentered("Set Amount", fr, auctionViewLeft + 16 + 32, guiTop + 68 + 8, false, - Color.BLACK.getRGB() - ); + Utils.drawStringCentered("x2", auctionViewLeft + 16 + 15, guiTop + 32 + 8, false, black); + Utils.drawStringCentered("+50%", auctionViewLeft + 16 + 34 + 15, guiTop + 32 + 8, false, black); + Utils.drawStringCentered("+25%", auctionViewLeft + 16 + 15, guiTop + 50 + 8, false, black); + Utils.drawStringCentered("+10%", auctionViewLeft + 16 + 34 + 15, guiTop + 50 + 8, false, black); + Utils.drawStringCentered("Set Amount", auctionViewLeft + 16 + 32, guiTop + 68 + 8, false, black); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GuiEditSign editSign = (GuiEditSign) Minecraft.getMinecraft().currentScreen; @@ -907,7 +891,7 @@ public class CustomAH extends Gui { this.drawTexturedModalRect(guiLeft, y, 0, ySplit, getXSize(), 136 - ySplit); //GUI Name - Utils.drawStringCenteredScaledMaxWidth("Auction House", Minecraft.getMinecraft().fontRendererObj, guiLeft + 42, + Utils.drawStringCenteredScaledMaxWidth("Auction House", guiLeft + 42, guiTop + 10, false, 68, 4210752 ); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); @@ -1000,7 +984,7 @@ public class CustomAH extends Gui { if (!NotEnoughUpdates.INSTANCE.config.neuAuctionHouse.enableNeuAuctionHouse) { Utils.drawStringCentered(EnumChatFormatting.RED + "NEUAH is DISABLED! Enable in /neu.", - Minecraft.getMinecraft().fontRendererObj, guiLeft + getXSize() / 2, guiTop + getYSize() / 2 - 5, true, 0 + guiLeft + getXSize() / 2, guiTop + getYSize() / 2 - 5, true, 0 ); } @@ -1009,9 +993,7 @@ public class CustomAH extends Gui { for (String line : tooltipToRender) { tooltipGray.add(EnumChatFormatting.GRAY + line); } - Utils.drawHoveringText(tooltipGray, mouseX, mouseY, width, - height, -1, Minecraft.getMinecraft().fontRendererObj - ); + Utils.drawHoveringText(tooltipGray, mouseX, mouseY, width, height, -1); } float slideAmount = 1 - Math.max(0, Math.min(1, (System.currentTimeMillis() - lastGuiScreenSwitch) / 200f)); int auctionViewLeft = guiLeft + getXSize() + 4 - (int) (slideAmount * (78 + 4)); @@ -1032,9 +1014,7 @@ public class CustomAH extends Gui { } priceFilterField.drawTextBox(); - Utils.drawStringCenteredScaledMaxWidth("Price Filter", Minecraft.getMinecraft().fontRendererObj, - auctionViewLeft + 39, guiTop + 10, false, 70, 4210752 - ); + Utils.drawStringCenteredScaledMaxWidth("Price Filter", auctionViewLeft + 39, guiTop + 10, false, 70, 421052); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); Minecraft.getMinecraft().getTextureManager().bindTexture(auction_view_buttons); @@ -1054,16 +1034,9 @@ public class CustomAH extends Gui { |
