Skip to content

Commit

Permalink
Fix opening and placement of armour GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
portablejim committed Feb 26, 2014
1 parent 66ce0e8 commit 5f80e02
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 47 deletions.
47 changes: 4 additions & 43 deletions src/main/java/tconstruct/client/TControls.java
Expand Up @@ -155,55 +155,16 @@ void updateSize (String name, float size)
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)
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/tconstruct/client/gui/ArmorExtendedGui.java
Expand Up @@ -37,7 +37,7 @@ public void initGui ()
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
Expand All @@ -48,7 +48,7 @@ public void initGui ()
// tab.enabled = false;
// this.buttonList.add(tab);

TabRegistry.updateTabValues(cornerX, cornerY, InventoryTabArmorExtended.class);
TabRegistry.updateTabValues(cornerX + 51, cornerY, InventoryTabArmorExtended.class);
TabRegistry.addTabsToList(this.buttonList);
}

Expand Down Expand Up @@ -97,8 +97,8 @@ protected void drawGuiContainerBackgroundLayer (float f, int i, int j)
// 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);
Expand Down

0 comments on commit 5f80e02

Please sign in to comment.