From e48073976d42a7ddea35edb047dbe29279eaa1ed Mon Sep 17 00:00:00 2001 From: Alexdoru <57050655+Alexdoru@users.noreply.github.com> Date: Sun, 17 Nov 2024 13:48:36 +0100 Subject: [PATCH] fix the search strings resetting when changing the terminal size in the interface terminal (#243) Co-authored-by: MCTBL <30978504+MCTBL@users.noreply.github.com> --- .../github/client/gui/GuiInterfaceWireless.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/glodblock/github/client/gui/GuiInterfaceWireless.java b/src/main/java/com/glodblock/github/client/gui/GuiInterfaceWireless.java index 8e44bf75..87363653 100644 --- a/src/main/java/com/glodblock/github/client/gui/GuiInterfaceWireless.java +++ b/src/main/java/com/glodblock/github/client/gui/GuiInterfaceWireless.java @@ -220,9 +220,7 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText offsetY = guiButtonAssemblersOnly.yPosition + 18; - if (AEConfig.instance.preserveSearchBar || isSubGui()) { - setSearchString(); - } + setSearchString(); this.setScrollBar(); this.repositionSlots(); @@ -344,9 +342,16 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText } public void setSearchString() { - searchFieldInputs.setText(searchFieldInputsText); - searchFieldOutputs.setText(searchFieldOutputsText); - searchFieldNames.setText(searchFieldNamesText); + boolean setString = AEConfig.instance.preserveSearchBar || isSubGui(); + if (searchFieldInputs.getText().isEmpty() && setString) { + searchFieldInputs.setText(searchFieldInputsText); + } + if (searchFieldOutputs.getText().isEmpty() && setString) { + searchFieldOutputs.setText(searchFieldOutputsText); + } + if (searchFieldNames.getText().isEmpty() && setString) { + searchFieldNames.setText(searchFieldNamesText); + } } @Override