minor changes

This commit is contained in:
DarkGuardsman 2013-11-30 03:45:47 -05:00
parent 014e6cc50c
commit 22a7dd8c12
5 changed files with 28 additions and 13 deletions

@ -1 +1 @@
Subproject commit d240823fa078ac48fa4a5bb846598666f7b5221f Subproject commit f38c267121af147ff60b414d409424e0174ccac4

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

View file

@ -28,6 +28,9 @@ public abstract class GuiMachineContainer extends GuiContainer
protected ButtonIcon guiIcon = ButtonIcon.CHEST, guiIcon2 = ButtonIcon.PERSON, guiIcon3 = ButtonIcon.BLANK; protected ButtonIcon guiIcon = ButtonIcon.CHEST, guiIcon2 = ButtonIcon.PERSON, guiIcon3 = ButtonIcon.BLANK;
protected String invName = "Home", invName2 = "2", invName3 = "3"; protected String invName = "Home", invName2 = "2", invName3 = "3";
protected int containerWidth;
protected int containerHeight;
public GuiMachineContainer(Object mod, Container container, InventoryPlayer inventoryPlayer, TileEntityMachine tileEntity) public GuiMachineContainer(Object mod, Container container, InventoryPlayer inventoryPlayer, TileEntityMachine tileEntity)
{ {
super(container); super(container);
@ -37,24 +40,27 @@ public abstract class GuiMachineContainer extends GuiContainer
this.mod = mod; this.mod = mod;
} }
@SuppressWarnings("unchecked")
@Override @Override
public void initGui() public void initGui()
{ {
super.initGui(); super.initGui();
this.buttonList.clear(); this.buttonList.clear();
containerWidth = (this.width - this.xSize) / 2;
containerHeight = (this.height - this.ySize) / 2;
if (guiID != -1) if (guiID != -1)
this.buttonList.add(new GuiButtonImage(0, (this.width - this.xSize) / 2 - 22, (this.height - this.ySize) / 2 + 0, guiIcon)); this.buttonList.add(new GuiButtonImage(0, containerWidth - 22, containerHeight + 0, guiIcon));
if (guiID2 != -1) if (guiID2 != -1)
this.buttonList.add(new GuiButtonImage(1, (this.width - this.xSize) / 2 - 22, (this.height - this.ySize) / 2 + 22, guiIcon2)); this.buttonList.add(new GuiButtonImage(1, containerWidth - 22, containerHeight + 22, guiIcon2));
if (guiID3 != -1) if (guiID3 != -1)
this.buttonList.add(new GuiButtonImage(2, (this.width - this.xSize) / 2 - 22, (this.height - this.ySize) / 2 + 44, guiIcon3)); this.buttonList.add(new GuiButtonImage(2, containerWidth - 22, containerHeight + 44, guiIcon3));
} }
@Override @Override
protected void actionPerformed(GuiButton button) protected void actionPerformed(GuiButton button)
{ {
super.actionPerformed(button);
switch (button.id) switch (button.id)
{ {
case 0: case 0:
@ -180,4 +186,14 @@ public abstract class GuiMachineContainer extends GuiContainer
this.zLevel = 0.0F; this.zLevel = 0.0F;
} }
} }
public int getGuiTop()
{
return this.guiTop;
}
public int getGuiLeft()
{
return this.guiLeft;
}
} }

View file

@ -35,7 +35,6 @@ public class PacketManagerEffects implements IPacketManager
{ {
try try
{ {
System.out.println("Effect packet being handled");
World world = ((EntityPlayer) player).worldObj; World world = ((EntityPlayer) player).worldObj;
String effectName = data.readUTF(); String effectName = data.readUTF();
if (world != null) if (world != null)

View file

@ -42,7 +42,7 @@ public class GuiButtonImage extends GuiButton
vv += this.height; vv += this.height;
} }
this.drawTexturedModalRect(this.xPosition, this.yPosition, uu, vv, this.width, this.height); this.drawTexturedModalRect(this.xPosition, this.yPosition, this.buttonIcon.uu, this.buttonIcon.vv, this.width, this.height);
} }
} }
@ -55,10 +55,10 @@ public class GuiButtonImage extends GuiButton
public static enum ButtonIcon public static enum ButtonIcon
{ {
PERSON(0, 0), PERSON(0, 0),
ARROW_LEFT(30, 0), ARROW_LEFT(30, 0, 10, 10),
ARROW_RIGHT(20, 0), ARROW_RIGHT(20, 0, 10, 10),
ARROW_DOWN(30, 20), ARROW_DOWN(30, 20, 10, 10),
ARROW_UP(20, 20), ARROW_UP(20, 20, 10, 10),
CHEST(60, 0), CHEST(60, 0),
LOCKED(80, 0), LOCKED(80, 0),
UNLOCKED(100, 0), UNLOCKED(100, 0),
@ -73,8 +73,8 @@ public class GuiButtonImage extends GuiButton
private ButtonIcon(int xx, int yy) private ButtonIcon(int xx, int yy)
{ {
this.vv = xx; this.vv = yy;
this.uu = yy; this.uu = xx;
} }
private ButtonIcon(int xx, int yy, int cx, int cy) private ButtonIcon(int xx, int yy, int cx, int cy)