Fix Tool Station and Tool Forge button not respect the resource domain setting

Before the fix, Tool Station and Tool Forge buttons always use the image file from "tinker" resource domain (It's from the repair button resource domain). This prevents ability to use images added by other mods.

This fix makes said GUI respect the resource domain setting of the buttons.
This commit is contained in:
Chavalit P committed 2021-08-25 22:26:49 +07:00
1 parent 7dae07dee1
commit dee071050e
3 files changed
+4 -4

No files matched your search

@@ -18,7 +18,7 @@ public class GuiButtonTool extends GuiButton
int textureY;
public String texture;
public ToolGuiElement element;
private static ResourceLocation background;// = new
private ResourceLocation background;// = new
// ResourceLocation("tinker",
// "textures/gui/armorextended.png");
@@ -33,14 +33,14 @@ public class ToolForgeGui extends ToolStationGui
for (int iter = 0; iter < TConstructClientRegistry.tierTwoButtons.size(); iter++)
{
ToolGuiElement element = TConstructClientRegistry.tierTwoButtons.get(iter);
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);
GuiButtonTool button = new GuiButtonTool(iter + 1, this.guiLeft + 22 * ((iter + 1) % 5), this.guiTop + 22 * ((iter + 1) / 5), element.buttonIconX, element.buttonIconY, element.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, this.guiLeft + 22 * ((iter + offset) % 5), this.guiTop + 22 * ((iter + offset) / 5), element.buttonIconX, element.buttonIconY, repair.domain, element.texture, element);
GuiButtonTool button = new GuiButtonTool(iter + offset, this.guiLeft + 22 * ((iter + offset) % 5), this.guiTop + 22 * ((iter + offset) / 5), element.buttonIconX, element.buttonIconY, element.domain, element.texture, element);
this.buttonList.add(button);
}
}
@@ -98,7 +98,7 @@ public class ToolStationGui extends GuiContainer implements INEIGuiHandler
for (int iter = 1; iter < TConstructClientRegistry.toolButtons.size(); iter++)
{
ToolGuiElement element = TConstructClientRegistry.toolButtons.get(iter);
GuiButtonTool button = new GuiButtonTool(iter, this.guiLeft + 22 * (iter % 5), this.guiTop + 22 * (iter / 5), element.buttonIconX, element.buttonIconY, repair.domain, element.texture, element);
GuiButtonTool button = new GuiButtonTool(iter, this.guiLeft + 22 * (iter % 5), this.guiTop + 22 * (iter / 5), element.buttonIconX, element.buttonIconY, element.domain, element.texture, element);
this.buttonList.add(button);
}
}