Fix opening and placement of armour GUI

This commit is contained in:
James McKay committed 2014-02-26 16:21:16 +11:00
1 parent 66ce0e8a0c
commit 5f80e026c9
2 files changed
+8 -47

No files matched your search

+4 -43
View File
@@ -155,55 +155,16 @@ public class TControls extends TKeyHandler
updateServer(bos);
}
public static void openInventoryGui ()
{
ByteArrayOutputStream bos = new ByteArrayOutputStream(8);
DataOutputStream outputStream = new DataOutputStream(bos);
try
{
outputStream.writeByte(3);
outputStream.writeByte(0);
}
catch (Exception ex)
{
ex.printStackTrace();
}
updateServer(bos);
}
public static void openArmorGui ()
{
ByteArrayOutputStream bos = new ByteArrayOutputStream(8);
DataOutputStream outputStream = new DataOutputStream(bos);
try
{
outputStream.writeByte(3);
outputStream.writeByte(1);
}
catch (Exception ex)
{
ex.printStackTrace();
}
updateServer(bos);
// Position is unused. Set to 0.
mc.thePlayer.openGui(TConstruct.instance, TProxyClient.armorGuiID, mc.theWorld, 0, 0, 0);
}
public static void openKnapsackGui ()
{
ByteArrayOutputStream bos = new ByteArrayOutputStream(8);
DataOutputStream outputStream = new DataOutputStream(bos);
try
{
outputStream.writeByte(3);
outputStream.writeByte(2);
}
catch (Exception ex)
{
ex.printStackTrace();
}
updateServer(bos);
// Position is unused. Set to 0.
mc.thePlayer.openGui(TConstruct.instance, TProxyClient.knapsackGuiID, mc.theWorld, 0, 0, 0);
}
static void updateServer (ByteArrayOutputStream bos)
@@ -37,7 +37,7 @@ public class ArmorExtendedGui extends InventoryEffectRenderer
super.initGui();
int cornerX = guiLeft;
int cornerY = (this.width - this.ySize) / 2;
int cornerY = guiTop;
this.buttonList.clear();
// InventoryTab tab = new InventoryTab(2, cornerX, cornerY - 28, new
@@ -48,7 +48,7 @@ public class ArmorExtendedGui extends InventoryEffectRenderer
// tab.enabled = false;
// this.buttonList.add(tab);
TabRegistry.updateTabValues(cornerX, cornerY, InventoryTabArmorExtended.class);
TabRegistry.updateTabValues(cornerX + 51, cornerY, InventoryTabArmorExtended.class);
TabRegistry.addTabsToList(this.buttonList);
}
@@ -97,8 +97,8 @@ public class ArmorExtendedGui extends InventoryEffectRenderer
// mc.renderEngine.bindTexture("/mods/tinker/textures/gui/armorextended.png");
this.mc.getTextureManager().bindTexture(background);
int cornerX = guiLeft;
int cornerY = (width - ySize) / 2;
drawTexturedModalRect(cornerX, cornerY, 0, 0, xSize, ySize);
int cornerY = guiTop;
drawTexturedModalRect(cornerX, guiTop, 0, 0, xSize, ySize);
if (!stats.isStackInSlot(0))
drawTexturedModalRect(cornerX + 79, cornerY + 16, 176, 9, 18, 18);