From ea3ec354ba3bb5b4ac64b8032816b8e4c407f099 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Tue, 28 Dec 2021 00:49:28 -0500 Subject: more code clean up (#38) --- .../notenoughupdates/miscgui/TradeWindow.java | 23 +++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscgui/TradeWindow.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/TradeWindow.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/TradeWindow.java index d1df10c8..fda6dd03 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/TradeWindow.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/TradeWindow.java @@ -32,7 +32,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; public class TradeWindow { - private static final ResourceLocation location = new ResourceLocation("notenoughupdates", "custom_trade.png"); private static final int xSize = 176; @@ -870,19 +869,22 @@ public class TradeWindow { if (mouseX >= guiLeft + xSize + 3 && mouseX <= guiLeft + xSize + 3 + 17) { if (mouseY >= guiTop + ySize - 19 && mouseY <= guiTop + ySize - 19 + 17) { - tooltipToDisplay = new ArrayList<>(); - tooltipToDisplay.add(EnumChatFormatting.GOLD + "Enable Custom Trade Menu"); - tooltipToDisplay.add(EnumChatFormatting.GRAY + "Use this menu instead of the default trade window"); + tooltipToDisplay = new ArrayList() {{ + add(EnumChatFormatting.GOLD + "Enable Custom Trade Menu"); + add(EnumChatFormatting.GRAY + "Use this menu instead of the default trade window"); + }}; tooltipLen = 200; } else if (mouseY >= guiTop + ySize - 38 && mouseY <= guiTop + ySize - 38 + 17) { - tooltipToDisplay = new ArrayList<>(); - tooltipToDisplay.add(EnumChatFormatting.GOLD + "Price Information"); - tooltipToDisplay.add(EnumChatFormatting.GRAY + "Show the price of items on both sides"); + tooltipToDisplay = new ArrayList() {{ + add(EnumChatFormatting.GOLD + "Price Information"); + add(EnumChatFormatting.GRAY + "Show the price of items on both sides"); + }}; tooltipLen = 200; } else if (mouseY >= guiTop + ySize - 57 && mouseY <= guiTop + ySize - 57 + 17) { - tooltipToDisplay = new ArrayList<>(); - tooltipToDisplay.add(EnumChatFormatting.GOLD + "Trade Prices Style"); - tooltipToDisplay.add(EnumChatFormatting.GRAY + "Changes the style of the top item prices"); + tooltipToDisplay = new ArrayList() {{ + add(EnumChatFormatting.GOLD + "Trade Prices Style"); + add(EnumChatFormatting.GRAY + "Changes the style of the top item prices"); + }}; tooltipLen = 200; } } @@ -1039,5 +1041,4 @@ public class TradeWindow { return Keyboard.getEventKey() != Keyboard.KEY_ESCAPE; } - } -- cgit