diff options
author | nopo <nopotheemail@gmail.com> | 2023-02-13 22:55:09 +1100 |
---|---|---|
committer | nopo <nopotheemail@gmail.com> | 2023-02-13 22:55:09 +1100 |
commit | 9d47f294fded28cc4a2b6cd1db72ee3fa13b35ce (patch) | |
tree | 448b7f1fd1af5abc8cb9646218b781f996d8bb67 /src/main/java | |
parent | 550277f9452bbb79bb070942e31a9c4b9be80713 (diff) | |
download | NotEnoughUpdates-9d47f294fded28cc4a2b6cd1db72ee3fa13b35ce.tar.gz NotEnoughUpdates-9d47f294fded28cc4a2b6cd1db72ee3fa13b35ce.tar.bz2 NotEnoughUpdates-9d47f294fded28cc4a2b6cd1db72ee3fa13b35ce.zip |
change trophy fish pv page to use the same tooltip system as the rest of the pv pages
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/profileviewer/trophy/TrophyFishPage.java | 36 |
1 files changed, 18 insertions, 18 deletions
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<String, Integer> total = new HashMap<>(); private final Map<String, TrophyFish> trophyFishList = new HashMap<>(); private long totalCount = 0; + private static List<String> 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(); } |