mirror of
https://github.com/GTNewHorizons/Applied-Energistics-2-Unofficial.git
synced 2026-10-25 20:22:23 +00:00
Fix Advanced Network Tool slots overflowing in Inscriber and Crystal Growth Chamber (#1640)
This commit is contained in:
1 parent
168147004f
commit
4e4d83115b
5 files changed
+40
-8
No files matched your search
@@ -34,13 +34,17 @@ public class GuiAdvancedInscriber extends AEBaseGui {
|
||||
super(new ContainerAdvancedInscriber(inventoryPlayer, te));
|
||||
this.container = (ContainerAdvancedInscriber) this.inventorySlots;
|
||||
this.ySize = 176;
|
||||
this.xSize = this.hasToolbox() ? 246 : 211;
|
||||
this.xSize = !this.hasToolbox() ? 211 : this.getToolboxSize() == 5 ? 317 : 246;
|
||||
}
|
||||
|
||||
private boolean hasToolbox() {
|
||||
return ((ContainerUpgradeable) this.inventorySlots).hasToolbox();
|
||||
}
|
||||
|
||||
private int getToolboxSize() {
|
||||
return ((ContainerUpgradeable) this.inventorySlots).getToolboxSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
@@ -90,7 +94,10 @@ public class GuiAdvancedInscriber extends AEBaseGui {
|
||||
this.bindTexture("guis/mac.png");
|
||||
this.drawTexturedModalRect(offsetX + 179, offsetY, 179, 0, 32, 104);
|
||||
|
||||
if (this.hasToolbox()) {
|
||||
if (this.hasToolbox() && this.getToolboxSize() == 5) {
|
||||
this.bindTexture("guis/advanced_toolbox.png");
|
||||
this.drawTexturedModalRect(offsetX + 213, offsetY + 64, 0, 0, 104, 104);
|
||||
} else if (this.hasToolbox()) {
|
||||
this.bindTexture("guis/inscriber.png");
|
||||
this.drawTexturedModalRect(offsetX + 178, offsetY + 105, 178, this.ySize - 90, 68, 68);
|
||||
}
|
||||
|
||||
@@ -18,13 +18,17 @@ public class GuiCrystalGrowthChamber extends AEBaseGui {
|
||||
super(new ContainerCrystalGrowthChamber(inventoryPlayer, te));
|
||||
cg = (ContainerCrystalGrowthChamber) this.inventorySlots;
|
||||
ySize = 166;
|
||||
xSize = hasToolbox() ? 246 : 211;
|
||||
xSize = !hasToolbox() ? 211 : getToolboxSize() == 5 ? 290 : 246;
|
||||
}
|
||||
|
||||
private boolean hasToolbox() {
|
||||
return ((ContainerUpgradeable) this.inventorySlots).hasToolbox();
|
||||
}
|
||||
|
||||
private int getToolboxSize() {
|
||||
return ((ContainerUpgradeable) this.inventorySlots).getToolboxSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||
fontRendererObj.drawString(
|
||||
@@ -46,7 +50,10 @@ public class GuiCrystalGrowthChamber extends AEBaseGui {
|
||||
if (drawUpgrades()) {
|
||||
drawTexturedModalRect(offsetX + 177, offsetY, 177, 0, 35, 14 + cg.availableUpgrades() * 18);
|
||||
}
|
||||
if (hasToolbox()) {
|
||||
if (hasToolbox() && getToolboxSize() == 5) {
|
||||
bindTexture("guis/advanced_toolbox.png");
|
||||
drawTexturedModalRect(offsetX + 178, offsetY + ySize - 90 - 7, 0, 0, 104, 104);
|
||||
} else if (hasToolbox()) {
|
||||
drawTexturedModalRect(offsetX + 178, offsetY + ySize - 90, 178, ySize - 90, 68, 68);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,13 +30,17 @@ public class GuiInscriber extends AEBaseGui {
|
||||
super(new ContainerInscriber(inventoryPlayer, te));
|
||||
this.cvc = (ContainerInscriber) this.inventorySlots;
|
||||
this.ySize = 176;
|
||||
this.xSize = this.hasToolbox() ? 246 : 211;
|
||||
this.xSize = !this.hasToolbox() ? 211 : this.getToolboxSize() == 5 ? 290 : 246;
|
||||
}
|
||||
|
||||
private boolean hasToolbox() {
|
||||
return ((ContainerUpgradeable) this.inventorySlots).hasToolbox();
|
||||
}
|
||||
|
||||
private int getToolboxSize() {
|
||||
return ((ContainerUpgradeable) this.inventorySlots).getToolboxSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
@@ -72,7 +76,10 @@ public class GuiInscriber extends AEBaseGui {
|
||||
if (this.drawUpgrades()) {
|
||||
this.drawTexturedModalRect(offsetX + 177, offsetY, 177, 0, 35, 14 + this.cvc.availableUpgrades() * 18);
|
||||
}
|
||||
if (this.hasToolbox()) {
|
||||
if (this.hasToolbox() && this.getToolboxSize() == 5) {
|
||||
this.bindTexture("guis/advanced_toolbox.png");
|
||||
this.drawTexturedModalRect(offsetX + 178, offsetY + this.ySize - 90 - 7, 0, 0, 104, 104);
|
||||
} else if (this.hasToolbox()) {
|
||||
this.drawTexturedModalRect(offsetX + 178, offsetY + this.ySize - 90, 178, this.ySize - 90, 68, 68);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,13 @@ public class ContainerAdvancedInscriber extends ContainerUpgradeable implements
|
||||
|
||||
@Override
|
||||
protected int getToolboxY() {
|
||||
return 113;
|
||||
// The 5x5 toolbox does not fit below the upgrade strip, so it is placed next to it instead
|
||||
return this.getToolboxSize() == 5 ? 79 : 113;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getToolboxX() {
|
||||
return this.getToolboxSize() == 5 ? 221 : 186;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -100,6 +100,7 @@ public abstract class ContainerUpgradeable extends AEBaseContainer implements IO
|
||||
// For advanced toolbox to move down a little bit
|
||||
int yBias = size == 3 ? 0 : 7;
|
||||
int toolboxY = this.getToolboxY();
|
||||
int toolboxX = this.getToolboxX();
|
||||
for (int v = 0; v < size; v++) {
|
||||
for (int u = 0; u < size; u++) {
|
||||
this.addSlotToContainer(
|
||||
@@ -107,7 +108,7 @@ public abstract class ContainerUpgradeable extends AEBaseContainer implements IO
|
||||
SlotRestrictedInput.PlacableItemType.UPGRADES,
|
||||
this.tbInventory,
|
||||
u + v * size,
|
||||
186 + u * 18,
|
||||
toolboxX + u * 18,
|
||||
toolboxY - yBias + v * 18,
|
||||
this.getInventoryPlayer())).setPlayerSide());
|
||||
}
|
||||
@@ -139,6 +140,10 @@ public abstract class ContainerUpgradeable extends AEBaseContainer implements IO
|
||||
return this.getHeight() - 82;
|
||||
}
|
||||
|
||||
protected int getToolboxX() {
|
||||
return 186;
|
||||
}
|
||||
|
||||
protected void setupConfig() {
|
||||
this.setupUpgrades();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user