diff options
author | Lulonaut <lulonaut@lulonaut.tech> | 2024-01-16 10:14:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-16 20:14:15 +1100 |
commit | b2665643d296008bf40de7405dada442cffc07b5 (patch) | |
tree | 3c0d98943f9c2595ccb953ffacac8dcd4a974fcb | |
parent | 457d980d9b23055b97cdcc026bfc49912e69e52c (diff) | |
download | NotEnoughUpdates-b2665643d296008bf40de7405dada442cffc07b5.tar.gz NotEnoughUpdates-b2665643d296008bf40de7405dada442cffc07b5.tar.bz2 NotEnoughUpdates-b2665643d296008bf40de7405dada442cffc07b5.zip |
Empty pv search bar instead of displaying error (#1002)
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java | 8 |
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) { |