From 9d47f294fded28cc4a2b6cd1db72ee3fa13b35ce Mon Sep 17 00:00:00 2001 From: nopo Date: Mon, 13 Feb 2023 22:55:09 +1100 Subject: change trophy fish pv page to use the same tooltip system as the rest of the pv pages --- .../profileviewer/trophy/TrophyFishPage.java | 36 +++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/trophy/TrophyFishPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/trophy/TrophyFishPage.java index 1db53267..e885e04f 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/trophy/TrophyFishPage.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/trophy/TrophyFishPage.java @@ -128,6 +128,7 @@ public class TrophyFishPage extends GuiProfileViewerPage { private final Map total = new HashMap<>(); private final Map trophyFishList = new HashMap<>(); private long totalCount = 0; + private static List tooltipToDisplay = null; public TrophyFishPage(GuiProfileViewer instance) { super(instance); @@ -248,15 +249,8 @@ public class TrophyFishPage extends GuiProfileViewerPage { if (mouseX >= x && mouseX < x + 24) { if (mouseY >= y && mouseY <= y + 24) { - Utils.drawHoveringText( - getTooltip(value.getName(), value.getTrophyFishRarityIntegerMap()), - mouseX, - mouseY, - width, - height, - -1, - Minecraft.getMinecraft().fontRendererObj - ); + tooltipToDisplay = new ArrayList<>(); + tooltipToDisplay.addAll(getTooltip(value.getName(), value.getTrophyFishRarityIntegerMap())); } } } @@ -273,15 +267,8 @@ public class TrophyFishPage extends GuiProfileViewerPage { Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(itemStack, x, y); if (mouseX >= x && mouseX < x + 24) { if (mouseY >= y && mouseY <= y + 24) { - Utils.drawHoveringText( - getTooltip(difference, null), - mouseX, - mouseY, - width, - height, - -1, - Minecraft.getMinecraft().fontRendererObj - ); + tooltipToDisplay = new ArrayList<>(); + tooltipToDisplay.addAll(getTooltip(difference, null)); GlStateManager.color(1, 1, 1, 1); } } @@ -321,6 +308,19 @@ public class TrophyFishPage extends GuiProfileViewerPage { i += 10; } + if (tooltipToDisplay != null) { + Utils.drawHoveringText( + tooltipToDisplay, + mouseX, + mouseY, + getInstance().width, + getInstance().height, + -1, + Minecraft.getMinecraft().fontRendererObj + ); + tooltipToDisplay = null; + } + GlStateManager.enableLighting(); } -- cgit