aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorLulonaut <lulonaut@lulonaut.tech>2024-01-16 10:14:15 +0100
committerGitHub <noreply@github.com>2024-01-16 20:14:15 +1100
commitb2665643d296008bf40de7405dada442cffc07b5 (patch)
tree3c0d98943f9c2595ccb953ffacac8dcd4a974fcb /src/main/java
parent457d980d9b23055b97cdcc026bfc49912e69e52c (diff)
downloadNotEnoughUpdates-b2665643d296008bf40de7405dada442cffc07b5.tar.gz
NotEnoughUpdates-b2665643d296008bf40de7405dada442cffc07b5.tar.bz2
NotEnoughUpdates-b2665643d296008bf40de7405dada442cffc07b5.zip
Empty pv search bar instead of displaying error (#1002)
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java8
1 files changed, 6 insertions, 2 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 86db77ca..f3c96854 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2022-2023 NotEnoughUpdates contributors
+ * Copyright (C) 2022-2024 NotEnoughUpdates contributors
*
* This file is part of NotEnoughUpdates.
*
@@ -192,7 +192,11 @@ public class GuiProfileViewer extends GuiScreen {
GuiProfileViewer.profile = profile;
GuiProfileViewer.profileName = profile.getLatestProfileName();
- playerNameTextField = new GuiElementTextField(getDisplayName(), GuiElementTextField.SCALE_TEXT);
+ String displayname = getDisplayName();
+ // Make search bar empty in case no name was found, e.g. while currently loading
+ if (displayname.startsWith("ยง")) displayname = "";
+
+ playerNameTextField = new GuiElementTextField(displayname, GuiElementTextField.SCALE_TEXT);
playerNameTextField.setSize(100, 20);
if (currentPage == ProfileViewerPage.LOADING) {