mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-11 15:57:55 +00:00
Respect setting preserveSearchBar in InterfaceTerminal (#180)
Closes: GTNewHorizons/GT-New-Horizons-Modpack#15122
This commit is contained in:
1 parent
b0a2e6e274
commit
90e4eb0366
1 file changed
+35
-1
@@ -41,6 +41,7 @@ import appeng.api.AEApi;
|
||||
import appeng.api.config.ActionItems;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.TerminalStyle;
|
||||
import appeng.api.config.YesNo;
|
||||
import appeng.api.util.DimensionalCoord;
|
||||
import appeng.api.util.WorldCoord;
|
||||
import appeng.client.gui.IInterfaceTerminalPostUpdate;
|
||||
@@ -88,6 +89,7 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText
|
||||
private final GuiImgButton guiButtonAssemblersOnly;
|
||||
private final GuiImgButton guiButtonBrokenRecipes;
|
||||
private final GuiImgButton terminalStyleBox;
|
||||
private final GuiImgButton searchStringSave;
|
||||
private boolean onlyMolecularAssemblers = false;
|
||||
private boolean onlyBrokenRecipes = false;
|
||||
private boolean online;
|
||||
@@ -96,6 +98,9 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText
|
||||
private final List<String> extraOptionsText;
|
||||
private ItemStack tooltipStack;
|
||||
private final boolean neiPresent;
|
||||
protected static String searchFieldInputsText = "";
|
||||
protected static String searchFieldOutputsText = "";
|
||||
protected static String searchFieldNamesText = "";
|
||||
/*
|
||||
* Z-level Map (FLOATS) 0.0 - BACKGROUND 1.0 - ItemStacks 2.0 - Slot color overlays 20.0 - ItemStack overlays 21.0 -
|
||||
* Slot mouse hover overlay 200.0 - Tooltips
|
||||
@@ -143,6 +148,11 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText
|
||||
};
|
||||
searchFieldNames.setFocused(true);
|
||||
|
||||
searchStringSave = new GuiImgButton(
|
||||
0,
|
||||
0,
|
||||
Settings.SAVE_SEARCH,
|
||||
AEConfig.instance.preserveSearchBar ? YesNo.YES : YesNo.NO);
|
||||
guiButtonAssemblersOnly = new GuiImgButton(0, 0, Settings.ACTIONS, null);
|
||||
guiButtonHideFull = new GuiImgButton(0, 0, Settings.ACTIONS, null);
|
||||
guiButtonBrokenRecipes = new GuiImgButton(0, 0, Settings.ACTIONS, null);
|
||||
@@ -196,8 +206,11 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText
|
||||
terminalStyleBox.xPosition = guiLeft - 18;
|
||||
terminalStyleBox.yPosition = guiTop + 8;
|
||||
|
||||
searchStringSave.xPosition = guiLeft - 18;
|
||||
searchStringSave.yPosition = terminalStyleBox.yPosition + 18;
|
||||
|
||||
guiButtonBrokenRecipes.xPosition = guiLeft - 18;
|
||||
guiButtonBrokenRecipes.yPosition = terminalStyleBox.yPosition + 18;
|
||||
guiButtonBrokenRecipes.yPosition = searchStringSave.yPosition + 18;
|
||||
|
||||
guiButtonHideFull.xPosition = guiLeft - 18;
|
||||
guiButtonHideFull.yPosition = guiButtonBrokenRecipes.yPosition + 18;
|
||||
@@ -207,12 +220,17 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText
|
||||
|
||||
offsetY = guiButtonAssemblersOnly.yPosition + 18;
|
||||
|
||||
if (AEConfig.instance.preserveSearchBar || isSubGui()) {
|
||||
setSearchString();
|
||||
}
|
||||
|
||||
this.setScrollBar();
|
||||
this.repositionSlots();
|
||||
|
||||
buttonList.add(guiButtonAssemblersOnly);
|
||||
buttonList.add(guiButtonHideFull);
|
||||
buttonList.add(guiButtonBrokenRecipes);
|
||||
buttonList.add(searchStringSave);
|
||||
buttonList.add(terminalStyleBox);
|
||||
initGuiDone();
|
||||
addSwitchGuiBtns();
|
||||
@@ -306,6 +324,8 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText
|
||||
if (btn == this.terminalStyleBox) {
|
||||
AEConfig.instance.settings.putSetting(iBtn.getSetting(), next);
|
||||
initGui();
|
||||
} else if (btn == searchStringSave) {
|
||||
AEConfig.instance.preserveSearchBar = next == YesNo.YES;
|
||||
}
|
||||
|
||||
iBtn.set(next);
|
||||
@@ -315,6 +335,20 @@ public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillText
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGuiClosed() {
|
||||
super.onGuiClosed();
|
||||
searchFieldInputsText = searchFieldInputs.getText();
|
||||
searchFieldOutputsText = searchFieldOutputs.getText();
|
||||
searchFieldNamesText = searchFieldNames.getText();
|
||||
}
|
||||
|
||||
public void setSearchString() {
|
||||
searchFieldInputs.setText(searchFieldInputsText);
|
||||
searchFieldOutputs.setText(searchFieldOutputsText);
|
||||
searchFieldNames.setText(searchFieldNamesText);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||
this.bindTexture(BACKGROUND);
|
||||
|
||||
Reference in new issue
Block a user