Keep Search when switching between crafting and normal view.
This commit is contained in:
parent
a1af4443b7
commit
fe74989563
|
@ -56,9 +56,18 @@ public abstract class AEBaseGui extends GuiContainer
|
|||
|
||||
protected List<InternalSlotME> meSlots = new LinkedList<InternalSlotME>();
|
||||
protected GuiScrollbar myScrollBar = null;
|
||||
static public boolean switchingGuis;
|
||||
final private boolean subGui;
|
||||
|
||||
public AEBaseGui(Container container) {
|
||||
super( container );
|
||||
subGui = switchingGuis;
|
||||
switchingGuis = false;
|
||||
}
|
||||
|
||||
public boolean isSubGui()
|
||||
{
|
||||
return subGui;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -44,6 +44,8 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
|||
{
|
||||
|
||||
MEGuiTextField searchField;
|
||||
private static String memoryText = "";
|
||||
|
||||
ItemRepo repo;
|
||||
|
||||
GuiText myName;
|
||||
|
@ -127,6 +129,13 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
|||
this.initGui();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGuiClosed()
|
||||
{
|
||||
super.onGuiClosed();
|
||||
memoryText = searchField.getText();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
|
@ -213,7 +222,13 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
|||
Enum setting = AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE );
|
||||
searchField.setFocused( SearchBoxMode.AUTOSEARCH == setting || SearchBoxMode.NEI_AUTOSEARCH == setting );
|
||||
|
||||
setScrollBar();
|
||||
if ( isSubGui() )
|
||||
{
|
||||
searchField.setText( memoryText );
|
||||
repo.searchString = memoryText;
|
||||
repo.updateView();
|
||||
setScrollBar();
|
||||
}
|
||||
|
||||
for (Object s : inventorySlots.inventorySlots)
|
||||
{
|
||||
|
|
|
@ -8,6 +8,7 @@ import java.io.IOException;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.ContainerOpenContext;
|
||||
import appeng.core.sync.AppEngPacket;
|
||||
|
@ -46,6 +47,8 @@ public class PacketSwitchGuis extends AppEngPacket
|
|||
|
||||
this.newGui = newGui;
|
||||
|
||||
AEBaseGui.switchingGuis = true;
|
||||
|
||||
ByteBuf data = Unpooled.buffer();
|
||||
|
||||
data.writeInt( getPacketID() );
|
||||
|
|
Loading…
Reference in a new issue