Grindr, GUI, Container.
This commit is contained in:
@@ -75,7 +75,6 @@ import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
||||
//TODO, pass generic up here for Container
|
||||
public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScreen<T>
|
||||
{
|
||||
private final List<InternalSlotME> meSlots = new ArrayList<>();
|
||||
|
||||
@@ -23,9 +23,12 @@ import java.text.NumberFormat;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import appeng.container.AEBaseContainer;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.container.Container;
|
||||
import net.minecraft.inventory.container.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
@@ -34,12 +37,11 @@ import appeng.core.AEConfig;
|
||||
import appeng.core.localization.ButtonToolTips;
|
||||
|
||||
|
||||
public abstract class AEBaseMEGui extends AEBaseGui
|
||||
public abstract class AEBaseMEGui<T extends AEBaseContainer> extends AEBaseGui<T>
|
||||
{
|
||||
|
||||
public AEBaseMEGui( final Container container )
|
||||
{
|
||||
super( container );
|
||||
public AEBaseMEGui(T container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -21,6 +21,9 @@ package appeng.client.gui.implementations;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import appeng.api.implementations.IUpgradeableHost;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
@@ -44,19 +47,15 @@ import appeng.tile.misc.TileCellWorkbench;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class GuiCellWorkbench extends GuiUpgradeable
|
||||
public class GuiCellWorkbench extends GuiUpgradeable<ContainerCellWorkbench>
|
||||
{
|
||||
|
||||
private final ContainerCellWorkbench workbench;
|
||||
|
||||
private GuiImgButton clear;
|
||||
private GuiImgButton partition;
|
||||
private GuiToggleButton copyMode;
|
||||
|
||||
public GuiCellWorkbench( final PlayerInventory PlayerInventory, final TileCellWorkbench te )
|
||||
{
|
||||
super( new ContainerCellWorkbench( PlayerInventory, te ) );
|
||||
this.workbench = (ContainerCellWorkbench) this.inventorySlots;
|
||||
public GuiCellWorkbench(ContainerCellWorkbench container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 251;
|
||||
}
|
||||
|
||||
@@ -81,63 +80,63 @@ public class GuiCellWorkbench extends GuiUpgradeable
|
||||
this.handleButtonVisibility();
|
||||
|
||||
this.bindTexture( this.getBackground() );
|
||||
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, 211 - 34, this.ySize );
|
||||
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, 211 - 34, this.ySize, 0 /* FIXME this.zlevel was used */ );
|
||||
if( this.drawUpgrades() )
|
||||
{
|
||||
if( this.workbench.availableUpgrades() <= 8 )
|
||||
if( this.container.availableUpgrades() <= 8 )
|
||||
{
|
||||
this.drawTexturedModalRect( offsetX + 177, offsetY, 177, 0, 35, 7 + this.workbench.availableUpgrades() * 18 );
|
||||
this.drawTexturedModalRect( offsetX + 177, offsetY + ( 7 + ( this.workbench.availableUpgrades() ) * 18 ), 177, 151, 35, 7 );
|
||||
GuiUtils.drawTexturedModalRect( offsetX + 177, offsetY, 177, 0, 35, 7 + this.container.availableUpgrades() * 18, 0 /* FIXME this.zlevel was used */ );
|
||||
GuiUtilsGuiUtils.drawTexturedModalRect( offsetX + 177, offsetY + ( 7 + ( this.container.availableUpgrades() ) * 18 ), 177, 151, 35, 7, 0 /* FIXME this.zlevel was used */ );
|
||||
}
|
||||
else if( this.workbench.availableUpgrades() <= 16 )
|
||||
else if( this.container.availableUpgrades() <= 16 )
|
||||
{
|
||||
this.drawTexturedModalRect( offsetX + 177, offsetY, 177, 0, 35, 7 + 8 * 18 );
|
||||
this.drawTexturedModalRect( offsetX + 177, offsetY + ( 7 + ( 8 ) * 18 ), 177, 151, 35, 7 );
|
||||
GuiUtils.drawTexturedModalRect( offsetX + 177, offsetY, 177, 0, 35, 7 + 8 * 18, 0 /* FIXME this.zlevel was used */ );
|
||||
GuiUtils.drawTexturedModalRect( offsetX + 177, offsetY + ( 7 + ( 8 ) * 18 ), 177, 151, 35, 7, 0 /* FIXME this.zlevel was used */ );
|
||||
|
||||
final int dx = this.workbench.availableUpgrades() - 8;
|
||||
this.drawTexturedModalRect( offsetX + 177 + 27, offsetY, 186, 0, 35 - 8, 7 + dx * 18 );
|
||||
final int dx = this.container.availableUpgrades() - 8;
|
||||
GuiUtils.drawTexturedModalRect( offsetX + 177 + 27, offsetY, 186, 0, 35 - 8, 7 + dx * 18, 0 /* FIXME this.zlevel was used */ );
|
||||
if( dx == 8 )
|
||||
{
|
||||
this.drawTexturedModalRect( offsetX + 177 + 27, offsetY + ( 7 + ( dx ) * 18 ), 186, 151, 35 - 8, 7 );
|
||||
GuiUtils.drawTexturedModalRect( offsetX + 177 + 27, offsetY + ( 7 + ( dx ) * 18 ), 186, 151, 35 - 8, 7, 0 /* FIXME this.zlevel was used */ );
|
||||
}
|
||||
else
|
||||
{
|
||||
this.drawTexturedModalRect( offsetX + 177 + 27 + 4, offsetY + ( 7 + ( dx ) * 18 ), 186 + 4, 151, 35 - 8, 7 );
|
||||
GuiUtils.drawTexturedModalRect( offsetX + 177 + 27 + 4, offsetY + ( 7 + ( dx ) * 18 ), 186 + 4, 151, 35 - 8, 7, 0 /* FIXME this.zlevel was used */ );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.drawTexturedModalRect( offsetX + 177, offsetY, 177, 0, 35, 7 + 8 * 18 );
|
||||
this.drawTexturedModalRect( offsetX + 177, offsetY + ( 7 + ( 8 ) * 18 ), 177, 151, 35, 7 );
|
||||
GuiUtils.drawTexturedModalRect( offsetX + 177, offsetY, 177, 0, 35, 7 + 8 * 18, 0 /* FIXME this.zlevel was used */ );
|
||||
GuiUtils.drawTexturedModalRect( offsetX + 177, offsetY + ( 7 + ( 8 ) * 18 ), 177, 151, 35, 7, 0 /* FIXME this.zlevel was used */ );
|
||||
|
||||
this.drawTexturedModalRect( offsetX + 177 + 27, offsetY, 186, 0, 35 - 8, 7 + 8 * 18 );
|
||||
this.drawTexturedModalRect( offsetX + 177 + 27, offsetY + ( 7 + ( 8 ) * 18 ), 186, 151, 35 - 8, 7 );
|
||||
GuiUtils.drawTexturedModalRect( offsetX + 177 + 27, offsetY, 186, 0, 35 - 8, 7 + 8 * 18, 0 /* FIXME this.zlevel was used */ );
|
||||
GuiUtils.drawTexturedModalRect( offsetX + 177 + 27, offsetY + ( 7 + ( 8 ) * 18 ), 186, 151, 35 - 8, 7, 0 /* FIXME this.zlevel was used */ );
|
||||
|
||||
final int dx = this.workbench.availableUpgrades() - 16;
|
||||
this.drawTexturedModalRect( offsetX + 177 + 27 + 18, offsetY, 186, 0, 35 - 8, 7 + dx * 18 );
|
||||
final int dx = this.container.availableUpgrades() - 16;
|
||||
GuiUtils.drawTexturedModalRect( offsetX + 177 + 27 + 18, offsetY, 186, 0, 35 - 8, 7 + dx * 18, 0 /* FIXME this.zlevel was used */ );
|
||||
if( dx == 8 )
|
||||
{
|
||||
this.drawTexturedModalRect( offsetX + 177 + 27 + 18, offsetY + ( 7 + ( dx ) * 18 ), 186, 151, 35 - 8, 7 );
|
||||
GuiUtils.drawTexturedModalRect( offsetX + 177 + 27 + 18, offsetY + ( 7 + ( dx ) * 18 ), 186, 151, 35 - 8, 7, 0 /* FIXME this.zlevel was used */ );
|
||||
}
|
||||
else
|
||||
{
|
||||
this.drawTexturedModalRect( offsetX + 177 + 27 + 18 + 4, offsetY + ( 7 + ( dx ) * 18 ), 186 + 4, 151, 35 - 8, 7 );
|
||||
GuiUtils.drawTexturedModalRect( offsetX + 177 + 27 + 18 + 4, offsetY + ( 7 + ( dx ) * 18 ), 186 + 4, 151, 35 - 8, 7, 0 /* FIXME this.zlevel was used */ );
|
||||
}
|
||||
}
|
||||
}
|
||||
if( this.hasToolbox() )
|
||||
{
|
||||
this.drawTexturedModalRect( offsetX + 178, offsetY + this.ySize - 90, 178, 161, 68, 68 );
|
||||
GuiUtils.drawTexturedModalRect( offsetX + 178, offsetY + this.ySize - 90, 178, 161, 68, 68, 0 /* FIXME this.zlevel was used */ );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleButtonVisibility()
|
||||
{
|
||||
this.copyMode.setState( this.workbench.getCopyMode() == CopyMode.CLEAR_ON_REMOVE );
|
||||
this.copyMode.setState( this.container.getCopyMode() == CopyMode.CLEAR_ON_REMOVE );
|
||||
|
||||
boolean hasFuzzy = false;
|
||||
final IItemHandler inv = this.workbench.getCellUpgradeInventory();
|
||||
final IItemHandler inv = this.container.getCellUpgradeInventory();
|
||||
for( int x = 0; x < inv.getSlots(); x++ )
|
||||
{
|
||||
final ItemStack is = inv.getStackInSlot( x );
|
||||
@@ -161,7 +160,7 @@ public class GuiCellWorkbench extends GuiUpgradeable
|
||||
@Override
|
||||
protected boolean drawUpgrades()
|
||||
{
|
||||
return this.workbench.availableUpgrades() > 0;
|
||||
return this.container.availableUpgrades() > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -32,16 +32,17 @@ import appeng.core.sync.GuiBridge;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketSwitchGuis;
|
||||
import appeng.tile.storage.TileChest;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
|
||||
public class GuiChest extends AEBaseGui
|
||||
public class GuiChest extends AEBaseGui<ContainerChest>
|
||||
{
|
||||
|
||||
private GuiTabButton priority;
|
||||
|
||||
public GuiChest( final PlayerInventory PlayerInventory, final TileChest te )
|
||||
{
|
||||
super( new ContainerChest( PlayerInventory, te ) );
|
||||
public GuiChest(ContainerChest container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 166;
|
||||
}
|
||||
|
||||
@@ -75,6 +76,6 @@ public class GuiChest extends AEBaseGui
|
||||
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||
{
|
||||
this.bindTexture( "guis/chest.png" );
|
||||
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
|
||||
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, 0 /* FIXME this.zlevel was used */ );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,8 @@ package appeng.client.gui.implementations;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
@@ -38,17 +40,14 @@ import appeng.core.sync.packets.PacketConfigButton;
|
||||
import appeng.tile.misc.TileCondenser;
|
||||
|
||||
|
||||
public class GuiCondenser extends AEBaseGui
|
||||
public class GuiCondenser extends AEBaseGui<ContainerCondenser>
|
||||
{
|
||||
|
||||
private final ContainerCondenser cvc;
|
||||
private GuiProgressBar pb;
|
||||
private GuiImgButton mode;
|
||||
|
||||
public GuiCondenser( final PlayerInventory PlayerInventory, final TileCondenser te )
|
||||
{
|
||||
super( new ContainerCondenser( PlayerInventory, te ) );
|
||||
this.cvc = (ContainerCondenser) this.inventorySlots;
|
||||
public GuiCondenser(ContainerCondenser container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 197;
|
||||
}
|
||||
|
||||
@@ -70,10 +69,10 @@ public class GuiCondenser extends AEBaseGui
|
||||
{
|
||||
super.init();
|
||||
|
||||
this.pb = new GuiProgressBar( this.cvc, "guis/condenser.png", 120 + this.guiLeft, 25 + this.guiTop, 178, 25, 6, 18, Direction.VERTICAL, GuiText.StoredEnergy
|
||||
this.pb = new GuiProgressBar( this.container, "guis/condenser.png", 120 + this.guiLeft, 25 + this.guiTop, 178, 25, 6, 18, Direction.VERTICAL, GuiText.StoredEnergy
|
||||
.getLocal() );
|
||||
|
||||
this.mode = new GuiImgButton( 128 + this.guiLeft, 52 + this.guiTop, Settings.CONDENSER_OUTPUT, this.cvc.getOutput() );
|
||||
this.mode = new GuiImgButton( 128 + this.guiLeft, 52 + this.guiTop, Settings.CONDENSER_OUTPUT, this.container.getOutput() );
|
||||
|
||||
this.addButton( this.pb );
|
||||
this.addButton( this.mode );
|
||||
@@ -85,8 +84,8 @@ public class GuiCondenser extends AEBaseGui
|
||||
this.font.drawString( this.getGuiDisplayName( GuiText.Condenser.getLocal() ), 8, 6, 4210752 );
|
||||
this.font.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||
|
||||
this.mode.set( this.cvc.getOutput() );
|
||||
this.mode.setFillVar( String.valueOf( this.cvc.getOutput().requiredPower ) );
|
||||
this.mode.set( this.container.getOutput() );
|
||||
this.mode.setFillVar( String.valueOf( this.container.getOutput().requiredPower ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -94,6 +93,6 @@ public class GuiCondenser extends AEBaseGui
|
||||
{
|
||||
this.bindTexture( "guis/condenser.png" );
|
||||
|
||||
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
|
||||
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, 0 /* FIXME this.zlevel was used */ );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ package appeng.client.gui.implementations;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import appeng.core.Api;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -44,9 +45,11 @@ import appeng.helpers.WirelessTerminalGuiObject;
|
||||
import appeng.parts.reporting.PartCraftingTerminal;
|
||||
import appeng.parts.reporting.PartPatternTerminal;
|
||||
import appeng.parts.reporting.PartTerminal;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
|
||||
public class GuiCraftAmount extends AEBaseGui
|
||||
public class GuiCraftAmount extends AEBaseGui<ContainerCraftAmount>
|
||||
{
|
||||
private GuiNumberBox amountToCraft;
|
||||
private GuiTabButton originalGuiBtn;
|
||||
@@ -64,10 +67,8 @@ public class GuiCraftAmount extends AEBaseGui
|
||||
|
||||
private GuiBridge originalGui;
|
||||
|
||||
@Reflected
|
||||
public GuiCraftAmount( final PlayerInventory PlayerInventory, final ITerminalHost te )
|
||||
{
|
||||
super( new ContainerCraftAmount( PlayerInventory, te ) );
|
||||
public GuiCraftAmount(ContainerCraftAmount container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -93,7 +94,7 @@ public class GuiCraftAmount extends AEBaseGui
|
||||
this.addButton( this.next = new GuiButton( 0, this.guiLeft + 128, this.guiTop + 51, 38, 20, GuiText.Next.getLocal() ) );
|
||||
|
||||
ItemStack myIcon = null;
|
||||
final Object target = ( (AEBaseContainer) this.inventorySlots ).getTarget();
|
||||
final Object target = this.container.getTarget();
|
||||
final IDefinitions definitions = Api.INSTANCE.definitions();
|
||||
final IParts parts = definitions.parts();
|
||||
|
||||
@@ -148,7 +149,7 @@ public class GuiCraftAmount extends AEBaseGui
|
||||
this.next.displayString = hasShiftDown() ? GuiText.Start.getLocal() : GuiText.Next.getLocal();
|
||||
|
||||
this.bindTexture( "guis/craft_amt.png" );
|
||||
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
|
||||
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, 0 /* FIXME this.zlevel was used */ );
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
@@ -25,8 +25,12 @@ import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import appeng.core.Api;
|
||||
import com.google.common.base.Joiner;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
@@ -54,11 +58,9 @@ import appeng.parts.reporting.PartTerminal;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class GuiCraftConfirm extends AEBaseGui
|
||||
public class GuiCraftConfirm extends AEBaseGui<ContainerCraftConfirm>
|
||||
{
|
||||
|
||||
private final ContainerCraftConfirm ccc;
|
||||
|
||||
private final int rows = 5;
|
||||
|
||||
private final IItemList<IAEItemStack> storage = Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||
@@ -73,17 +75,15 @@ public class GuiCraftConfirm extends AEBaseGui
|
||||
private GuiButton selectCPU;
|
||||
private int tooltip = -1;
|
||||
|
||||
public GuiCraftConfirm( final PlayerInventory PlayerInventory, final ITerminalHost te )
|
||||
{
|
||||
super( new ContainerCraftConfirm( PlayerInventory, te ) );
|
||||
public GuiCraftConfirm(ContainerCraftConfirm container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.xSize = 238;
|
||||
this.ySize = 206;
|
||||
|
||||
final GuiScrollbar scrollbar = new GuiScrollbar();
|
||||
this.setScrollBar( scrollbar );
|
||||
|
||||
this.ccc = (ContainerCraftConfirm) this.inventorySlots;
|
||||
|
||||
Object te = container.getTarget();
|
||||
if( te instanceof WirelessTerminalGuiObject )
|
||||
{
|
||||
this.OriginalGui = GuiBridge.GUI_WIRELESS_TERM;
|
||||
@@ -107,7 +107,7 @@ public class GuiCraftConfirm extends AEBaseGui
|
||||
|
||||
boolean isAutoStart()
|
||||
{
|
||||
return ( (ContainerCraftConfirm) this.inventorySlots ).isAutoStart();
|
||||
return ( (ContainerCraftConfirm) this.container ).isAutoStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -137,7 +137,7 @@ public class GuiCraftConfirm extends AEBaseGui
|
||||
{
|
||||
this.updateCPUButtonText();
|
||||
|
||||
this.start.enabled = !( this.ccc.hasNoCPU() || this.isSimulation() );
|
||||
this.start.enabled = !( this.container.hasNoCPU() || this.isSimulation() );
|
||||
this.selectCPU.enabled = !this.isSimulation();
|
||||
|
||||
final int gx = ( this.width - this.xSize ) / 2;
|
||||
@@ -177,20 +177,20 @@ public class GuiCraftConfirm extends AEBaseGui
|
||||
private void updateCPUButtonText()
|
||||
{
|
||||
String btnTextText = GuiText.CraftingCPU.getLocal() + ": " + GuiText.Automatic.getLocal();
|
||||
if( this.ccc.getSelectedCpu() >= 0 )// && status.selectedCpu < status.cpus.size() )
|
||||
if( this.container.getSelectedCpu() >= 0 )// && status.selectedCpu < status.cpus.size() )
|
||||
{
|
||||
if( this.ccc.getName().length() > 0 )
|
||||
if( this.container.getName().length() > 0 )
|
||||
{
|
||||
final String name = this.ccc.getName().substring( 0, Math.min( 20, this.ccc.getName().length() ) );
|
||||
final String name = this.container.getName().substring( 0, Math.min( 20, this.container.getName().length() ) );
|
||||
btnTextText = GuiText.CraftingCPU.getLocal() + ": " + name;
|
||||
}
|
||||
else
|
||||
{
|
||||
btnTextText = GuiText.CraftingCPU.getLocal() + ": #" + this.ccc.getSelectedCpu();
|
||||
btnTextText = GuiText.CraftingCPU.getLocal() + ": #" + this.container.getSelectedCpu();
|
||||
}
|
||||
}
|
||||
|
||||
if( this.ccc.hasNoCPU() )
|
||||
if( this.container.hasNoCPU() )
|
||||
{
|
||||
btnTextText = GuiText.NoCraftingCPUs.getLocal();
|
||||
}
|
||||
@@ -200,13 +200,13 @@ public class GuiCraftConfirm extends AEBaseGui
|
||||
|
||||
private boolean isSimulation()
|
||||
{
|
||||
return ( (ContainerCraftConfirm) this.inventorySlots ).isSimulation();
|
||||
return ( (ContainerCraftConfirm) this.container ).isSimulation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||
{
|
||||
final long BytesUsed = this.ccc.getUsedBytes();
|
||||
final long BytesUsed = this.container.getUsedBytes();
|
||||
final String byteUsed = NumberFormat.getInstance().format( BytesUsed );
|
||||
final String Add = BytesUsed > 0 ? ( byteUsed + ' ' + GuiText.BytesUsed.getLocal() ) : GuiText.CalculatingWait.getLocal();
|
||||
this.font.drawString( GuiText.CraftingPlan.getLocal() + " - " + Add, 8, 7, 4210752 );
|
||||
@@ -219,8 +219,8 @@ public class GuiCraftConfirm extends AEBaseGui
|
||||
}
|
||||
else
|
||||
{
|
||||
dsp = this.ccc.getCpuAvailableBytes() > 0 ? ( GuiText.Bytes.getLocal() + ": " + this.ccc.getCpuAvailableBytes() + " : " + GuiText.CoProcessors
|
||||
.getLocal() + ": " + this.ccc.getCpuCoProcessors() ) : GuiText.Bytes.getLocal() + ": N/A : " + GuiText.CoProcessors.getLocal() + ": N/A";
|
||||
dsp = this.container.getCpuAvailableBytes() > 0 ? ( GuiText.Bytes.getLocal() + ": " + this.container.getCpuAvailableBytes() + " : " + GuiText.CoProcessors
|
||||
.getLocal() + ": " + this.container.getCpuCoProcessors() ) : GuiText.Bytes.getLocal() + ": N/A : " + GuiText.CoProcessors.getLocal() + ": N/A";
|
||||
}
|
||||
|
||||
final int offset = ( 219 - this.font.getStringWidth( dsp ) ) / 2;
|
||||
@@ -396,7 +396,7 @@ public class GuiCraftConfirm extends AEBaseGui
|
||||
{
|
||||
this.setScrollBar();
|
||||
this.bindTexture( "guis/craftingreport.png" );
|
||||
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
|
||||
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, 0 /* FIXME this.zlevel was used */ );
|
||||
}
|
||||
|
||||
private void setScrollBar()
|
||||
|
||||
@@ -25,8 +25,11 @@ import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import appeng.core.Api;
|
||||
import com.google.common.base.Joiner;
|
||||
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
import org.apache.commons.lang3.time.DurationFormatUtils;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
@@ -54,7 +57,7 @@ import appeng.util.Platform;
|
||||
import appeng.util.ReadableNumberConverter;
|
||||
|
||||
|
||||
public class GuiCraftingCPU extends AEBaseGui implements ISortSource
|
||||
public class GuiCraftingCPU extends AEBaseGui<ContainerCraftingCPU> implements ISortSource
|
||||
{
|
||||
private static final int GUI_HEIGHT = 184;
|
||||
private static final int GUI_WIDTH = 238;
|
||||
@@ -81,8 +84,6 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
|
||||
private static final int ITEMSTACK_LEFT_OFFSET = 9;
|
||||
private static final int ITEMSTACK_TOP_OFFSET = 22;
|
||||
|
||||
private final ContainerCraftingCPU craftingCpu;
|
||||
|
||||
private IItemList<IAEItemStack> storage = Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||
private IItemList<IAEItemStack> active = Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||
private IItemList<IAEItemStack> pending = Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||
@@ -91,15 +92,8 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
|
||||
private GuiButton cancel;
|
||||
private int tooltip = -1;
|
||||
|
||||
public GuiCraftingCPU( final PlayerInventory PlayerInventory, final Object te )
|
||||
{
|
||||
this( new ContainerCraftingCPU( PlayerInventory, te ) );
|
||||
}
|
||||
|
||||
protected GuiCraftingCPU( final ContainerCraftingCPU container )
|
||||
{
|
||||
super( container );
|
||||
this.craftingCpu = container;
|
||||
public GuiCraftingCPU(ContainerCraftingCPU container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = GUI_HEIGHT;
|
||||
this.xSize = GUI_WIDTH;
|
||||
|
||||
@@ -195,9 +189,9 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
|
||||
{
|
||||
String title = this.getGuiDisplayName( GuiText.CraftingStatus.getLocal() );
|
||||
|
||||
if( this.craftingCpu.getEstimatedTime() > 0 && !this.visual.isEmpty() )
|
||||
if( this.container.getEstimatedTime() > 0 && !this.visual.isEmpty() )
|
||||
{
|
||||
final long etaInMilliseconds = TimeUnit.MILLISECONDS.convert( this.craftingCpu.getEstimatedTime(), TimeUnit.NANOSECONDS );
|
||||
final long etaInMilliseconds = TimeUnit.MILLISECONDS.convert( this.container.getEstimatedTime(), TimeUnit.NANOSECONDS );
|
||||
final String etaTimeText = DurationFormatUtils.formatDuration( etaInMilliseconds, GuiText.ETAFormat.getLocal() );
|
||||
title += " - " + etaTimeText;
|
||||
}
|
||||
@@ -345,7 +339,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
|
||||
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||
{
|
||||
this.bindTexture( "guis/craftingcpu.png" );
|
||||
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
|
||||
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, 0 /* FIXME this.zlevel was used */ );
|
||||
}
|
||||
|
||||
public void postUpdate( final List<IAEItemStack> list, final byte ref )
|
||||
|
||||
@@ -25,6 +25,9 @@ package appeng.client.gui.implementations;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import appeng.container.implementations.ContainerCraftingCPU;
|
||||
import appeng.core.Api;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
@@ -51,19 +54,16 @@ import appeng.parts.reporting.PartTerminal;
|
||||
public class GuiCraftingStatus extends GuiCraftingCPU
|
||||
{
|
||||
|
||||
private final ContainerCraftingStatus status;
|
||||
private GuiButton selectCPU;
|
||||
|
||||
private GuiTabButton originalGuiBtn;
|
||||
private GuiBridge originalGui;
|
||||
private ItemStack myIcon = ItemStack.EMPTY;
|
||||
|
||||
public GuiCraftingStatus( final PlayerInventory PlayerInventory, final ITerminalHost te )
|
||||
{
|
||||
super( new ContainerCraftingStatus( PlayerInventory, te ) );
|
||||
public GuiCraftingStatus(ContainerCraftingCPU container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
|
||||
this.status = (ContainerCraftingStatus) this.inventorySlots;
|
||||
final Object target = this.status.getTarget();
|
||||
final Object target = this.container.getTarget();
|
||||
final IDefinitions definitions = Api.INSTANCE.definitions();
|
||||
final IParts parts = definitions.parts();
|
||||
|
||||
@@ -150,20 +150,20 @@ public class GuiCraftingStatus extends GuiCraftingCPU
|
||||
{
|
||||
String btnTextText = GuiText.NoCraftingJobs.getLocal();
|
||||
|
||||
if( this.status.selectedCpu >= 0 )// && status.selectedCpu < status.cpus.size() )
|
||||
if( this.container.selectedCpu >= 0 )// && status.selectedCpu < status.cpus.size() )
|
||||
{
|
||||
if( this.status.myName.length() > 0 )
|
||||
if( this.container.myName.length() > 0 )
|
||||
{
|
||||
final String name = this.status.myName.substring( 0, Math.min( 20, this.status.myName.length() ) );
|
||||
final String name = this.container.myName.substring( 0, Math.min( 20, this.container.myName.length() ) );
|
||||
btnTextText = GuiText.CPUs.getLocal() + ": " + name;
|
||||
}
|
||||
else
|
||||
{
|
||||
btnTextText = GuiText.CPUs.getLocal() + ": #" + this.status.selectedCpu;
|
||||
btnTextText = GuiText.CPUs.getLocal() + ": #" + this.container.selectedCpu;
|
||||
}
|
||||
}
|
||||
|
||||
if( this.status.noCPU )
|
||||
if( this.container.noCPU )
|
||||
{
|
||||
btnTextText = GuiText.NoCraftingJobs.getLocal();
|
||||
}
|
||||
|
||||
@@ -34,16 +34,17 @@ import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketInventoryAction;
|
||||
import appeng.helpers.InventoryAction;
|
||||
import net.minecraft.inventory.container.Slot;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
|
||||
|
||||
public class GuiCraftingTerm extends GuiMEMonitorable
|
||||
public class GuiCraftingTerm extends GuiMEMonitorable<ContainerCraftingTerm>
|
||||
{
|
||||
|
||||
private GuiImgButton clearBtn;
|
||||
|
||||
public GuiCraftingTerm( final PlayerInventory PlayerInventory, final ITerminalHost te )
|
||||
{
|
||||
super( PlayerInventory, te, new ContainerCraftingTerm( PlayerInventory, te ) );
|
||||
public GuiCraftingTerm(ContainerCraftingTerm container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.setReservedSpace( 73 );
|
||||
}
|
||||
|
||||
@@ -55,8 +56,7 @@ public class GuiCraftingTerm extends GuiMEMonitorable
|
||||
if( this.clearBtn == btn )
|
||||
{
|
||||
Slot s = null;
|
||||
final Container c = this.inventorySlots;
|
||||
for( final Object j : c.inventorySlots )
|
||||
for( final Object j : this.container.inventorySlots )
|
||||
{
|
||||
if( j instanceof SlotCraftingMatrix )
|
||||
{
|
||||
|
||||
@@ -32,16 +32,17 @@ import appeng.core.sync.GuiBridge;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketSwitchGuis;
|
||||
import appeng.tile.storage.TileDrive;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
|
||||
public class GuiDrive extends AEBaseGui
|
||||
public class GuiDrive extends AEBaseGui<ContainerDrive>
|
||||
{
|
||||
|
||||
private GuiTabButton priority;
|
||||
|
||||
public GuiDrive( final PlayerInventory PlayerInventory, final TileDrive te )
|
||||
{
|
||||
super( new ContainerDrive( PlayerInventory, te ) );
|
||||
public GuiDrive(ContainerDrive container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 199;
|
||||
}
|
||||
|
||||
@@ -75,6 +76,6 @@ public class GuiDrive extends AEBaseGui
|
||||
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||
{
|
||||
this.bindTexture( "guis/drive.png" );
|
||||
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
|
||||
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, 0 /* FIXME this.zlevel was used */ );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ package appeng.client.gui.implementations;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
@@ -40,15 +41,14 @@ import appeng.core.sync.packets.PacketSwitchGuis;
|
||||
import appeng.parts.automation.PartFormationPlane;
|
||||
|
||||
|
||||
public class GuiFormationPlane extends GuiUpgradeable
|
||||
public class GuiFormationPlane extends GuiUpgradeable<ContainerFormationPlane>
|
||||
{
|
||||
|
||||
private GuiTabButton priority;
|
||||
private GuiImgButton placeMode;
|
||||
|
||||
public GuiFormationPlane( final PlayerInventory PlayerInventory, final PartFormationPlane te )
|
||||
{
|
||||
super( new ContainerFormationPlane( PlayerInventory, te ) );
|
||||
public GuiFormationPlane(ContainerFormationPlane container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 251;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,14 +25,15 @@ import appeng.client.gui.AEBaseGui;
|
||||
import appeng.container.implementations.ContainerGrinder;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.tile.grindstone.TileGrinder;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
|
||||
public class GuiGrinder extends AEBaseGui
|
||||
public class GuiGrinder extends AEBaseGui<ContainerGrinder>
|
||||
{
|
||||
|
||||
public GuiGrinder( final PlayerInventory PlayerInventory, final TileGrinder te )
|
||||
{
|
||||
super( new ContainerGrinder( PlayerInventory, te ) );
|
||||
public GuiGrinder(ContainerGrinder container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 176;
|
||||
}
|
||||
|
||||
@@ -47,6 +48,6 @@ public class GuiGrinder extends AEBaseGui
|
||||
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||
{
|
||||
this.bindTexture( "guis/grinder.png" );
|
||||
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
|
||||
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, 0 /* FIXME this.zlevel was used */ );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,8 @@ package appeng.client.gui.implementations;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import appeng.core.Api;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
@@ -40,15 +42,14 @@ import appeng.core.sync.packets.PacketConfigButton;
|
||||
import appeng.tile.storage.TileIOPort;
|
||||
|
||||
|
||||
public class GuiIOPort extends GuiUpgradeable
|
||||
public class GuiIOPort extends GuiUpgradeable<ContainerIOPort>
|
||||
{
|
||||
|
||||
private GuiImgButton fullMode;
|
||||
private GuiImgButton operationMode;
|
||||
|
||||
public GuiIOPort( final PlayerInventory PlayerInventory, final TileIOPort te )
|
||||
{
|
||||
super( new ContainerIOPort( PlayerInventory, te ) );
|
||||
public GuiIOPort(ContainerIOPort container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 166;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,25 +28,24 @@ import appeng.container.implementations.ContainerInscriber;
|
||||
import appeng.container.implementations.ContainerUpgradeable;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.tile.misc.TileInscriber;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
|
||||
public class GuiInscriber extends AEBaseGui
|
||||
public class GuiInscriber extends AEBaseGui<ContainerInscriber>
|
||||
{
|
||||
|
||||
private final ContainerInscriber cvc;
|
||||
private GuiProgressBar pb;
|
||||
|
||||
public GuiInscriber( final PlayerInventory PlayerInventory, final TileInscriber te )
|
||||
{
|
||||
super( new ContainerInscriber( PlayerInventory, te ) );
|
||||
this.cvc = (ContainerInscriber) this.inventorySlots;
|
||||
public GuiInscriber(ContainerInscriber container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 176;
|
||||
this.xSize = this.hasToolbox() ? 246 : 211;
|
||||
}
|
||||
|
||||
private boolean hasToolbox()
|
||||
{
|
||||
return ( (ContainerUpgradeable) this.inventorySlots ).hasToolbox();
|
||||
return this.container.hasToolbox();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -54,14 +53,14 @@ public class GuiInscriber extends AEBaseGui
|
||||
{
|
||||
super.init();
|
||||
|
||||
this.pb = new GuiProgressBar( this.cvc, "guis/inscriber.png", 135, 39, 135, 177, 6, 18, Direction.VERTICAL );
|
||||
this.pb = new GuiProgressBar( this.container, "guis/inscriber.png", 135, 39, 135, 177, 6, 18, Direction.VERTICAL );
|
||||
this.addButton( this.pb );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||
{
|
||||
this.pb.setFullMsg( this.cvc.getCurrentProgress() * 100 / this.cvc.getMaxProgress() + "%" );
|
||||
this.pb.setFullMsg( this.container.getCurrentProgress() * 100 / this.container.getMaxProgress() + "%" );
|
||||
|
||||
this.font.drawString( this.getGuiDisplayName( GuiText.Inscriber.getLocal() ), 8, 6, 4210752 );
|
||||
this.font.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||
@@ -74,15 +73,15 @@ public class GuiInscriber extends AEBaseGui
|
||||
this.pb.x = 135 + this.guiLeft;
|
||||
this.pb.y = 39 + this.guiTop;
|
||||
|
||||
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, 211 - 34, this.ySize );
|
||||
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, 211 - 34, this.ySize, 0 /* FIXME this.zlevel was used */ );
|
||||
|
||||
if( this.drawUpgrades() )
|
||||
{
|
||||
this.drawTexturedModalRect( offsetX + 177, offsetY, 177, 0, 35, 14 + this.cvc.availableUpgrades() * 18 );
|
||||
GuiUtils.drawTexturedModalRect( offsetX + 177, offsetY, 177, 0, 35, 14 + this.container.availableUpgrades() * 18, 0 /* FIXME this.zlevel was used */ );
|
||||
}
|
||||
if( this.hasToolbox() )
|
||||
{
|
||||
this.drawTexturedModalRect( offsetX + 178, offsetY + this.ySize - 90, 178, this.ySize - 90, 68, 68 );
|
||||
GuiUtils.drawTexturedModalRect( offsetX + 178, offsetY + this.ySize - 90, 178, this.ySize - 90, 68, 68, 0 /* FIXME this.zlevel was used */ );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ package appeng.client.gui.implementations;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
@@ -40,16 +41,15 @@ import appeng.core.sync.packets.PacketSwitchGuis;
|
||||
import appeng.helpers.IInterfaceHost;
|
||||
|
||||
|
||||
public class GuiInterface extends GuiUpgradeable
|
||||
public class GuiInterface extends GuiUpgradeable<ContainerInterface>
|
||||
{
|
||||
|
||||
private GuiTabButton priority;
|
||||
private GuiImgButton BlockMode;
|
||||
private GuiToggleButton interfaceMode;
|
||||
|
||||
public GuiInterface( final PlayerInventory PlayerInventory, final IInterfaceHost te )
|
||||
{
|
||||
super( new ContainerInterface( PlayerInventory, te ) );
|
||||
public GuiInterface(ContainerInterface container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 211;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,9 +31,11 @@ import java.util.WeakHashMap;
|
||||
|
||||
import com.google.common.collect.HashMultimap;
|
||||
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.inventory.container.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.nbt.ListNBT;
|
||||
@@ -48,9 +50,11 @@ import appeng.container.implementations.ContainerInterfaceTerminal;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.parts.reporting.PartInterfaceTerminal;
|
||||
import appeng.util.Platform;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
|
||||
public class GuiInterfaceTerminal extends AEBaseGui
|
||||
public class GuiInterfaceTerminal extends AEBaseGui<ContainerInterfaceTerminal>
|
||||
{
|
||||
|
||||
private static final int LINES_ON_PAGE = 6;
|
||||
@@ -68,10 +72,8 @@ public class GuiInterfaceTerminal extends AEBaseGui
|
||||
private boolean refreshList = false;
|
||||
private MEGuiTextField searchField;
|
||||
|
||||
public GuiInterfaceTerminal( final PlayerInventory PlayerInventory, final PartInterfaceTerminal te )
|
||||
{
|
||||
super( new ContainerInterfaceTerminal( PlayerInventory, te ) );
|
||||
|
||||
public GuiInterfaceTerminal(ContainerInterfaceTerminal container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
final GuiScrollbar scrollbar = new GuiScrollbar();
|
||||
this.setScrollBar( scrollbar );
|
||||
this.xSize = 195;
|
||||
@@ -103,7 +105,7 @@ public class GuiInterfaceTerminal extends AEBaseGui
|
||||
|
||||
final int ex = this.getScrollBar().getCurrentScroll();
|
||||
|
||||
final Iterator<Slot> o = this.inventorySlots.inventorySlots.iterator();
|
||||
final Iterator<Slot> o = this.container.inventorySlots.iterator();
|
||||
while( o.hasNext() )
|
||||
{
|
||||
if( o.next() instanceof SlotDisconnected )
|
||||
@@ -121,7 +123,7 @@ public class GuiInterfaceTerminal extends AEBaseGui
|
||||
final ClientDCInternalInv inv = (ClientDCInternalInv) lineObj;
|
||||
for( int z = 0; z < inv.getInventory().getSlots(); z++ )
|
||||
{
|
||||
this.inventorySlots.inventorySlots.add( new SlotDisconnected( inv, z, z * 18 + 8, 1 + offset ) );
|
||||
this.container.inventorySlots.add( new SlotDisconnected( inv, z, z * 18 + 8, 1 + offset ) );
|
||||
}
|
||||
}
|
||||
else if( lineObj instanceof String )
|
||||
@@ -162,7 +164,7 @@ public class GuiInterfaceTerminal extends AEBaseGui
|
||||
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||
{
|
||||
this.bindTexture( "guis/interfaceterminal.png" );
|
||||
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
|
||||
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, 0 /* FIXME this.zlevel was used */ );
|
||||
|
||||
int offset = 17;
|
||||
final int ex = this.getScrollBar().getCurrentScroll();
|
||||
@@ -176,7 +178,7 @@ public class GuiInterfaceTerminal extends AEBaseGui
|
||||
|
||||
RenderSystem.color4f( 1, 1, 1, 1 );
|
||||
final int width = inv.getInventory().getSlots() * 18;
|
||||
this.drawTexturedModalRect( offsetX + 7, offsetY + offset, 7, 139, width, 18 );
|
||||
GuiUtils.drawTexturedModalRect( offsetX + 7, offsetY + offset, 7, 139, width, 18, 0 /* FIXME this.zlevel was used */ );
|
||||
}
|
||||
offset += 18;
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ package appeng.client.gui.implementations;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
@@ -44,7 +45,7 @@ import appeng.core.sync.packets.PacketValueConfig;
|
||||
import appeng.parts.automation.PartLevelEmitter;
|
||||
|
||||
|
||||
public class GuiLevelEmitter extends GuiUpgradeable
|
||||
public class GuiLevelEmitter extends GuiUpgradeable<ContainerLevelEmitter>
|
||||
{
|
||||
|
||||
private GuiNumberBox level;
|
||||
@@ -61,9 +62,8 @@ public class GuiLevelEmitter extends GuiUpgradeable
|
||||
private GuiImgButton levelMode;
|
||||
private GuiImgButton craftingMode;
|
||||
|
||||
public GuiLevelEmitter( final PlayerInventory PlayerInventory, final PartLevelEmitter te )
|
||||
{
|
||||
super( new ContainerLevelEmitter( PlayerInventory, te ) );
|
||||
public GuiLevelEmitter(ContainerLevelEmitter container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -77,7 +77,7 @@ public class GuiLevelEmitter extends GuiUpgradeable
|
||||
this.level.setTextColor( 0xFFFFFF );
|
||||
this.level.setVisible( true );
|
||||
this.level.setFocused2( true );
|
||||
( (ContainerLevelEmitter) this.inventorySlots ).setTextField( this.level );
|
||||
container.setTextField( this.level );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -29,19 +29,17 @@ import appeng.client.gui.widgets.GuiProgressBar.Direction;
|
||||
import appeng.container.implementations.ContainerMAC;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.tile.crafting.TileMolecularAssembler;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
|
||||
|
||||
public class GuiMAC extends GuiUpgradeable
|
||||
public class GuiMAC extends GuiUpgradeable<ContainerMAC>
|
||||
{
|
||||
|
||||
private final ContainerMAC container;
|
||||
private GuiProgressBar pb;
|
||||
|
||||
public GuiMAC( final PlayerInventory PlayerInventory, final TileMolecularAssembler te )
|
||||
{
|
||||
super( new ContainerMAC( PlayerInventory, te ) );
|
||||
public GuiMAC(ContainerMAC container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 197;
|
||||
this.container = (ContainerMAC) this.inventorySlots;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -22,6 +22,8 @@ package appeng.client.gui.implementations;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
@@ -69,7 +71,7 @@ import appeng.util.IConfigManagerHost;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfigManagerHost
|
||||
public class GuiMEMonitorable<T extends ContainerMEMonitorable> extends AEBaseMEGui<T> implements ISortSource, IConfigManagerHost
|
||||
{
|
||||
|
||||
private static int craftingGridOffsetX;
|
||||
@@ -82,7 +84,6 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
private final IConfigManager configSrc;
|
||||
private final boolean viewCell;
|
||||
private final ItemStack[] myCurrentViewCells = new ItemStack[5];
|
||||
private final ContainerMEMonitorable monitorableContainer;
|
||||
private GuiTabButton craftingStatusBtn;
|
||||
private MEGuiTextField searchField;
|
||||
private GuiText myName;
|
||||
@@ -101,15 +102,8 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
private int currentMouseX = 0;
|
||||
private int currentMouseY = 0;
|
||||
|
||||
public GuiMEMonitorable( final PlayerInventory PlayerInventory, final ITerminalHost te )
|
||||
{
|
||||
this( PlayerInventory, te, new ContainerMEMonitorable( PlayerInventory, te ) );
|
||||
}
|
||||
|
||||
public GuiMEMonitorable( final PlayerInventory PlayerInventory, final ITerminalHost te, final ContainerMEMonitorable c )
|
||||
{
|
||||
|
||||
super( c );
|
||||
public GuiMEMonitorable(T container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
|
||||
final GuiScrollbar scrollbar = new GuiScrollbar();
|
||||
this.setScrollBar( scrollbar );
|
||||
@@ -118,6 +112,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
this.xSize = 185;
|
||||
this.ySize = 204;
|
||||
|
||||
Object te = container.getTarget();
|
||||
if( te instanceof IViewCellStorage )
|
||||
{
|
||||
this.xSize += 33;
|
||||
@@ -125,8 +120,8 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
|
||||
this.standardSize = this.xSize;
|
||||
|
||||
this.configSrc = ( (IConfigurableObject) this.inventorySlots ).getConfigManager();
|
||||
( this.monitorableContainer = (ContainerMEMonitorable) this.inventorySlots ).setGui( this );
|
||||
this.configSrc = ( (IConfigurableObject) this.container ).getConfigManager();
|
||||
this.container.setGui( this );
|
||||
|
||||
this.viewCell = te instanceof IViewCellStorage;
|
||||
|
||||
@@ -350,7 +345,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
craftingGridOffsetX = Integer.MAX_VALUE;
|
||||
craftingGridOffsetY = Integer.MAX_VALUE;
|
||||
|
||||
for( final Object s : this.inventorySlots.inventorySlots )
|
||||
for( final Object s : this.container.inventorySlots )
|
||||
{
|
||||
if( s instanceof AppEngSlot )
|
||||
{
|
||||
@@ -416,20 +411,20 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
|
||||
this.bindTexture( this.getBackground() );
|
||||
final int x_width = 197;
|
||||
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, x_width, 18 );
|
||||
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, x_width, 18, 0 /* FIXME this.zlevel was used */ );
|
||||
|
||||
if( this.viewCell || ( this instanceof GuiSecurityStation ) )
|
||||
{
|
||||
this.drawTexturedModalRect( offsetX + x_width, offsetY, x_width, 0, 46, 128 );
|
||||
GuiUtils.drawTexturedModalRect( offsetX + x_width, offsetY, x_width, 0, 46, 128, 0 /* FIXME this.zlevel was used */ );
|
||||
}
|
||||
|
||||
for( int x = 0; x < this.rows; x++ )
|
||||
{
|
||||
this.drawTexturedModalRect( offsetX, offsetY + 18 + x * 18, 0, 18, x_width, 18 );
|
||||
GuiUtils.drawTexturedModalRect( offsetX, offsetY + 18 + x * 18, 0, 18, x_width, 18, 0 /* FIXME this.zlevel was used */ );
|
||||
}
|
||||
|
||||
this.drawTexturedModalRect( offsetX, offsetY + 16 + this.rows * 18 + this.lowerTextureOffset, 0, 106 - 18 - 18, x_width,
|
||||
99 + this.reservedSpace - this.lowerTextureOffset );
|
||||
GuiUtils.drawTexturedModalRect( offsetX, offsetY + 16 + this.rows * 18 + this.lowerTextureOffset, 0, 106 - 18 - 18, x_width,
|
||||
99 + this.reservedSpace - this.lowerTextureOffset, 0 /* FIXME this.zlevel was used */ );
|
||||
|
||||
if( this.viewCell )
|
||||
{
|
||||
@@ -437,10 +432,10 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
|
||||
for( int i = 0; i < 5; i++ )
|
||||
{
|
||||
if( this.myCurrentViewCells[i] != this.monitorableContainer.getCellViewSlot( i ).getStack() )
|
||||
if( this.myCurrentViewCells[i] != this.container.getCellViewSlot( i ).getStack() )
|
||||
{
|
||||
update = true;
|
||||
this.myCurrentViewCells[i] = this.monitorableContainer.getCellViewSlot( i ).getStack();
|
||||
this.myCurrentViewCells[i] = this.container.getCellViewSlot( i ).getStack();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -525,7 +520,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
@Override
|
||||
public void updateScreen()
|
||||
{
|
||||
this.repo.setPower( this.monitorableContainer.isPowered() );
|
||||
this.repo.setPower( this.container.isPowered() );
|
||||
super.updateScreen();
|
||||
}
|
||||
|
||||
|
||||
@@ -23,19 +23,14 @@ import net.minecraft.entity.player.PlayerInventory;
|
||||
|
||||
import appeng.api.implementations.guiobjects.IPortableCell;
|
||||
import appeng.container.implementations.ContainerMEPortableCell;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
|
||||
|
||||
public class GuiMEPortableCell extends GuiMEMonitorable
|
||||
public class GuiMEPortableCell extends GuiMEMonitorable<ContainerMEPortableCell>
|
||||
{
|
||||
|
||||
public GuiMEPortableCell( final PlayerInventory PlayerInventory, final IPortableCell te )
|
||||
{
|
||||
super( PlayerInventory, te, new ContainerMEPortableCell( PlayerInventory, te ) );
|
||||
}
|
||||
|
||||
int defaultGetMaxRows()
|
||||
{
|
||||
return super.getMaxRows();
|
||||
public GuiMEPortableCell(ContainerMEPortableCell container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -22,6 +22,8 @@ package appeng.client.gui.implementations;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
@@ -49,7 +51,7 @@ import appeng.core.localization.GuiText;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class GuiNetworkStatus extends AEBaseGui implements ISortSource
|
||||
public class GuiNetworkStatus extends AEBaseGui<ContainerNetworkStatus> implements ISortSource
|
||||
{
|
||||
|
||||
private final ItemRepo repo;
|
||||
@@ -57,9 +59,8 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
|
||||
private GuiImgButton units;
|
||||
private int tooltip = -1;
|
||||
|
||||
public GuiNetworkStatus( final PlayerInventory PlayerInventory, final INetworkTool te )
|
||||
{
|
||||
super( new ContainerNetworkStatus( PlayerInventory, te ) );
|
||||
public GuiNetworkStatus(ContainerNetworkStatus container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
final GuiScrollbar scrollbar = new GuiScrollbar();
|
||||
|
||||
this.setScrollBar( scrollbar );
|
||||
@@ -132,16 +133,14 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
|
||||
@Override
|
||||
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||
{
|
||||
final ContainerNetworkStatus ns = (ContainerNetworkStatus) this.inventorySlots;
|
||||
|
||||
this.font.drawString( GuiText.NetworkDetails.getLocal(), 8, 6, 4210752 );
|
||||
|
||||
this.font.drawString( GuiText.StoredPower.getLocal() + ": " + Platform.formatPowerLong( ns.getCurrentPower(), false ), 13, 16, 4210752 );
|
||||
this.font.drawString( GuiText.MaxPower.getLocal() + ": " + Platform.formatPowerLong( ns.getMaxPower(), false ), 13, 26, 4210752 );
|
||||
this.font.drawString( GuiText.StoredPower.getLocal() + ": " + Platform.formatPowerLong( container.getCurrentPower(), false ), 13, 16, 4210752 );
|
||||
this.font.drawString( GuiText.MaxPower.getLocal() + ": " + Platform.formatPowerLong( container.getMaxPower(), false ), 13, 26, 4210752 );
|
||||
|
||||
this.font.drawString( GuiText.PowerInputRate.getLocal() + ": " + Platform.formatPowerLong( ns.getAverageAddition(), true ), 13, 143 - 10,
|
||||
this.font.drawString( GuiText.PowerInputRate.getLocal() + ": " + Platform.formatPowerLong( container.getAverageAddition(), true ), 13, 143 - 10,
|
||||
4210752 );
|
||||
this.font.drawString( GuiText.PowerUsageRate.getLocal() + ": " + Platform.formatPowerLong( ns.getPowerUsage(), true ), 13, 143 - 20, 4210752 );
|
||||
this.font.drawString( GuiText.PowerUsageRate.getLocal() + ": " + Platform.formatPowerLong( container.getPowerUsage(), true ), 13, 143 - 20, 4210752 );
|
||||
|
||||
final int sectionLength = 30;
|
||||
|
||||
@@ -214,7 +213,7 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
|
||||
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||
{
|
||||
this.bindTexture( "guis/networkstatus.png" );
|
||||
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
|
||||
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, 0 /* FIXME this.zlevel was used */ );
|
||||
}
|
||||
|
||||
public void postUpdate( final List<IAEItemStack> list )
|
||||
|
||||
@@ -32,16 +32,17 @@ import appeng.core.AELog;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
|
||||
public class GuiNetworkTool extends AEBaseGui
|
||||
public class GuiNetworkTool extends AEBaseGui<ContainerNetworkTool>
|
||||
{
|
||||
|
||||
private GuiToggleButton tFacades;
|
||||
|
||||
public GuiNetworkTool( final PlayerInventory PlayerInventory, final INetworkTool te )
|
||||
{
|
||||
super( new ContainerNetworkTool( PlayerInventory, te ) );
|
||||
public GuiNetworkTool(ContainerNetworkTool container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 166;
|
||||
}
|
||||
|
||||
@@ -79,7 +80,7 @@ public class GuiNetworkTool extends AEBaseGui
|
||||
{
|
||||
if( this.tFacades != null )
|
||||
{
|
||||
this.tFacades.setState( ( (ContainerNetworkTool) this.inventorySlots ).isFacadeMode() );
|
||||
this.tFacades.setState( container.isFacadeMode() );
|
||||
}
|
||||
|
||||
this.font.drawString( this.getGuiDisplayName( GuiText.NetworkTool.getLocal() ), 8, 6, 4210752 );
|
||||
@@ -90,6 +91,6 @@ public class GuiNetworkTool extends AEBaseGui
|
||||
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||
{
|
||||
this.bindTexture( "guis/toolbox.png" );
|
||||
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
|
||||
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, 0 /* FIXME this.zlevel was used */ );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,9 +38,10 @@ import appeng.core.AELog;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
|
||||
|
||||
public class GuiPatternTerm extends GuiMEMonitorable
|
||||
public class GuiPatternTerm extends GuiMEMonitorable<ContainerPatternTerm>
|
||||
{
|
||||
|
||||
private static final String BACKGROUND_CRAFTING_MODE = "guis/pattern.png";
|
||||
@@ -52,8 +53,6 @@ public class GuiPatternTerm extends GuiMEMonitorable
|
||||
private static final String CRAFTMODE_CRFTING = "1";
|
||||
private static final String CRAFTMODE_PROCESSING = "0";
|
||||
|
||||
private final ContainerPatternTerm container;
|
||||
|
||||
private GuiTabButton tabCraftButton;
|
||||
private GuiTabButton tabProcessButton;
|
||||
private GuiImgButton substitutionsEnabledBtn;
|
||||
@@ -61,10 +60,8 @@ public class GuiPatternTerm extends GuiMEMonitorable
|
||||
private GuiImgButton encodeBtn;
|
||||
private GuiImgButton clearBtn;
|
||||
|
||||
public GuiPatternTerm( final PlayerInventory PlayerInventory, final ITerminalHost te )
|
||||
{
|
||||
super( PlayerInventory, te, new ContainerPatternTerm( PlayerInventory, te ) );
|
||||
this.container = (ContainerPatternTerm) this.inventorySlots;
|
||||
public GuiPatternTerm(ContainerPatternTerm container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.setReservedSpace( 81 );
|
||||
}
|
||||
|
||||
|
||||
@@ -37,9 +37,11 @@ import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketSwitchGuis;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
import appeng.helpers.IPriorityHost;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
|
||||
public class GuiPriority extends AEBaseGui
|
||||
public class GuiPriority extends AEBaseGui<ContainerPriority>
|
||||
{
|
||||
|
||||
private GuiNumberBox priority;
|
||||
@@ -56,9 +58,8 @@ public class GuiPriority extends AEBaseGui
|
||||
|
||||
private GuiBridge OriginalGui;
|
||||
|
||||
public GuiPriority( final PlayerInventory PlayerInventory, final IPriorityHost te )
|
||||
{
|
||||
super( new ContainerPriority( PlayerInventory, te ) );
|
||||
public GuiPriority(ContainerPriority container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -81,9 +82,8 @@ public class GuiPriority extends AEBaseGui
|
||||
this.addButton( this.minus100 = new GuiButton( 0, this.guiLeft + 82, this.guiTop + 69, 32, 20, "-" + c ) );
|
||||
this.addButton( this.minus1000 = new GuiButton( 0, this.guiLeft + 120, this.guiTop + 69, 38, 20, "-" + d ) );
|
||||
|
||||
final ContainerPriority con = ( (ContainerPriority) this.inventorySlots );
|
||||
final ItemStack myIcon = con.getPriorityHost().getItemStackRepresentation();
|
||||
this.OriginalGui = con.getPriorityHost().getGuiBridge();
|
||||
final ItemStack myIcon = container.getPriorityHost().getItemStackRepresentation();
|
||||
this.OriginalGui = container.getPriorityHost().getGuiBridge();
|
||||
|
||||
if( this.OriginalGui != null && !myIcon.isEmpty() )
|
||||
{
|
||||
@@ -96,7 +96,7 @@ public class GuiPriority extends AEBaseGui
|
||||
this.priority.setTextColor( 0xFFFFFF );
|
||||
this.priority.setVisible( true );
|
||||
this.priority.setFocused2( true );
|
||||
( (ContainerPriority) this.inventorySlots ).setTextField( this.priority );
|
||||
container.setTextField( this.priority );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -109,7 +109,7 @@ public class GuiPriority extends AEBaseGui
|
||||
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||
{
|
||||
this.bindTexture( "guis/priority.png" );
|
||||
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
|
||||
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, 0 /* FIXME this.zlevel was used */ );
|
||||
|
||||
this.priority.drawTextBox();
|
||||
}
|
||||
|
||||
@@ -25,14 +25,15 @@ import appeng.client.gui.AEBaseGui;
|
||||
import appeng.container.implementations.ContainerQNB;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.tile.qnb.TileQuantumBridge;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
|
||||
public class GuiQNB extends AEBaseGui
|
||||
public class GuiQNB extends AEBaseGui<ContainerQNB>
|
||||
{
|
||||
|
||||
public GuiQNB( final PlayerInventory PlayerInventory, final TileQuantumBridge te )
|
||||
{
|
||||
super( new ContainerQNB( PlayerInventory, te ) );
|
||||
public GuiQNB(ContainerQNB container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 166;
|
||||
}
|
||||
|
||||
@@ -47,6 +48,6 @@ public class GuiQNB extends AEBaseGui
|
||||
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||
{
|
||||
this.bindTexture( "guis/chest.png" );
|
||||
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
|
||||
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, 0 /* FIXME this.zlevel was used */ );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,16 +31,17 @@ import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
import appeng.items.contents.QuartzKnifeObj;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
|
||||
public class GuiQuartzKnife extends AEBaseGui
|
||||
public class GuiQuartzKnife extends AEBaseGui<ContainerQuartzKnife>
|
||||
{
|
||||
|
||||
private GuiTextField name;
|
||||
|
||||
public GuiQuartzKnife( final PlayerInventory PlayerInventory, final QuartzKnifeObj te )
|
||||
{
|
||||
super( new ContainerQuartzKnife( PlayerInventory, te ) );
|
||||
public GuiQuartzKnife(ContainerQuartzKnife container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 184;
|
||||
}
|
||||
|
||||
@@ -68,7 +69,7 @@ public class GuiQuartzKnife extends AEBaseGui
|
||||
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||
{
|
||||
this.bindTexture( "guis/quartzknife.png" );
|
||||
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
|
||||
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, 0 /* FIXME this.zlevel was used */ );
|
||||
this.name.drawTextBox();
|
||||
}
|
||||
|
||||
@@ -80,7 +81,7 @@ public class GuiQuartzKnife extends AEBaseGui
|
||||
try
|
||||
{
|
||||
final String Out = this.name.getText();
|
||||
( (ContainerQuartzKnife) this.inventorySlots ).setName( Out );
|
||||
container.setName( Out );
|
||||
NetworkHandler.instance().sendToServer( new PacketValueConfig( "QuartzKnife.Name", Out ) );
|
||||
}
|
||||
catch( final IOException e )
|
||||
|
||||
@@ -32,9 +32,10 @@ import appeng.core.AELog;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
|
||||
|
||||
public class GuiSecurityStation extends GuiMEMonitorable
|
||||
public class GuiSecurityStation extends GuiMEMonitorable<ContainerSecurityStation>
|
||||
{
|
||||
|
||||
private GuiToggleButton inject;
|
||||
@@ -43,9 +44,8 @@ public class GuiSecurityStation extends GuiMEMonitorable
|
||||
private GuiToggleButton build;
|
||||
private GuiToggleButton security;
|
||||
|
||||
public GuiSecurityStation( final PlayerInventory PlayerInventory, final ITerminalHost te )
|
||||
{
|
||||
super( PlayerInventory, te, new ContainerSecurityStation( PlayerInventory, te ) );
|
||||
public GuiSecurityStation(ContainerSecurityStation container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.setCustomSortOrder( false );
|
||||
this.setReservedSpace( 33 );
|
||||
|
||||
@@ -127,13 +127,11 @@ public class GuiSecurityStation extends GuiMEMonitorable
|
||||
@Override
|
||||
protected String getBackground()
|
||||
{
|
||||
final ContainerSecurityStation cs = (ContainerSecurityStation) this.inventorySlots;
|
||||
|
||||
this.inject.setState( ( cs.getPermissionMode() & ( 1 << SecurityPermissions.INJECT.ordinal() ) ) > 0 );
|
||||
this.extract.setState( ( cs.getPermissionMode() & ( 1 << SecurityPermissions.EXTRACT.ordinal() ) ) > 0 );
|
||||
this.craft.setState( ( cs.getPermissionMode() & ( 1 << SecurityPermissions.CRAFT.ordinal() ) ) > 0 );
|
||||
this.build.setState( ( cs.getPermissionMode() & ( 1 << SecurityPermissions.BUILD.ordinal() ) ) > 0 );
|
||||
this.security.setState( ( cs.getPermissionMode() & ( 1 << SecurityPermissions.SECURITY.ordinal() ) ) > 0 );
|
||||
this.inject.setState( ( container.getPermissionMode() & ( 1 << SecurityPermissions.INJECT.ordinal() ) ) > 0 );
|
||||
this.extract.setState( ( container.getPermissionMode() & ( 1 << SecurityPermissions.EXTRACT.ordinal() ) ) > 0 );
|
||||
this.craft.setState( ( container.getPermissionMode() & ( 1 << SecurityPermissions.CRAFT.ordinal() ) ) > 0 );
|
||||
this.build.setState( ( container.getPermissionMode() & ( 1 << SecurityPermissions.BUILD.ordinal() ) ) > 0 );
|
||||
this.security.setState( ( container.getPermissionMode() & ( 1 << SecurityPermissions.SECURITY.ordinal() ) ) > 0 );
|
||||
|
||||
return "guis/security_station.png";
|
||||
}
|
||||
|
||||
@@ -21,6 +21,8 @@ package appeng.client.gui.implementations;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
@@ -36,17 +38,14 @@ import appeng.tile.spatial.TileSpatialIOPort;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class GuiSpatialIOPort extends AEBaseGui
|
||||
public class GuiSpatialIOPort extends AEBaseGui<ContainerSpatialIOPort>
|
||||
{
|
||||
|
||||
private final ContainerSpatialIOPort container;
|
||||
private GuiImgButton units;
|
||||
|
||||
public GuiSpatialIOPort( final PlayerInventory PlayerInventory, final TileSpatialIOPort te )
|
||||
{
|
||||
super( new ContainerSpatialIOPort( PlayerInventory, te ) );
|
||||
public GuiSpatialIOPort(ContainerSpatialIOPort container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 199;
|
||||
this.container = (ContainerSpatialIOPort) this.inventorySlots;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -101,6 +100,6 @@ public class GuiSpatialIOPort extends AEBaseGui
|
||||
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||
{
|
||||
this.bindTexture( "guis/spatialio.png" );
|
||||
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
|
||||
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, 0 /* FIXME this.zlevel was used */ );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ package appeng.client.gui.implementations;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
@@ -44,7 +45,7 @@ import appeng.core.sync.packets.PacketValueConfig;
|
||||
import appeng.parts.misc.PartStorageBus;
|
||||
|
||||
|
||||
public class GuiStorageBus extends GuiUpgradeable
|
||||
public class GuiStorageBus extends GuiUpgradeable<ContainerStorageBus>
|
||||
{
|
||||
|
||||
private GuiImgButton rwMode;
|
||||
@@ -53,9 +54,8 @@ public class GuiStorageBus extends GuiUpgradeable
|
||||
private GuiImgButton partition;
|
||||
private GuiImgButton clear;
|
||||
|
||||
public GuiStorageBus( final PlayerInventory PlayerInventory, final PartStorageBus te )
|
||||
{
|
||||
super( new ContainerStorageBus( PlayerInventory, te ) );
|
||||
public GuiStorageBus(ContainerStorageBus container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 251;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,9 +21,6 @@ package appeng.client.gui.implementations;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
|
||||
import appeng.api.config.FuzzyMode;
|
||||
@@ -41,9 +38,11 @@ import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketConfigButton;
|
||||
import appeng.parts.automation.PartExportBus;
|
||||
import appeng.parts.automation.PartImportBus;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
|
||||
public class GuiUpgradeable extends AEBaseGui
|
||||
public class GuiUpgradeable<T extends ContainerUpgradeable> extends AEBaseGui<T>
|
||||
{
|
||||
|
||||
protected final ContainerUpgradeable cvb;
|
||||
@@ -54,17 +53,11 @@ public class GuiUpgradeable extends AEBaseGui
|
||||
protected GuiImgButton craftMode;
|
||||
protected GuiImgButton schedulingMode;
|
||||
|
||||
public GuiUpgradeable( final PlayerInventory PlayerInventory, final IUpgradeableHost te )
|
||||
{
|
||||
this( new ContainerUpgradeable( PlayerInventory, te ) );
|
||||
}
|
||||
public GuiUpgradeable(T container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.cvb = container;
|
||||
|
||||
public GuiUpgradeable( final ContainerUpgradeable te )
|
||||
{
|
||||
super( te );
|
||||
this.cvb = te;
|
||||
|
||||
this.bc = (IUpgradeableHost) te.getTarget();
|
||||
this.bc = (IUpgradeableHost) container.getTarget();
|
||||
this.xSize = this.hasToolbox() ? 246 : 211;
|
||||
this.ySize = 184;
|
||||
}
|
||||
@@ -127,14 +120,14 @@ public class GuiUpgradeable extends AEBaseGui
|
||||
this.handleButtonVisibility();
|
||||
|
||||
this.bindTexture( this.getBackground() );
|
||||
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, 211 - 34, this.ySize );
|
||||
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, 211 - 34, this.ySize, 0 /* FIXME this.zlevel was used */ );
|
||||
if( this.drawUpgrades() )
|
||||
{
|
||||
this.drawTexturedModalRect( offsetX + 177, offsetY, 177, 0, 35, 14 + this.cvb.availableUpgrades() * 18 );
|
||||
GuiUtils.drawTexturedModalRect( offsetX + 177, offsetY, 177, 0, 35, 14 + this.cvb.availableUpgrades() * 18, 0 /* FIXME this.zlevel was used */ );
|
||||
}
|
||||
if( this.hasToolbox() )
|
||||
{
|
||||
this.drawTexturedModalRect( offsetX + 178, offsetY + this.ySize - 90, 178, this.ySize - 90, 68, 68 );
|
||||
GuiUtils.drawTexturedModalRect( offsetX + 178, offsetY + this.ySize - 90, 178, this.ySize - 90, 68, 68, 0 /* FIXME this.zlevel was used */ );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
package appeng.client.gui.implementations;
|
||||
|
||||
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
@@ -28,18 +28,17 @@ import appeng.client.gui.widgets.GuiProgressBar.Direction;
|
||||
import appeng.container.implementations.ContainerVibrationChamber;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.tile.misc.TileVibrationChamber;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
|
||||
public class GuiVibrationChamber extends AEBaseGui
|
||||
public class GuiVibrationChamber extends AEBaseGui<ContainerVibrationChamber>
|
||||
{
|
||||
|
||||
private final ContainerVibrationChamber cvc;
|
||||
private GuiProgressBar pb;
|
||||
|
||||
public GuiVibrationChamber( final PlayerInventory PlayerInventory, final TileVibrationChamber te )
|
||||
{
|
||||
super( new ContainerVibrationChamber( PlayerInventory, te ) );
|
||||
this.cvc = (ContainerVibrationChamber) this.inventorySlots;
|
||||
public GuiVibrationChamber(ContainerVibrationChamber container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 166;
|
||||
}
|
||||
|
||||
@@ -48,7 +47,7 @@ public class GuiVibrationChamber extends AEBaseGui
|
||||
{
|
||||
super.init();
|
||||
|
||||
this.pb = new GuiProgressBar( this.cvc, "guis/vibchamber.png", 99, 36, 176, 14, 6, 18, Direction.VERTICAL );
|
||||
this.pb = new GuiProgressBar( this.container, "guis/vibchamber.png", 99, 36, 176, 14, 6, 18, Direction.VERTICAL );
|
||||
this.addButton( this.pb );
|
||||
}
|
||||
|
||||
@@ -58,16 +57,16 @@ public class GuiVibrationChamber extends AEBaseGui
|
||||
this.font.drawString( this.getGuiDisplayName( GuiText.VibrationChamber.getLocal() ), 8, 6, 4210752 );
|
||||
this.font.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||
|
||||
this.pb.setFullMsg( TileVibrationChamber.POWER_PER_TICK * this.cvc.getCurrentProgress() / TileVibrationChamber.DILATION_SCALING + " AE/t" );
|
||||
this.pb.setFullMsg( TileVibrationChamber.POWER_PER_TICK * this.container.getCurrentProgress() / TileVibrationChamber.DILATION_SCALING + " AE/t" );
|
||||
|
||||
if( this.cvc.getRemainingBurnTime() > 0 )
|
||||
if( this.container.getRemainingBurnTime() > 0 )
|
||||
{
|
||||
final int i1 = this.cvc.getRemainingBurnTime() * 12 / 100;
|
||||
final int i1 = this.container.getRemainingBurnTime() * 12 / 100;
|
||||
this.bindTexture( "guis/vibchamber.png" );
|
||||
RenderSystem.color4f( 1, 1, 1 );
|
||||
RenderSystem.color3f( 1, 1, 1 );
|
||||
final int l = -15;
|
||||
final int k = 25;
|
||||
this.drawTexturedModalRect( k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 2 );
|
||||
GuiUtils.drawTexturedModalRect( k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 2, 0 /* FIXME this.zlevel was used */ );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,6 +76,6 @@ public class GuiVibrationChamber extends AEBaseGui
|
||||
this.bindTexture( "guis/vibchamber.png" );
|
||||
this.pb.x = 99 + this.guiLeft;
|
||||
this.pb.y = 36 + this.guiTop;
|
||||
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
|
||||
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, 0 /* FIXME this.zlevel was used */ );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,8 @@ package appeng.client.gui.implementations;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
@@ -36,14 +38,13 @@ import appeng.tile.networking.TileWireless;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class GuiWireless extends AEBaseGui
|
||||
public class GuiWireless extends AEBaseGui<ContainerWireless>
|
||||
{
|
||||
|
||||
private GuiImgButton units;
|
||||
|
||||
public GuiWireless( final PlayerInventory PlayerInventory, final TileWireless te )
|
||||
{
|
||||
super( new ContainerWireless( PlayerInventory, te ) );
|
||||
public GuiWireless(ContainerWireless container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 166;
|
||||
}
|
||||
|
||||
@@ -76,12 +77,10 @@ public class GuiWireless extends AEBaseGui
|
||||
this.font.drawString( this.getGuiDisplayName( GuiText.Wireless.getLocal() ), 8, 6, 4210752 );
|
||||
this.font.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||
|
||||
final ContainerWireless cw = (ContainerWireless) this.inventorySlots;
|
||||
|
||||
if( cw.getRange() > 0 )
|
||||
if( container.getRange() > 0 )
|
||||
{
|
||||
final String firstMessage = GuiText.Range.getLocal() + ": " + ( cw.getRange() / 10.0 ) + " m";
|
||||
final String secondMessage = GuiText.PowerUsageRate.getLocal() + ": " + Platform.formatPowerLong( cw.getDrain(), true );
|
||||
final String firstMessage = GuiText.Range.getLocal() + ": " + ( container.getRange() / 10.0 ) + " m";
|
||||
final String secondMessage = GuiText.PowerUsageRate.getLocal() + ": " + Platform.formatPowerLong( container.getDrain(), true );
|
||||
|
||||
final int strWidth = Math.max( this.font.getStringWidth( firstMessage ), this.font.getStringWidth( secondMessage ) );
|
||||
final int cOffset = ( this.xSize / 2 ) - ( strWidth / 2 );
|
||||
@@ -94,6 +93,6 @@ public class GuiWireless extends AEBaseGui
|
||||
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||
{
|
||||
this.bindTexture( "guis/wireless.png" );
|
||||
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
|
||||
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, 0 /* FIXME this.zlevel was used */ );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,22 +19,17 @@
|
||||
package appeng.client.gui.implementations;
|
||||
|
||||
|
||||
import appeng.container.implementations.ContainerMEPortableCell;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
|
||||
import appeng.api.implementations.guiobjects.IPortableCell;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
|
||||
|
||||
public class GuiWirelessTerm extends GuiMEPortableCell
|
||||
// FIXME: Extended from GuiPortableCell before... Why?
|
||||
public class GuiWirelessTerm extends GuiMEMonitorable<ContainerMEPortableCell>
|
||||
{
|
||||
|
||||
public GuiWirelessTerm( final PlayerInventory PlayerInventory, final IPortableCell te )
|
||||
{
|
||||
super( PlayerInventory, te );
|
||||
public GuiWirelessTerm(ContainerMEPortableCell container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
}
|
||||
|
||||
@Override
|
||||
int getMaxRows()
|
||||
{
|
||||
return this.defaultGetMaxRows();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user