Added Feature: #0717 - Remove from Interface Terminal

This commit is contained in:
AlgorithmX2
2014-07-30 21:02:37 -05:00
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.api.config.YesNo;
import appeng.client.gui.widgets.GuiImgButton; import appeng.client.gui.widgets.GuiImgButton;
import appeng.client.gui.widgets.GuiTabButton; import appeng.client.gui.widgets.GuiTabButton;
import appeng.client.gui.widgets.GuiToggleButton;
import appeng.container.implementations.ContainerInterface; import appeng.container.implementations.ContainerInterface;
import appeng.core.AELog; import appeng.core.AELog;
import appeng.core.localization.GuiText; import appeng.core.localization.GuiText;
@@ -25,6 +26,7 @@ public class GuiInterface extends GuiUpgradeable
GuiTabButton priority; GuiTabButton priority;
GuiImgButton BlockMode; GuiImgButton BlockMode;
GuiToggleButton interfaceMode;
public GuiInterface(InventoryPlayer inventoryPlayer, IInterfaceHost te) { public GuiInterface(InventoryPlayer inventoryPlayer, IInterfaceHost te) {
super( new ContainerInterface( inventoryPlayer, te ) ); super( new ContainerInterface( inventoryPlayer, te ) );
@@ -52,6 +54,9 @@ public class GuiInterface extends GuiUpgradeable
try try
{ {
if ( btn == interfaceMode )
NetworkHandler.instance.sendToServer( new PacketConfigButton( Settings.INTERFACE_TERMINAL, backwards ) );
if ( btn == BlockMode ) if ( btn == BlockMode )
NetworkHandler.instance.sendToServer( new PacketConfigButton( BlockMode.getSetting(), backwards ) ); 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 ); BlockMode = new GuiImgButton( this.guiLeft - 18, guiTop + 8, Settings.BLOCK, YesNo.NO );
buttonList.add( BlockMode ); 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() protected String getBackground()
@@ -83,6 +92,9 @@ public class GuiInterface extends GuiUpgradeable
if ( BlockMode != null ) if ( BlockMode != null )
BlockMode.set( ((ContainerInterface) cvb).bMode ); 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( getGuiDisplayName( GuiText.Interface.getLocal() ), 8, 6, 4210752 );
fontRendererObj.drawString( GuiText.Config.getLocal(), 18, 6 + 11 + 7, 4210752 ); fontRendererObj.drawString( GuiText.Config.getLocal(), 18, 6 + 11 + 7, 4210752 );
@@ -21,6 +21,9 @@ public class ContainerInterface extends ContainerUpgradeable
@GuiSync(3) @GuiSync(3)
public YesNo bMode = YesNo.NO; public YesNo bMode = YesNo.NO;
@GuiSync(4)
public YesNo iTermMode = YesNo.YES;
public ContainerInterface(InventoryPlayer ip, IInterfaceHost te) { public ContainerInterface(InventoryPlayer ip, IInterfaceHost te) {
super( ip, te.getInterfaceDuality().getHost() ); super( ip, te.getInterfaceDuality().getHost() );
@@ -52,6 +55,7 @@ public class ContainerInterface extends ContainerUpgradeable
protected void loadSettingsFromHost(IConfigManager cm) protected void loadSettingsFromHost(IConfigManager cm)
{ {
this.bMode = (YesNo) cm.getSetting( Settings.BLOCK ); this.bMode = (YesNo) cm.getSetting( Settings.BLOCK );
this.iTermMode = (YesNo) cm.getSetting( Settings.INTERFACE_TERMINAL );
} }
public int availableUpgrades() public int availableUpgrades()
@@ -11,6 +11,8 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.util.ForgeDirection; 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.IGrid;
import appeng.api.networking.IGridNode; import appeng.api.networking.IGridNode;
import appeng.api.networking.security.IActionHost; import appeng.api.networking.security.IActionHost;
@@ -217,6 +219,9 @@ public class ContainerInterfaceTerminal extends AEBaseContainer
if ( gn.isActive() ) if ( gn.isActive() )
{ {
IInterfaceHost ih = (IInterfaceHost) gn.getMachine(); IInterfaceHost ih = (IInterfaceHost) gn.getMachine();
if ( ih.getInterfaceDuality().getConfigManager().getSetting( Settings.INTERFACE_TERMINAL ) == YesNo.NO )
continue;
InvTracker t = diList.get( ih ); InvTracker t = diList.get( ih );
if ( t == null ) if ( t == null )
@@ -237,6 +242,9 @@ public class ContainerInterfaceTerminal extends AEBaseContainer
if ( gn.isActive() ) if ( gn.isActive() )
{ {
IInterfaceHost ih = (IInterfaceHost) gn.getMachine(); IInterfaceHost ih = (IInterfaceHost) gn.getMachine();
if ( ih.getInterfaceDuality().getConfigManager().getSetting( Settings.INTERFACE_TERMINAL ) == YesNo.NO )
continue;
InvTracker t = diList.get( ih ); InvTracker t = diList.get( ih );
if ( t == null ) if ( t == null )
@@ -310,7 +318,7 @@ public class ContainerInterfaceTerminal extends AEBaseContainer
{ {
IInterfaceHost ih = (IInterfaceHost) gn.getMachine(); IInterfaceHost ih = (IInterfaceHost) gn.getMachine();
DualityInterface dual = ih.getInterfaceDuality(); 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() ) ); diList.put( ih, new InvTracker( dual, dual.getPatterns(), dual.getTermName() ) );
} }
@@ -318,7 +326,7 @@ public class ContainerInterfaceTerminal extends AEBaseContainer
{ {
IInterfaceHost ih = (IInterfaceHost) gn.getMachine(); IInterfaceHost ih = (IInterfaceHost) gn.getMachine();
DualityInterface dual = ih.getInterfaceDuality(); 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() ) ); diList.put( ih, new InvTracker( dual, dual.getPatterns(), dual.getTermName() ) );
} }
} }
+1 -1
View File
@@ -32,7 +32,7 @@ public enum GuiText
OfSecondOutput, NoSecondOutput, RFTunnel, Stores, Next, SelectAmount, Lumen, Empty, ConfirmCrafting, 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; String root;
+1
View File
@@ -202,6 +202,7 @@ public class DualityInterface implements IGridTickable, ISegmentedInventory, ISt
upgrades = new UpgradeInventory( gridProxy.getMachineRepresentation(), this, 1 ); upgrades = new UpgradeInventory( gridProxy.getMachineRepresentation(), this, 1 );
cm.registerSetting( Settings.BLOCK, YesNo.NO ); cm.registerSetting( Settings.BLOCK, YesNo.NO );
cm.registerSetting( Settings.INTERFACE_TERMINAL, YesNo.YES );
iHost = ih; iHost = ih;
craftingTracker = new MultiCraftingTracker( iHost, 9 ); craftingTracker = new MultiCraftingTracker( iHost, 9 );