Changed guis a bit

This commit is contained in:
Robert 2013-11-29 19:34:55 -05:00
parent 4d82513bab
commit 3ec2c9e60e
7 changed files with 50 additions and 40 deletions

View file

@ -17,6 +17,7 @@ import dark.assembly.machine.encoder.ContainerEncoder;
import dark.assembly.machine.encoder.TileEntityEncoder;
import dark.assembly.machine.processor.ContainerProcessor;
import dark.assembly.machine.processor.TileEntityProcessor;
import dark.core.prefab.invgui.ContainerFake;
public class CommonProxy implements IGuiHandler
{
@ -36,10 +37,10 @@ public class CommonProxy implements IGuiHandler
{
}
public void postInit()
{
{
}
private void extractZipToLocation(File zipFile, String sourceFolder, String destFolder)
@ -131,6 +132,8 @@ public class CommonProxy implements IGuiHandler
{
return new ContainerProcessor(player.inventory, (TileEntityProcessor) tileEntity);
}
default:
return new ContainerFake(tileEntity);
}
}
@ -148,5 +151,4 @@ public class CommonProxy implements IGuiHandler
return false;
}
}

View file

@ -55,11 +55,11 @@ public class ClientProxy extends CommonProxy
}
case GUI_ENCODER_CODE:
{
return new GuiEncoderCoder(player, (TileEntityEncoder) tileEntity);
return new GuiEncoderCoder(player.inventory, (TileEntityEncoder) tileEntity);
}
case GUI_ENCODER_HELP:
{
return new GuiEncoderHelp(player, (TileEntityEncoder) tileEntity);
return new GuiEncoderHelp(player.inventory, (TileEntityEncoder) tileEntity);
}
case GUI_PROCESSOR:
{

View file

@ -1,17 +1,19 @@
package dark.assembly.client.gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import dark.assembly.AssemblyLine;
import dark.assembly.CommonProxy;
import dark.core.client.gui.GuiMachineBase;
import dark.core.client.gui.GuiMachineContainer;
import dark.core.prefab.invgui.ContainerFake;
import dark.core.prefab.machine.TileEntityMachine;
public class GuiEncoderBase extends GuiMachineBase
public class GuiEncoderBase extends GuiMachineContainer
{
public GuiEncoderBase(EntityPlayer player, TileEntityMachine tileEntity)
//
public GuiEncoderBase(InventoryPlayer player, TileEntityMachine tileEntity, Container container)
{
super(AssemblyLine.MOD_ID, player, tileEntity);
super(AssemblyLine.MOD_ID, container, player, tileEntity);
this.guiID = CommonProxy.GUI_ENCODER;
this.guiID2 = CommonProxy.GUI_ENCODER_CODE;
this.guiID3 = CommonProxy.GUI_ENCODER_HELP;
@ -20,4 +22,9 @@ public class GuiEncoderBase extends GuiMachineBase
this.invName3 = "Help";
}
public GuiEncoderBase(InventoryPlayer player, TileEntityMachine tileEntity)
{
this(player, tileEntity, new ContainerFake(tileEntity));
}
}

View file

@ -1,6 +1,6 @@
package dark.assembly.client.gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
@ -14,26 +14,26 @@ public class GuiEncoderCoder extends GuiEncoderBase
public static final ResourceLocation TEXTURE_CODE_BACK = new ResourceLocation(AssemblyLine.instance.DOMAIN, AssemblyLine.GUI_DIRECTORY + "gui_encoder_coder.png");
private GuiTaskList taskListGui;
public GuiEncoderCoder(EntityPlayer player, TileEntityEncoder tileEntity)
public GuiEncoderCoder(InventoryPlayer player, TileEntityEncoder tileEntity)
{
super(player, tileEntity);
}
@Override
protected void drawBackgroundLayer(int x, int y, float var1)
protected void drawGuiContainerBackgroundLayer(float var1, int x, int y)
{
if (taskListGui == null)
{
taskListGui = new GuiTaskList((this.width - this.guiSize.intX()) / 2 + 25, (this.height - this.guiSize.intY()) / 2 + 30);
taskListGui = new GuiTaskList((this.width - this.xSize) / 2 + 25, (this.height - this.ySize) / 2 + 30);
}
super.drawBackgroundLayer(x, y, var1);
super.drawGuiContainerBackgroundLayer(var1, x, y);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE_CODE_BACK);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
int containerWidth = (this.width - this.guiSize.intX()) / 2;
int containerHeight = (this.height - this.guiSize.intY()) / 2;
this.drawTexturedModalRect(containerWidth, containerHeight, 0, 0, this.guiSize.intX(), this.guiSize.intY());
int containerWidth = (this.width - this.xSize) / 2;
int containerHeight = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(containerWidth, containerHeight, 0, 0, this.xSize, this.ySize);
taskListGui.drawConsole();
}

View file

@ -1,6 +1,6 @@
package dark.assembly.client.gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import dark.assembly.AssemblyLine;
import dark.assembly.machine.encoder.TileEntityEncoder;
@ -9,16 +9,8 @@ public class GuiEncoderHelp extends GuiEncoderBase
{
public static final ResourceLocation TEXTURE_CODE_BACK = new ResourceLocation(AssemblyLine.instance.DOMAIN, AssemblyLine.GUI_DIRECTORY + "gui_encoder_coder.png");
public GuiEncoderHelp(EntityPlayer player, TileEntityEncoder tileEntity)
public GuiEncoderHelp(InventoryPlayer player, TileEntityEncoder tileEntity)
{
super(player, tileEntity);
}
/** Draw the foreground layer for the GuiContainer (everything in front of the items) */
@Override
protected void drawForegroundLayer(int x, int y, float var1)
{
String out = "Help for using the encoder is currently not ready";
this.fontRenderer.drawString("\u00a77" + out, (int) (this.guiSize.intX() / 2 - out.length() * 2.5), 20, 4210752);
}
}

View file

@ -9,25 +9,17 @@ import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import dark.assembly.AssemblyLine;
import dark.assembly.CommonProxy;
import dark.assembly.machine.encoder.ContainerEncoder;
import dark.assembly.machine.encoder.TileEntityEncoder;
import dark.core.client.gui.GuiMachineContainer;
@SideOnly(Side.CLIENT)
public class GuiEncoderInventory extends GuiMachineContainer
public class GuiEncoderInventory extends GuiEncoderBase
{
public static final ResourceLocation TEXTURE = new ResourceLocation(AssemblyLine.instance.DOMAIN, AssemblyLine.GUI_DIRECTORY + "gui_encoder_slot.png");
public GuiEncoderInventory(InventoryPlayer inventoryPlayer, TileEntityEncoder tileEntity)
{
super(AssemblyLine.instance, new ContainerEncoder(inventoryPlayer, tileEntity), inventoryPlayer, tileEntity);
this.guiID = CommonProxy.GUI_ENCODER;
this.guiID2 = CommonProxy.GUI_ENCODER_CODE;
this.guiID3 = CommonProxy.GUI_ENCODER_HELP;
this.invName = "Main";
this.invName2 = "Coder";
this.invName3 = "Help";
super(inventoryPlayer, tileEntity, new ContainerEncoder(inventoryPlayer, tileEntity));
}
/** Draw the background layer for the GuiContainer (everything behind the items) */

View file

@ -0,0 +1,17 @@
package dark.assembly.client.gui;
import net.minecraft.entity.player.EntityPlayer;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import dark.assembly.AssemblyLine;
import dark.core.client.gui.GuiMachineBase;
import dark.core.prefab.machine.TileEntityMachine;
@SideOnly(Side.CLIENT)
public class GuiManipulator extends GuiMachineBase
{
public GuiManipulator(EntityPlayer player, TileEntityMachine tileEntity)
{
super(AssemblyLine.instance, player, tileEntity);
}
}