From b2665643d296008bf40de7405dada442cffc07b5 Mon Sep 17 00:00:00 2001 From: Lulonaut Date: Tue, 16 Jan 2024 10:14:15 +0100 Subject: Empty pv search bar instead of displaying error (#1002) --- .../notenoughupdates/profileviewer/GuiProfileViewer.java | 8 ++++++-- 1 file 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) { -- cgit