Skip to content

Commit

Permalink
Fix the Tool Forge Gui!
Browse files Browse the repository at this point in the history
  • Loading branch information
blue42u committed May 14, 2014
1 parent 63b740e commit fc2fdff
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 70 deletions.
8 changes: 3 additions & 5 deletions src/main/java/tconstruct/client/gui/ToolForgeGui.java
Expand Up @@ -38,28 +38,26 @@ protected void mouseClicked (int mouseX, int mouseY, int mouseButton)
public void initGui ()
{
super.initGui();
int cornerX = (this.width - this.xSize) / 2;
int cornerY = (this.height - this.ySize) / 2;

this.buttonList.clear();
ToolGuiElement repair = TConstructClientRegistry.toolButtons.get(0);
GuiButtonTool repairButton = new GuiButtonTool(0, cornerX - 110, cornerY, repair.buttonIconX, repair.buttonIconY, repair.domain, repair.texture, repair); // Repair
GuiButtonTool repairButton = new GuiButtonTool(0, this.guiLeft, this.guiTop, repair.buttonIconX, repair.buttonIconY, repair.domain, repair.texture, repair); // Repair
repairButton.enabled = false;
this.buttonList.add(repairButton);
int offset = TConstructClientRegistry.tierTwoButtons.size();

for (int iter = 0; iter < TConstructClientRegistry.tierTwoButtons.size(); iter++)
{
ToolGuiElement element = TConstructClientRegistry.tierTwoButtons.get(iter);
GuiButtonTool button = new GuiButtonTool(iter + 1, cornerX - 110 + 22 * ((iter + 1) % 5), cornerY + 22 * ((iter + 1) / 5), element.buttonIconX, element.buttonIconY, repair.domain,
GuiButtonTool button = new GuiButtonTool(iter + 1, this.guiLeft + 22 * ((iter + 1) % 5), this.guiTop + 22 * ((iter + 1) / 5), element.buttonIconX, element.buttonIconY, repair.domain,
element.texture, element);
this.buttonList.add(button);
}

for (int iter = 1; iter < TConstructClientRegistry.toolButtons.size(); iter++)
{
ToolGuiElement element = TConstructClientRegistry.toolButtons.get(iter);
GuiButtonTool button = new GuiButtonTool(iter + offset, cornerX - 110 + 22 * ((iter + offset) % 5), cornerY + 22 * ((iter + offset) / 5), element.buttonIconX, element.buttonIconY,
GuiButtonTool button = new GuiButtonTool(iter + offset, this.guiLeft + 22 * ((iter + offset) % 5), this.guiTop + 22 * ((iter + offset) / 5), element.buttonIconX, element.buttonIconY,
repair.domain, element.texture, element);
this.buttonList.add(button);
}
Expand Down

0 comments on commit fc2fdff

Please sign in to comment.