aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorNopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com>2023-07-07 01:30:02 +1000
committerGitHub <noreply@github.com>2023-07-06 17:30:02 +0200
commit752716078f07cffc52daf87bbea7805ccb15e80c (patch)
tree99870e9cd8c33d42e22f27d6149b2ccca66e2a22 /src/main/java
parent5f4281f7d17a4b9e940f9d2d43ec1a4494744d30 (diff)
downloadNotEnoughUpdates-752716078f07cffc52daf87bbea7805ccb15e80c.tar.gz
NotEnoughUpdates-752716078f07cffc52daf87bbea7805ccb15e80c.tar.bz2
NotEnoughUpdates-752716078f07cffc52daf87bbea7805ccb15e80c.zip
Show player username when hovering over the recent profiles (#761)
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java19
1 files changed, 19 insertions, 0 deletions
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<String> 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<String> grayTooltip = new ArrayList<>(tooltipToDisplay.size());