fix JEI stuff going over GUIs
This commit is contained in:
@@ -25,17 +25,27 @@ public abstract class GuiBase extends GuiContainer
|
|||||||
private int lastButtonId = 0;
|
private int lastButtonId = 0;
|
||||||
private int lastSideButtonY = 6;
|
private int lastSideButtonY = 6;
|
||||||
|
|
||||||
public GuiBase(Container container, int w, int h)
|
protected int width;
|
||||||
|
protected int height;
|
||||||
|
|
||||||
|
public GuiBase(Container container, int width, int height)
|
||||||
{
|
{
|
||||||
super(container);
|
super(container);
|
||||||
|
|
||||||
this.xSize = w;
|
this.width = width;
|
||||||
this.ySize = h;
|
this.height = height;
|
||||||
|
this.xSize = width;
|
||||||
|
this.ySize = height;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initGui()
|
public void initGui()
|
||||||
{
|
{
|
||||||
|
if (sideButtons.size() > 0)
|
||||||
|
{
|
||||||
|
xSize -= SIDE_BUTTON_WIDTH;
|
||||||
|
}
|
||||||
|
|
||||||
super.initGui();
|
super.initGui();
|
||||||
|
|
||||||
sideButtons.clear();
|
sideButtons.clear();
|
||||||
@@ -44,6 +54,11 @@ public abstract class GuiBase extends GuiContainer
|
|||||||
lastSideButtonY = 6;
|
lastSideButtonY = 6;
|
||||||
|
|
||||||
init(guiLeft, guiTop);
|
init(guiLeft, guiTop);
|
||||||
|
|
||||||
|
if (sideButtons.size() > 0)
|
||||||
|
{
|
||||||
|
xSize += SIDE_BUTTON_WIDTH;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public class GuiConstructor extends GuiBase
|
|||||||
{
|
{
|
||||||
bindTexture("gui/constructor.png");
|
bindTexture("gui/constructor.png");
|
||||||
|
|
||||||
drawTexture(x, y, 0, 0, xSize, ySize);
|
drawTexture(x, y, 0, 0, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public class GuiController extends GuiBase
|
|||||||
{
|
{
|
||||||
bindTexture("gui/controller.png");
|
bindTexture("gui/controller.png");
|
||||||
|
|
||||||
drawTexture(x, y, 0, 0, xSize, ySize);
|
drawTexture(x, y, 0, 0, width, height);
|
||||||
|
|
||||||
int barHeightNew = (int) ((float) controller.getEnergyStored(null) / (float) controller.getMaxEnergyStored(null) * (float) barHeight);
|
int barHeightNew = (int) ((float) controller.getEnergyStored(null) / (float) controller.getMaxEnergyStored(null) * (float) barHeight);
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public class GuiDestructor extends GuiBase
|
|||||||
{
|
{
|
||||||
bindTexture("gui/destructor.png");
|
bindTexture("gui/destructor.png");
|
||||||
|
|
||||||
drawTexture(x, y, 0, 0, xSize, ySize);
|
drawTexture(x, y, 0, 0, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public class GuiDetector extends GuiBase
|
|||||||
{
|
{
|
||||||
bindTexture("gui/detector.png");
|
bindTexture("gui/detector.png");
|
||||||
|
|
||||||
drawTexture(x, y, 0, 0, xSize, ySize);
|
drawTexture(x, y, 0, 0, width, height);
|
||||||
|
|
||||||
amountField.drawTextBox();
|
amountField.drawTextBox();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public class GuiDrive extends GuiBase
|
|||||||
{
|
{
|
||||||
bindTexture("gui/drive.png");
|
bindTexture("gui/drive.png");
|
||||||
|
|
||||||
drawTexture(x, y, 0, 0, xSize, ySize);
|
drawTexture(x, y, 0, 0, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public class GuiExporter extends GuiBase
|
|||||||
{
|
{
|
||||||
bindTexture("gui/exporter.png");
|
bindTexture("gui/exporter.png");
|
||||||
|
|
||||||
drawTexture(x, y, 0, 0, xSize, ySize);
|
drawTexture(x, y, 0, 0, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ public class GuiGrid extends GuiBase
|
|||||||
bindTexture("gui/grid.png");
|
bindTexture("gui/grid.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
drawTexture(x, y, 0, 0, xSize, ySize);
|
drawTexture(x, y, 0, 0, width, height);
|
||||||
|
|
||||||
searchField.drawTextBox();
|
searchField.drawTextBox();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ package storagecraft.gui;
|
|||||||
|
|
||||||
import storagecraft.container.ContainerImporter;
|
import storagecraft.container.ContainerImporter;
|
||||||
import storagecraft.gui.sidebutton.SideButtonCompare;
|
import storagecraft.gui.sidebutton.SideButtonCompare;
|
||||||
import storagecraft.gui.sidebutton.SideButtonRedstoneMode;
|
|
||||||
import storagecraft.gui.sidebutton.SideButtonMode;
|
import storagecraft.gui.sidebutton.SideButtonMode;
|
||||||
|
import storagecraft.gui.sidebutton.SideButtonRedstoneMode;
|
||||||
import storagecraft.tile.TileImporter;
|
import storagecraft.tile.TileImporter;
|
||||||
import storagecraft.util.InventoryUtils;
|
import storagecraft.util.InventoryUtils;
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ public class GuiImporter extends GuiBase
|
|||||||
{
|
{
|
||||||
bindTexture("gui/importer.png");
|
bindTexture("gui/importer.png");
|
||||||
|
|
||||||
drawTexture(x, y, 0, 0, xSize, ySize);
|
drawTexture(x, y, 0, 0, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public class GuiSolderer extends GuiBase
|
|||||||
{
|
{
|
||||||
bindTexture("gui/solderer.png");
|
bindTexture("gui/solderer.png");
|
||||||
|
|
||||||
drawTexture(x, y, 0, 0, xSize, ySize);
|
drawTexture(x, y, 0, 0, width, height);
|
||||||
|
|
||||||
if (solderer.isWorking())
|
if (solderer.isWorking())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import java.io.IOException;
|
|||||||
import net.minecraft.client.gui.GuiTextField;
|
import net.minecraft.client.gui.GuiTextField;
|
||||||
import storagecraft.container.ContainerStorage;
|
import storagecraft.container.ContainerStorage;
|
||||||
import storagecraft.gui.sidebutton.SideButtonCompare;
|
import storagecraft.gui.sidebutton.SideButtonCompare;
|
||||||
import storagecraft.gui.sidebutton.SideButtonRedstoneMode;
|
|
||||||
import storagecraft.gui.sidebutton.SideButtonMode;
|
import storagecraft.gui.sidebutton.SideButtonMode;
|
||||||
|
import storagecraft.gui.sidebutton.SideButtonRedstoneMode;
|
||||||
import storagecraft.storage.IStorageGui;
|
import storagecraft.storage.IStorageGui;
|
||||||
import storagecraft.util.InventoryUtils;
|
import storagecraft.util.InventoryUtils;
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ public class GuiStorage extends GuiBase
|
|||||||
{
|
{
|
||||||
bindTexture("gui/storage.png");
|
bindTexture("gui/storage.png");
|
||||||
|
|
||||||
drawTexture(x, y, 0, 0, xSize, ySize);
|
drawTexture(x, y, 0, 0, width, height);
|
||||||
|
|
||||||
int barHeightNew = (int) ((float) gui.getStored() / (float) gui.getCapacity() * (float) barHeight);
|
int barHeightNew = (int) ((float) gui.getStored() / (float) gui.getCapacity() * (float) barHeight);
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public class GuiWirelessTransmitter extends GuiBase
|
|||||||
{
|
{
|
||||||
bindTexture("gui/wireless_transmitter.png");
|
bindTexture("gui/wireless_transmitter.png");
|
||||||
|
|
||||||
drawTexture(x, y, 0, 0, xSize, ySize);
|
drawTexture(x, y, 0, 0, width, height);
|
||||||
|
|
||||||
if (wirelessTransmitter.isWorking())
|
if (wirelessTransmitter.isWorking())
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user