From 752716078f07cffc52daf87bbea7805ccb15e80c Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Fri, 7 Jul 2023 01:30:02 +1000 Subject: Show player username when hovering over the recent profiles (#761) --- .../profileviewer/GuiProfileViewer.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/main/java/io') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java index 2dcce1fb..c4ba85db 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java @@ -557,6 +557,25 @@ public class GuiProfileViewer extends GuiScreen { } } } + int x = guiLeft + sizeX; + int y = guiTop; + List previousProfileSearches = NotEnoughUpdates.INSTANCE.config.hidden.previousProfileSearches; + + if (mouseX > x && mouseX < x + 29) { + if (mouseY > y && mouseY < y + 28) { + tooltipToDisplay = new ArrayList<>(); + tooltipToDisplay.add(Minecraft.getMinecraft().thePlayer.getName()); + } + } + + for (int i = 0; i < previousProfileSearches.size(); i++) { + if (mouseX > x && mouseX < x + 28) { + if (mouseY > y + 28 * (i + 1) && mouseY < y + 28 * (i + 2)) { + tooltipToDisplay = new ArrayList<>(); + tooltipToDisplay.add(previousProfileSearches.get(i)); + } + } + } if (tooltipToDisplay != null) { List grayTooltip = new ArrayList<>(tooltipToDisplay.size()); -- cgit