Added Feature: #0717 - Remove from Interface Terminal
This commit is contained in:
parent
30888c4b1a
commit
c2ca99af03
5 changed files with 28 additions and 3 deletions
|
@ -11,6 +11,7 @@ import appeng.api.config.Settings;
|
|||
import appeng.api.config.YesNo;
|
||||
import appeng.client.gui.widgets.GuiImgButton;
|
||||
import appeng.client.gui.widgets.GuiTabButton;
|
||||
import appeng.client.gui.widgets.GuiToggleButton;
|
||||
import appeng.container.implementations.ContainerInterface;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.localization.GuiText;
|
||||
|
@ -25,6 +26,7 @@ public class GuiInterface extends GuiUpgradeable
|
|||
|
||||
GuiTabButton priority;
|
||||
GuiImgButton BlockMode;
|
||||
GuiToggleButton interfaceMode;
|
||||
|
||||
public GuiInterface(InventoryPlayer inventoryPlayer, IInterfaceHost te) {
|
||||
super( new ContainerInterface( inventoryPlayer, te ) );
|
||||
|
@ -52,6 +54,9 @@ public class GuiInterface extends GuiUpgradeable
|
|||
|
||||
try
|
||||
{
|
||||
if ( btn == interfaceMode )
|
||||
NetworkHandler.instance.sendToServer( new PacketConfigButton( Settings.INTERFACE_TERMINAL, backwards ) );
|
||||
|
||||
if ( btn == BlockMode )
|
||||
NetworkHandler.instance.sendToServer( new PacketConfigButton( BlockMode.getSetting(), backwards ) );
|
||||
|
||||
|
@ -70,6 +75,10 @@ public class GuiInterface extends GuiUpgradeable
|
|||
|
||||
BlockMode = new GuiImgButton( this.guiLeft - 18, guiTop + 8, Settings.BLOCK, YesNo.NO );
|
||||
buttonList.add( BlockMode );
|
||||
|
||||
interfaceMode = new GuiToggleButton( this.guiLeft - 18, guiTop + 26, 84, 85, GuiText.InterfaceTerminal.getLocal(),
|
||||
GuiText.InterfaceTerminalHint.getLocal() );
|
||||
buttonList.add( interfaceMode );
|
||||
}
|
||||
|
||||
protected String getBackground()
|
||||
|
@ -83,6 +92,9 @@ public class GuiInterface extends GuiUpgradeable
|
|||
if ( BlockMode != null )
|
||||
BlockMode.set( ((ContainerInterface) cvb).bMode );
|
||||
|
||||
if ( interfaceMode != null )
|
||||
interfaceMode.setState( ((ContainerInterface) cvb).iTermMode == YesNo.YES );
|
||||
|
||||
fontRendererObj.drawString( getGuiDisplayName( GuiText.Interface.getLocal() ), 8, 6, 4210752 );
|
||||
|
||||
fontRendererObj.drawString( GuiText.Config.getLocal(), 18, 6 + 11 + 7, 4210752 );
|
||||
|
|
|
@ -21,6 +21,9 @@ public class ContainerInterface extends ContainerUpgradeable
|
|||
@GuiSync(3)
|
||||
public YesNo bMode = YesNo.NO;
|
||||
|
||||
@GuiSync(4)
|
||||
public YesNo iTermMode = YesNo.YES;
|
||||
|
||||
public ContainerInterface(InventoryPlayer ip, IInterfaceHost te) {
|
||||
super( ip, te.getInterfaceDuality().getHost() );
|
||||
|
||||
|
@ -52,6 +55,7 @@ public class ContainerInterface extends ContainerUpgradeable
|
|||
protected void loadSettingsFromHost(IConfigManager cm)
|
||||
{
|
||||
this.bMode = (YesNo) cm.getSetting( Settings.BLOCK );
|
||||
this.iTermMode = (YesNo) cm.getSetting( Settings.INTERFACE_TERMINAL );
|
||||
}
|
||||
|
||||
public int availableUpgrades()
|
||||
|
|
|
@ -11,6 +11,8 @@ import net.minecraft.inventory.IInventory;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.YesNo;
|
||||
import appeng.api.networking.IGrid;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.networking.security.IActionHost;
|
||||
|
@ -217,6 +219,9 @@ public class ContainerInterfaceTerminal extends AEBaseContainer
|
|||
if ( gn.isActive() )
|
||||
{
|
||||
IInterfaceHost ih = (IInterfaceHost) gn.getMachine();
|
||||
if ( ih.getInterfaceDuality().getConfigManager().getSetting( Settings.INTERFACE_TERMINAL ) == YesNo.NO )
|
||||
continue;
|
||||
|
||||
InvTracker t = diList.get( ih );
|
||||
|
||||
if ( t == null )
|
||||
|
@ -237,6 +242,9 @@ public class ContainerInterfaceTerminal extends AEBaseContainer
|
|||
if ( gn.isActive() )
|
||||
{
|
||||
IInterfaceHost ih = (IInterfaceHost) gn.getMachine();
|
||||
if ( ih.getInterfaceDuality().getConfigManager().getSetting( Settings.INTERFACE_TERMINAL ) == YesNo.NO )
|
||||
continue;
|
||||
|
||||
InvTracker t = diList.get( ih );
|
||||
|
||||
if ( t == null )
|
||||
|
@ -310,7 +318,7 @@ public class ContainerInterfaceTerminal extends AEBaseContainer
|
|||
{
|
||||
IInterfaceHost ih = (IInterfaceHost) gn.getMachine();
|
||||
DualityInterface dual = ih.getInterfaceDuality();
|
||||
if ( gn.isActive() )
|
||||
if ( gn.isActive() && dual.getConfigManager().getSetting( Settings.INTERFACE_TERMINAL ) == YesNo.YES )
|
||||
diList.put( ih, new InvTracker( dual, dual.getPatterns(), dual.getTermName() ) );
|
||||
}
|
||||
|
||||
|
@ -318,7 +326,7 @@ public class ContainerInterfaceTerminal extends AEBaseContainer
|
|||
{
|
||||
IInterfaceHost ih = (IInterfaceHost) gn.getMachine();
|
||||
DualityInterface dual = ih.getInterfaceDuality();
|
||||
if ( gn.isActive() )
|
||||
if ( gn.isActive() && dual.getConfigManager().getSetting( Settings.INTERFACE_TERMINAL ) == YesNo.YES )
|
||||
diList.put( ih, new InvTracker( dual, dual.getPatterns(), dual.getTermName() ) );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ public enum GuiText
|
|||
|
||||
OfSecondOutput, NoSecondOutput, RFTunnel, Stores, Next, SelectAmount, Lumen, Empty, ConfirmCrafting,
|
||||
|
||||
Stored, Crafting, Scheduled, CraftingStatus, Cancel, FromStorage, ToCraft, CraftingPlan, CalculatingWait, Start, Bytes, CraftingCPU, Automatic, CoProcessors, Simulation, Missing, InterfaceTerminal, NoCraftingCPUs, LightTunnel, Clean, InvalidPattern;
|
||||
Stored, Crafting, Scheduled, CraftingStatus, Cancel, FromStorage, ToCraft, CraftingPlan, CalculatingWait, Start, Bytes, CraftingCPU, Automatic, CoProcessors, Simulation, Missing, InterfaceTerminal, NoCraftingCPUs, LightTunnel, Clean, InvalidPattern, InterfaceTerminalHint;
|
||||
|
||||
String root;
|
||||
|
||||
|
|
|
@ -202,6 +202,7 @@ public class DualityInterface implements IGridTickable, ISegmentedInventory, ISt
|
|||
|
||||
upgrades = new UpgradeInventory( gridProxy.getMachineRepresentation(), this, 1 );
|
||||
cm.registerSetting( Settings.BLOCK, YesNo.NO );
|
||||
cm.registerSetting( Settings.INTERFACE_TERMINAL, YesNo.YES );
|
||||
|
||||
iHost = ih;
|
||||
craftingTracker = new MultiCraftingTracker( iHost, 9 );
|
||||
|
|
Loading…
Reference in a new issue