Start removing need for keeping track of guiWidth and guiHeight, as they are equal to guiLeft and guiTop

This commit is contained in:
pupnewfster committed 2019-07-08 11:47:36 -04:00
1 parent a7b29c209f
commit d6b27e95a2
47 files changed
+218 -263

No files matched your search

@@ -74,7 +74,7 @@ public class GuiAdvancedElectricMachine<RECIPE extends AdvancedMachineRecipe<REC
}
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
if (tileEntity.getScaledGasLevel(12) > 0) {
int displayInt = tileEntity.getScaledGasLevel(12);
displayGauge(61, 37 + 12 - displayInt, 6, displayInt, tileEntity.gasTank.getGas());
@@ -90,11 +90,9 @@ public class GuiAdvancedElectricMachine<RECIPE extends AdvancedMachineRecipe<REC
if (gas == null) {
return;
}
int guiWidth = (width - xSize) / 2;
int guiHeight = (height - ySize) / 2;
mc.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
GLSMHelper.INSTANCE.color(gas);
drawTexturedModalRect(guiWidth + xPos, guiHeight + yPos, gas.getGas().getSprite(), sizeX, sizeY);
drawTexturedModalRect(guiLeft + xPos, guiTop + yPos, gas.getGas().getSprite(), sizeX, sizeY);
GLSMHelper.INSTANCE.resetColor();
}
}
@@ -43,11 +43,11 @@ public class GuiDictionary extends GuiMekanism {
}
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
if (xAxis >= 6 && xAxis <= 22 && yAxis >= 6 && yAxis <= 22) {
MekanismRenderHelper renderHelper = new MekanismRenderHelper(true).disableLighting().disableDepth();
int x = guiWidth + 6;
int y = guiHeight + 6;
int x = guiLeft + 6;
int y = guiTop + 6;
drawRect(x, y, x + 16, y + 16, 0x80FFFFFF);
renderHelper.cleanup();
}
@@ -69,18 +69,16 @@ public class GuiDigitalMiner extends GuiMekanismTile<TileEntityDigitalMiner> {
@Override
public void initGui() {
super.initGui();
int guiWidth = (width - xSize) / 2;
int guiHeight = (height - ySize) / 2;
buttonList.clear();
startButton = new GuiButton(0, guiWidth + 69, guiHeight + 17, 60, 20, LangUtils.localize("gui.start"));
startButton = new GuiButton(0, guiLeft + 69, guiTop + 17, 60, 20, LangUtils.localize("gui.start"));
if (tileEntity.searcher.state != State.IDLE && tileEntity.running) {
startButton.enabled = false;
}
stopButton = new GuiButton(1, guiWidth + 69, guiHeight + 37, 60, 20, LangUtils.localize("gui.stop"));
stopButton = new GuiButton(1, guiLeft + 69, guiTop + 37, 60, 20, LangUtils.localize("gui.stop"));
if (tileEntity.searcher.state == State.IDLE || !tileEntity.running) {
stopButton.enabled = false;
}
configButton = new GuiButton(2, guiWidth + 69, guiHeight + 57, 60, 20, LangUtils.localize("gui.config"));
configButton = new GuiButton(2, guiLeft + 69, guiTop + 57, 60, 20, LangUtils.localize("gui.config"));
if (tileEntity.searcher.state != State.IDLE) {
configButton.enabled = false;
}
@@ -170,13 +168,13 @@ public class GuiDigitalMiner extends GuiMekanismTile<TileEntityDigitalMiner> {
}
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
int displayInt = tileEntity.getScaledEnergyLevel(52);
drawTexturedModalRect(guiWidth + 164, guiHeight + 25 + 52 - displayInt, 176, 52 - displayInt, 4, displayInt);
drawTexturedModalRect(guiWidth + 147, guiHeight + 47, 180, xAxis >= 147 && xAxis <= 161 && yAxis >= 47 && yAxis <= 61, 14);
drawTexturedModalRect(guiWidth + 147, guiHeight + 63, 194, xAxis >= 147 && xAxis <= 161 && yAxis >= 63 && yAxis <= 77, 14);
drawTexturedModalRect(guiWidth + 131, guiHeight + 47, 208, xAxis >= 131 && xAxis <= 145 && yAxis >= 47 && yAxis <= 61, 14);
drawTexturedModalRect(guiWidth + 131, guiHeight + 63, 222, xAxis >= 131 && xAxis <= 145 && yAxis >= 63 && yAxis <= 77, 14);
drawTexturedModalRect(guiLeft + 164, guiTop + 25 + 52 - displayInt, 176, 52 - displayInt, 4, displayInt);
drawTexturedModalRect(guiLeft + 147, guiTop + 47, 180, xAxis >= 147 && xAxis <= 161 && yAxis >= 47 && yAxis <= 61, 14);
drawTexturedModalRect(guiLeft + 147, guiTop + 63, 194, xAxis >= 147 && xAxis <= 161 && yAxis >= 63 && yAxis <= 77, 14);
drawTexturedModalRect(guiLeft + 131, guiTop + 47, 208, xAxis >= 131 && xAxis <= 145 && yAxis >= 47 && yAxis <= 61, 14);
drawTexturedModalRect(guiLeft + 131, guiTop + 63, 222, xAxis >= 131 && xAxis <= 145 && yAxis >= 63 && yAxis <= 77, 14);
}
@Override
@@ -296,25 +296,22 @@ public class GuiDigitalMinerConfig extends GuiMekanismTile<TileEntityDigitalMine
@Override
public void initGui() {
super.initGui();
int guiWidth = (width - xSize) / 2;
int guiHeight = (height - ySize) / 2;
buttonList.clear();
buttonList.add(new GuiButton(0, guiWidth + 56, guiHeight + 136, 96, 20, LangUtils.localize("gui.newFilter")));
buttonList.add(new GuiButton(0, guiLeft + 56, guiTop + 136, 96, 20, LangUtils.localize("gui.newFilter")));
String prevRad = radiusField != null ? radiusField.getText() : "";
String prevMin = minField != null ? minField.getText() : "";
String prevMax = maxField != null ? maxField.getText() : "";
radiusField = new GuiTextField(1, fontRenderer, guiWidth + 12, guiHeight + 67, 26, 11);
radiusField = new GuiTextField(1, fontRenderer, guiLeft + 12, guiTop + 67, 26, 11);
radiusField.setMaxStringLength(Integer.toString(MekanismConfig.current().general.digitalMinerMaxRadius.val()).length());
radiusField.setText(prevRad);
minField = new GuiTextField(2, fontRenderer, guiWidth + 12, guiHeight + 92, 26, 11);
minField = new GuiTextField(2, fontRenderer, guiLeft + 12, guiTop + 92, 26, 11);
minField.setMaxStringLength(3);
minField.setText(prevMin);
maxField = new GuiTextField(3, fontRenderer, guiWidth + 12, guiHeight + 117, 26, 11);
maxField = new GuiTextField(3, fontRenderer, guiLeft + 12, guiTop + 117, 26, 11);
maxField.setMaxStringLength(3);
maxField.setText(prevMax);
}
@@ -387,7 +384,7 @@ public class GuiDigitalMinerConfig extends GuiMekanismTile<TileEntityDigitalMine
}
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
drawTexturedModalRect(guiLeft + 154, guiTop + 18 + getScroll(), 232 + (needsScrollBars() ? 0 : 12), 0, 12, 15);
for (int i = 0; i < 4; i++) {
@@ -404,7 +401,7 @@ public class GuiDigitalMinerConfig extends GuiMekanismTile<TileEntityDigitalMine
}
int yStart = i * 29 + 18;
boolean mouseOver = xAxis >= 56 && xAxis <= 152 && yAxis >= yStart && yAxis <= yStart + 29;
drawTexturedModalRect(guiWidth + 56, guiHeight + yStart, mouseOver ? 0 : 96, 166, 96, 29);
drawTexturedModalRect(guiLeft + 56, guiTop + yStart, mouseOver ? 0 : 96, 166, 96, 29);
GLSMHelper.INSTANCE.resetColor();
// Draw sort buttons
@@ -419,11 +416,11 @@ public class GuiDigitalMinerConfig extends GuiMekanismTile<TileEntityDigitalMine
}
}
}
drawTexturedModalRect(guiWidth + 5, guiHeight + 5, 176, xAxis >= 5 && xAxis <= 16 && yAxis >= 5 && yAxis <= 16, 11);
drawTexturedModalRect(guiWidth + 39, guiHeight + 67, 187, xAxis >= 39 && xAxis <= 50 && yAxis >= 67 && yAxis <= 78, 11);
drawTexturedModalRect(guiWidth + 39, guiHeight + 92, 187, xAxis >= 39 && xAxis <= 50 && yAxis >= 92 && yAxis <= 103, 11);
drawTexturedModalRect(guiWidth + 39, guiHeight + 117, 187, xAxis >= 39 && xAxis <= 50 && yAxis >= 117 && yAxis <= 128, 11);
drawTexturedModalRect(guiWidth + 11, guiHeight + 141, 198, xAxis >= 11 && xAxis <= 25 && yAxis >= 141 && yAxis <= 155, 14);
drawTexturedModalRect(guiLeft + 5, guiTop + 5, 176, xAxis >= 5 && xAxis <= 16 && yAxis >= 5 && yAxis <= 16, 11);
drawTexturedModalRect(guiLeft + 39, guiTop + 67, 187, xAxis >= 39 && xAxis <= 50 && yAxis >= 67 && yAxis <= 78, 11);
drawTexturedModalRect(guiLeft + 39, guiTop + 92, 187, xAxis >= 39 && xAxis <= 50 && yAxis >= 92 && yAxis <= 103, 11);
drawTexturedModalRect(guiLeft + 39, guiTop + 117, 187, xAxis >= 39 && xAxis <= 50 && yAxis >= 117 && yAxis <= 128, 11);
drawTexturedModalRect(guiLeft + 11, guiTop + 141, 198, xAxis >= 11 && xAxis <= 25 && yAxis >= 141 && yAxis <= 155, 14);
radiusField.drawTextBox();
minField.drawTextBox();
@@ -40,7 +40,7 @@ public class GuiDynamicTank extends GuiEmbeddedGaugeTile<TileEntityDynamicTank>
}
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
int scaledFluidLevel = tileEntity.getScaledFluidLevel(58);
if (scaledFluidLevel > 0 && tileEntity.structure != null) {
displayGauge(7, 14, scaledFluidLevel, tileEntity.structure.fluidStored, 0);
@@ -94,12 +94,12 @@ public class GuiElectrolyticSeparator extends GuiMekanismTile<TileEntityElectrol
}
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
int displayInt = chooseByMode(tileEntity.dumpLeft, 52, 60, 68);
drawTexturedModalRect(guiWidth + 8, guiHeight + 73, 176, displayInt, 8, 8);
drawTexturedModalRect(guiLeft + 8, guiTop + 73, 176, displayInt, 8, 8);
displayInt = chooseByMode(tileEntity.dumpRight, 52, 60, 68);
drawTexturedModalRect(guiWidth + 160, guiHeight + 73, 176, displayInt, 8, 8);
drawTexturedModalRect(guiLeft + 160, guiTop + 73, 176, displayInt, 8, 8);
}
private <T> T chooseByMode(TileEntityGasTank.GasMode dumping, T idleOption, T dumpingOption,
@@ -26,8 +26,6 @@ public abstract class GuiEmbeddedGaugeTile<TILE extends TileEntityContainerBlock
if (fluid == null) {
return;
}
int guiWidth = (width - xSize) / 2;
int guiHeight = (height - ySize) / 2;
int start = 0;
GLSMHelper.INSTANCE.color(fluid);
TextureAtlasSprite fluidTexture = MekanismRenderer.getFluidTexture(fluid, FluidType.STILL);
@@ -41,7 +39,7 @@ public abstract class GuiEmbeddedGaugeTile<TILE extends TileEntityContainerBlock
renderRemaining = scale;
scale = 0;
}
drawTexturedModalRect(guiWidth + xPos, guiHeight + yPos + 58 - renderRemaining - start, fluidTexture, 16, renderRemaining);
drawTexturedModalRect(guiLeft + xPos, guiTop + yPos + 58 - renderRemaining - start, fluidTexture, 16, renderRemaining);
start += 16;
if (renderRemaining == 0 || scale == 0) {
break;
@@ -49,6 +47,6 @@ public abstract class GuiEmbeddedGaugeTile<TILE extends TileEntityContainerBlock
}
GLSMHelper.INSTANCE.resetColor();
mc.renderEngine.bindTexture(getGaugeResource());
drawTexturedModalRect(guiWidth + xPos, guiHeight + yPos, 176, side == 0 ? 0 : 54, 16, 54);
drawTexturedModalRect(guiLeft + xPos, guiTop + yPos, 176, side == 0 ? 0 : 54, 16, 54);
}
}
@@ -78,16 +78,16 @@ public class GuiFactory extends GuiMekanismTile<TileEntityFactory> {
}
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
int displayInt = tileEntity.getScaledEnergyLevel(52);
drawTexturedModalRect(guiWidth + 165, guiHeight + 17 + 52 - displayInt, 176, 52 - displayInt, 4, displayInt);
drawTexturedModalRect(guiLeft + 165, guiTop + 17 + 52 - displayInt, 176, 52 - displayInt, 4, displayInt);
int xOffset = tileEntity.tier == FactoryTier.BASIC ? 59 : tileEntity.tier == FactoryTier.ADVANCED ? 39 : 33;
int xDistance = tileEntity.tier == FactoryTier.BASIC ? 38 : tileEntity.tier == FactoryTier.ADVANCED ? 26 : 19;
for (int i = 0; i < tileEntity.tier.processes; i++) {
int xPos = xOffset + (i * xDistance);
displayInt = tileEntity.getScaledProgress(20, i);
drawTexturedModalRect(guiWidth + xPos, guiHeight + 33, 176, 52, 8, displayInt);
drawTexturedModalRect(guiLeft + xPos, guiTop + 33, 176, 52, 8, displayInt);
}
if (tileEntity.getRecipeType().getFuelType() == MachineFuelType.ADVANCED) {
@@ -108,10 +108,8 @@ public class GuiFactory extends GuiMekanismTile<TileEntityFactory> {
public void displayGauge(int xPos, int yPos, int sizeX, int sizeY, TextureAtlasSprite icon) {
if (icon != null) {
int guiWidth = (width - xSize) / 2;
int guiHeight = (height - ySize) / 2;
mc.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
drawTexturedModalRect(guiWidth + xPos, guiHeight + yPos, icon, sizeX, sizeY);
drawTexturedModalRect(guiLeft + xPos, guiTop + yPos, icon, sizeX, sizeY);
}
}
@@ -83,41 +83,41 @@ public class GuiFormulaicAssemblicator extends GuiMekanismTile<TileEntityFormula
}
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
if (!tileEntity.autoMode) {
drawTexturedModalRect(guiWidth + 44, guiHeight + 75, 238, xAxis >= 44 && xAxis <= 60 && yAxis >= 75 && yAxis <= 91, 16);
drawTexturedModalRect(guiLeft + 44, guiTop + 75, 238, xAxis >= 44 && xAxis <= 60 && yAxis >= 75 && yAxis <= 91, 16);
} else {
drawTexturedModalRect(guiWidth + 44, guiHeight + 75, 238, 32, 16, 16);
drawTexturedModalRect(guiLeft + 44, guiTop + 75, 238, 32, 16, 16);
}
if (!tileEntity.autoMode && tileEntity.isRecipe) {
if (canEncode()) {
drawTexturedModalRect(guiWidth + 7, guiHeight + 45, 176, xAxis >= 7 && xAxis <= 21 && yAxis >= 45 && yAxis <= 59, 14);
drawTexturedModalRect(guiLeft + 7, guiTop + 45, 176, xAxis >= 7 && xAxis <= 21 && yAxis >= 45 && yAxis <= 59, 14);
} else {
drawTexturedModalRect(guiWidth + 7, guiHeight + 45, 176, 28, 14, 14);
drawTexturedModalRect(guiLeft + 7, guiTop + 45, 176, 28, 14, 14);
}
drawTexturedModalRect(guiWidth + 71, guiHeight + 75, 190, xAxis >= 71 && xAxis <= 87 && yAxis >= 75 && yAxis <= 91, 16);
drawTexturedModalRect(guiWidth + 89, guiHeight + 75, 206, xAxis >= 89 && xAxis <= 105 && yAxis >= 75 && yAxis <= 91, 16);
drawTexturedModalRect(guiLeft + 71, guiTop + 75, 190, xAxis >= 71 && xAxis <= 87 && yAxis >= 75 && yAxis <= 91, 16);
drawTexturedModalRect(guiLeft + 89, guiTop + 75, 206, xAxis >= 89 && xAxis <= 105 && yAxis >= 75 && yAxis <= 91, 16);
} else {
drawTexturedModalRect(guiWidth + 7, guiHeight + 45, 176, 28, 14, 14);
drawTexturedModalRect(guiWidth + 71, guiHeight + 75, 176 + 14, 32, 16, 16);
drawTexturedModalRect(guiWidth + 89, guiHeight + 75, 176 + 30, 32, 16, 16);
drawTexturedModalRect(guiLeft + 7, guiTop + 45, 176, 28, 14, 14);
drawTexturedModalRect(guiLeft + 71, guiTop + 75, 176 + 14, 32, 16, 16);
drawTexturedModalRect(guiLeft + 89, guiTop + 75, 176 + 30, 32, 16, 16);
}
if (tileEntity.formula != null) {
drawTexturedModalRect(guiWidth + 107, guiHeight + 75, 222, xAxis >= 107 && xAxis <= 123 && yAxis >= 75 && yAxis <= 91, 16);
drawTexturedModalRect(guiWidth + 26, guiHeight + 75, 238, 48, xAxis >= 26 && xAxis <= 42 && yAxis >= 75 && yAxis <= 91, 16);
drawTexturedModalRect(guiLeft + 107, guiTop + 75, 222, xAxis >= 107 && xAxis <= 123 && yAxis >= 75 && yAxis <= 91, 16);
drawTexturedModalRect(guiLeft + 26, guiTop + 75, 238, 48, xAxis >= 26 && xAxis <= 42 && yAxis >= 75 && yAxis <= 91, 16);
} else {
drawTexturedModalRect(guiWidth + 107, guiHeight + 75, 176 + 46, 32, 16, 16);
drawTexturedModalRect(guiWidth + 26, guiHeight + 75, 176 + 62, 48 + 32, 16, 16);
drawTexturedModalRect(guiLeft + 107, guiTop + 75, 176 + 46, 32, 16, 16);
drawTexturedModalRect(guiLeft + 26, guiTop + 75, 176 + 62, 48 + 32, 16, 16);
}
if (tileEntity.operatingTicks > 0) {
int display = (int) ((double) tileEntity.operatingTicks * 22 / (double) tileEntity.ticksRequired);
drawTexturedModalRect(guiWidth + 86, guiHeight + 43, 176, 48, display, 16);
drawTexturedModalRect(guiLeft + 86, guiTop + 43, 176, 48, display, 16);
}
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiSlot.png"));
drawTexturedModalRect(guiWidth + 90, guiHeight + 25, tileEntity.isRecipe ? 2 : 20, 39, 14, 12);
drawTexturedModalRect(guiLeft + 90, guiTop + 25, tileEntity.isRecipe ? 2 : 20, 39, 14, 12);
if (tileEntity.formula != null) {
for (int i = 0; i < 9; i++) {
@@ -127,8 +127,8 @@ public class GuiFormulaicAssemblicator extends GuiMekanismTile<TileEntityFormula
Slot slot = inventorySlots.inventorySlots.get(i + 20);
MekanismRenderHelper renderHelper = new MekanismRenderHelper(true);
int guiX = guiWidth + slot.xPos;
int guiY = guiHeight + slot.yPos;
int guiX = guiLeft + slot.xPos;
int guiY = guiTop + slot.yPos;
if (slot.getStack().isEmpty() || !tileEntity.formula.isIngredientInPos(tileEntity.getWorld(), slot.getStack(), i)) {
drawColorIcon(guiX, guiY, EnumColor.DARK_RED, 0.8F);
}
@@ -43,10 +43,10 @@ public class GuiFuelwoodHeater extends GuiMekanismTile<TileEntityFuelwoodHeater>
}
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
if (tileEntity.burnTime > 0) {
int displayInt = tileEntity.burnTime * 13 / tileEntity.maxBurnTime;
drawTexturedModalRect(guiWidth + 143, guiHeight + 30 + 12 - displayInt, 176, 12 - displayInt, 14, displayInt + 1);
drawTexturedModalRect(guiLeft + 143, guiTop + 30 + 12 - displayInt, 176, 12 - displayInt, 14, displayInt + 1);
}
}
@@ -54,12 +54,12 @@ public class GuiGasTank extends GuiMekanismTile<TileEntityGasTank> {
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
int displayInt = chooseByMode(tileEntity.dumping, 10, 18, 26);
drawTexturedModalRect(guiWidth + 160, guiHeight + 73, 176, displayInt, 8, 8);
drawTexturedModalRect(guiLeft + 160, guiTop + 73, 176, displayInt, 8, 8);
if (tileEntity.gasTank.getGas() != null) {
int scale = (int) (((double) tileEntity.gasTank.getStored() / tileEntity.tier.getStorage()) * 72);
drawTexturedModalRect(guiWidth + 65, guiHeight + 17, 176, 0, scale, 10);
drawTexturedModalRect(guiLeft + 65, guiTop + 17, 176, 0, scale, 10);
}
}
@@ -45,7 +45,7 @@ public class GuiInductionMatrix extends GuiMekanismTile<TileEntityInductionCasin
}
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
if (tileEntity.getScaledEnergyLevel(58) > 0) {
displayGauge(7, 14, tileEntity.getScaledEnergyLevel(58), 0);
displayGauge(23, 14, tileEntity.getScaledEnergyLevel(58), 1);
@@ -58,8 +58,6 @@ public class GuiInductionMatrix extends GuiMekanismTile<TileEntityInductionCasin
}
public void displayGauge(int xPos, int yPos, int scale, int side /*0-left, 1-right*/) {
int guiWidth = (width - xSize) / 2;
int guiHeight = (height - ySize) / 2;
int start = 0;
while (true) {
int renderRemaining;
@@ -71,13 +69,13 @@ public class GuiInductionMatrix extends GuiMekanismTile<TileEntityInductionCasin
scale = 0;
}
mc.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
drawTexturedModalRect(guiWidth + xPos, guiHeight + yPos + 58 - renderRemaining - start, MekanismRenderer.energyIcon, 16, renderRemaining);
drawTexturedModalRect(guiLeft + xPos, guiTop + yPos + 58 - renderRemaining - start, MekanismRenderer.energyIcon, 16, renderRemaining);
start += 16;
if (renderRemaining == 0 || scale == 0) {
break;
}
}
mc.renderEngine.bindTexture(getGuiLocation());
drawTexturedModalRect(guiWidth + xPos, guiHeight + yPos, 176, side == 0 ? 0 : 54, 16, 54);
drawTexturedModalRect(guiLeft + xPos, guiTop + yPos, 176, side == 0 ? 0 : 54, 16, 54);
}
}
@@ -72,7 +72,7 @@ public class GuiLaserAmplifier extends GuiMekanismTile<TileEntityLaserAmplifier>
}
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
minField.drawTextBox();
maxField.drawTextBox();
timerField.drawTextBox();
@@ -168,21 +168,18 @@ public class GuiLaserAmplifier extends GuiMekanismTile<TileEntityLaserAmplifier>
@Override
public void initGui() {
super.initGui();
int guiWidth = (width - xSize) / 2;
int guiHeight = (height - ySize) / 2;
String prevTime = timerField != null ? timerField.getText() : "";
timerField = new GuiTextField(0, fontRenderer, guiWidth + 96, guiHeight + 28, 36, 11);
timerField = new GuiTextField(0, fontRenderer, guiLeft + 96, guiTop + 28, 36, 11);
timerField.setMaxStringLength(4);
timerField.setText(prevTime);
String prevMin = minField != null ? minField.getText() : "";
minField = new GuiTextField(1, fontRenderer, guiWidth + 96, guiHeight + 43, 72, 11);
minField = new GuiTextField(1, fontRenderer, guiLeft + 96, guiTop + 43, 72, 11);
minField.setMaxStringLength(10);
minField.setText(prevMin);
String prevMax = maxField != null ? maxField.getText() : "";
maxField = new GuiTextField(2, fontRenderer, guiWidth + 96, guiHeight + 58, 72, 11);
maxField = new GuiTextField(2, fontRenderer, guiLeft + 96, guiTop + 58, 72, 11);
maxField.setMaxStringLength(10);
maxField.setText(prevMax);
}
@@ -458,10 +458,7 @@ public class GuiLogisticalSorter extends GuiMekanismTile<TileEntityLogisticalSor
}
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
// Draw main gui background
drawTexturedModalRect(guiLeft, guiTop);
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
// Draw scrollbar
drawTexturedModalRect(guiLeft + 154, guiTop + 18 + getScroll(), 232 + (needsScrollBars() ? 0 : 12), 0, 12, 15);
@@ -77,20 +77,18 @@ public abstract class GuiMekanism extends GuiContainer implements IGuiWrapper {
return isPointInRegion(slot.xPos, slot.yPos, 16, 16, mouseX, mouseY);
}
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
}
@Override
protected void drawGuiContainerBackgroundLayer(float partialTick, int mouseX, int mouseY) {
mc.renderEngine.bindTexture(getGuiLocation());
int guiWidth = (width - xSize) / 2;
int guiHeight = (height - ySize) / 2;
drawTexturedModalRect(guiWidth, guiHeight);
int xAxis = mouseX - guiWidth;
int yAxis = mouseY - guiHeight;
drawGuiContainerBackgroundLayer(guiWidth, guiHeight, xAxis, yAxis);
drawTexturedModalRect(guiLeft, guiTop);
int xAxis = mouseX - guiLeft;
int yAxis = mouseY - guiTop;
drawGuiContainerBackgroundLayer(xAxis, yAxis);
guiElements.forEach(element -> element.renderBackground(xAxis, yAxis, guiWidth, guiHeight));
guiElements.forEach(element -> element.renderBackground(xAxis, yAxis, guiLeft, guiTop));
}
@Override
@@ -74,11 +74,11 @@ public class GuiMetallurgicInfuser extends GuiMekanismTile<TileEntityMetallurgic
}
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
if (tileEntity.infuseStored.getType() != null) {
mc.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
int displayInt = tileEntity.getScaledInfuseLevel(52);
drawTexturedRectFromIcon(guiWidth + 7, guiHeight + 17 + 52 - displayInt, tileEntity.infuseStored.getType().sprite, 4, displayInt);
drawTexturedRectFromIcon(guiLeft + 7, guiTop + 17 + 52 - displayInt, tileEntity.infuseStored.getType().sprite, 4, displayInt);
}
}
@@ -72,10 +72,8 @@ public class GuiOredictionificator extends GuiMekanismTile<TileEntityOredictioni
@Override
public void initGui() {
super.initGui();
int guiWidth = (width - xSize) / 2;
int guiHeight = (height - ySize) / 2;
buttonList.clear();
buttonList.add(new GuiButton(0, guiWidth + 10, guiHeight + 86, 142, 20, LangUtils.localize("gui.newFilter")));
buttonList.add(new GuiButton(0, guiLeft + 10, guiTop + 86, 142, 20, LangUtils.localize("gui.newFilter")));
}
@Override
@@ -111,8 +109,8 @@ public class GuiOredictionificator extends GuiMekanismTile<TileEntityOredictioni
}
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
drawTexturedModalRect(guiWidth + 154, guiHeight + 18 + getScroll(), 232, 0, 12, 15);
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
drawTexturedModalRect(guiLeft + 154, guiTop + 18 + getScroll(), 232, 0, 12, 15);
for (int i = 0; i < 3; i++) {
if (tileEntity.filters.get(getFilterIndex() + i) != null) {
int yStart = i * 22 + 18;
@@ -120,7 +118,7 @@ public class GuiOredictionificator extends GuiMekanismTile<TileEntityOredictioni
if (mouseOver) {
GLSMHelper.INSTANCE.color(EnumColor.GREY, 3.0F);
}
drawTexturedModalRect(guiWidth + 10, guiHeight + yStart, 0, 230, 142, 22);
drawTexturedModalRect(guiLeft + 10, guiTop + yStart, 0, 230, 142, 22);
if (mouseOver) {
GLSMHelper.INSTANCE.resetColor();
}
@@ -57,14 +57,12 @@ public class GuiQuantumEntangloporter extends GuiMekanismTile<TileEntityQuantumE
@Override
public void initGui() {
super.initGui();
int guiWidth = (width - xSize) / 2;
int guiHeight = (height - ySize) / 2;
buttonList.clear();
publicButton = new GuiButton(0, guiWidth + 27, guiHeight + 14, 60, 20, LangUtils.localize("gui.public"));
privateButton = new GuiButton(1, guiWidth + 89, guiHeight + 14, 60, 20, LangUtils.localize("gui.private"));
setButton = new GuiButton(2, guiWidth + 27, guiHeight + 116, 60, 20, LangUtils.localize("gui.set"));
deleteButton = new GuiButton(3, guiWidth + 89, guiHeight + 116, 60, 20, LangUtils.localize("gui.delete"));
frequencyField = new GuiTextField(4, fontRenderer, guiWidth + 50, guiHeight + 104, 86, 11);
publicButton = new GuiButton(0, guiLeft + 27, guiTop + 14, 60, 20, LangUtils.localize("gui.public"));
privateButton = new GuiButton(1, guiLeft + 89, guiTop + 14, 60, 20, LangUtils.localize("gui.private"));
setButton = new GuiButton(2, guiLeft + 27, guiTop + 116, 60, 20, LangUtils.localize("gui.set"));
deleteButton = new GuiButton(3, guiLeft + 89, guiTop + 116, 60, 20, LangUtils.localize("gui.delete"));
frequencyField = new GuiTextField(4, fontRenderer, guiLeft + 50, guiTop + 104, 86, 11);
frequencyField.setMaxStringLength(FrequencyManager.MAX_FREQ_LENGTH);
frequencyField.setEnableBackgroundDrawing(false);
updateButtons();
@@ -207,8 +205,8 @@ public class GuiQuantumEntangloporter extends GuiMekanismTile<TileEntityQuantumE
}
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
drawTexturedModalRect(guiWidth + 137, guiHeight + 103, xSize, xAxis >= 137 && xAxis <= 148 && yAxis >= 103 && yAxis <= 114, 11);
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
drawTexturedModalRect(guiLeft + 137, guiTop + 103, xSize, xAxis >= 137 && xAxis <= 148 && yAxis >= 103 && yAxis <= 114, 11);
frequencyField.drawTextBox();
}
}
@@ -58,10 +58,8 @@ public class GuiResistiveHeater extends GuiMekanismTile<TileEntityResistiveHeate
@Override
public void initGui() {
super.initGui();
int guiWidth = (width - xSize) / 2;
int guiHeight = (height - ySize) / 2;
String prevEnergyUsage = energyUsageField != null ? energyUsageField.getText() : "";
energyUsageField = new GuiTextField(0, fontRenderer, guiWidth + 49, guiHeight + 52, 66, 11);
energyUsageField = new GuiTextField(0, fontRenderer, guiLeft + 49, guiTop + 52, 66, 11);
energyUsageField.setMaxStringLength(7);
energyUsageField.setEnableBackgroundDrawing(false);
energyUsageField.setText(prevEnergyUsage);
@@ -77,8 +75,8 @@ public class GuiResistiveHeater extends GuiMekanismTile<TileEntityResistiveHeate
}
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
drawTexturedModalRect(guiWidth + 116, guiHeight + 51, xSize, xAxis >= 116 && xAxis <= 126 && yAxis >= 51 && yAxis <= 61, 11);
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
drawTexturedModalRect(guiLeft + 116, guiTop + 51, xSize, xAxis >= 116 && xAxis <= 126 && yAxis >= 51 && yAxis <= 61, 11);
energyUsageField.drawTextBox();
}
@@ -92,10 +92,10 @@ public class GuiRotaryCondensentrator extends GuiMekanismTile<TileEntityRotaryCo
}
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
int displayInt = tileEntity.getScaledEnergyLevel(52);
drawTexturedModalRect(guiWidth + 116, guiHeight + 76, 176, 36, displayInt, 4);
drawTexturedModalRect(guiWidth + 4, guiHeight + 4, 176, xAxis >= 4 && xAxis <= 22 && yAxis >= 4 && yAxis <= 22, 18);
drawTexturedModalRect(guiLeft + 116, guiTop + 76, 176, 36, displayInt, 4);
drawTexturedModalRect(guiLeft + 4, guiTop + 4, 176, xAxis >= 4 && xAxis <= 22 && yAxis >= 4 && yAxis <= 22, 18);
}
@Override
@@ -43,11 +43,9 @@ public class GuiSecurityDesk extends GuiMekanismTile<TileEntitySecurityDesk> {
@Override
public void initGui() {
super.initGui();
int guiWidth = (width - xSize) / 2;
int guiHeight = (height - ySize) / 2;
buttonList.clear();
removeButton = new GuiButton(0, guiWidth + 13, guiHeight + 81, 122, 20, LangUtils.localize("gui.remove"));
trustedField = new GuiTextField(1, fontRenderer, guiWidth + 35, guiHeight + 69, 86, 11);
removeButton = new GuiButton(0, guiLeft + 13, guiTop + 81, 122, 20, LangUtils.localize("gui.remove"));
trustedField = new GuiTextField(1, fontRenderer, guiLeft + 35, guiTop + 69, 86, 11);
trustedField.setMaxStringLength(MAX_LENGTH);
trustedField.setEnableBackgroundDrawing(false);
updateButtons();
@@ -195,46 +193,46 @@ public class GuiSecurityDesk extends GuiMekanismTile<TileEntitySecurityDesk> {
}
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
//TODO: replace compare with uuid instead of clientOwner and player name
if (tileEntity.frequency != null && tileEntity.clientOwner != null && mc.player.getName().equals(tileEntity.clientOwner)) {
drawTexturedModalRect(guiWidth + 145, guiHeight + 78, xSize + (tileEntity.frequency.override ? 0 : 6), 22, 6, 6);
drawTexturedModalRect(guiWidth + 146, guiHeight + 59, xSize + 12, xAxis >= 146 && xAxis <= 162 && yAxis >= 59 && yAxis <= 75, 16);
drawTexturedModalRect(guiLeft + 145, guiTop + 78, xSize + (tileEntity.frequency.override ? 0 : 6), 22, 6, 6);
drawTexturedModalRect(guiLeft + 146, guiTop + 59, xSize + 12, xAxis >= 146 && xAxis <= 162 && yAxis >= 59 && yAxis <= 75, 16);
if (tileEntity.frequency.securityMode != SecurityMode.PUBLIC) {
if (xAxis >= 13 && xAxis <= 53 && yAxis >= 113 && yAxis <= 129) {
drawTexturedModalRect(guiWidth + 13, guiHeight + 113, xSize, 48, 40, 16);
drawTexturedModalRect(guiLeft + 13, guiTop + 113, xSize, 48, 40, 16);
} else {
drawTexturedModalRect(guiWidth + 13, guiHeight + 113, xSize, 64, 40, 16);
drawTexturedModalRect(guiLeft + 13, guiTop + 113, xSize, 64, 40, 16);
}
} else {
drawTexturedModalRect(guiWidth + 13, guiHeight + 113, xSize, 80, 40, 16);
drawTexturedModalRect(guiLeft + 13, guiTop + 113, xSize, 80, 40, 16);
}
if (tileEntity.frequency.securityMode != SecurityMode.PRIVATE) {
if (xAxis >= 54 && xAxis <= 94 && yAxis >= 113 && yAxis <= 129) {
drawTexturedModalRect(guiWidth + 54, guiHeight + 113, xSize + 40, 48, 40, 16);
drawTexturedModalRect(guiLeft + 54, guiTop + 113, xSize + 40, 48, 40, 16);
} else {
drawTexturedModalRect(guiWidth + 54, guiHeight + 113, xSize + 40, 64, 40, 16);
drawTexturedModalRect(guiLeft + 54, guiTop + 113, xSize + 40, 64, 40, 16);
}
} else {
drawTexturedModalRect(guiWidth + 54, guiHeight + 113, xSize + 40, 80, 40, 16);
drawTexturedModalRect(guiLeft + 54, guiTop + 113, xSize + 40, 80, 40, 16);
}
if (tileEntity.frequency.securityMode != SecurityMode.TRUSTED) {
if (xAxis >= 95 && xAxis <= 135 && yAxis >= 113 && yAxis <= 129) {
drawTexturedModalRect(guiWidth + 95, guiHeight + 113, xSize, 96, 40, 16);
drawTexturedModalRect(guiLeft + 95, guiTop + 113, xSize, 96, 40, 16);
} else {
drawTexturedModalRect(guiWidth + 95, guiHeight + 113, xSize, 112, 40, 16);
drawTexturedModalRect(guiLeft + 95, guiTop + 113, xSize, 112, 40, 16);
}
} else {
drawTexturedModalRect(guiWidth + 95, guiHeight + 113, xSize, 128, 40, 16);
drawTexturedModalRect(guiLeft + 95, guiTop + 113, xSize, 128, 40, 16);
}
} else {
drawTexturedModalRect(guiWidth + 145, guiHeight + 78, xSize, 28, 6, 6);
drawTexturedModalRect(guiWidth + 146, guiHeight + 59, xSize + 12, 32, 16, 16);
drawTexturedModalRect(guiWidth + 13, guiHeight + 113, xSize, 80, 40, 16);
drawTexturedModalRect(guiWidth + 54, guiHeight + 113, xSize + 40, 80, 40, 16);
drawTexturedModalRect(guiWidth + 95, guiHeight + 113, xSize, 128, 40, 16);
drawTexturedModalRect(guiLeft + 145, guiTop + 78, xSize, 28, 6, 6);
drawTexturedModalRect(guiLeft + 146, guiTop + 59, xSize + 12, 32, 16, 16);
drawTexturedModalRect(guiLeft + 13, guiTop + 113, xSize, 80, 40, 16);
drawTexturedModalRect(guiLeft + 54, guiTop + 113, xSize + 40, 80, 40, 16);
drawTexturedModalRect(guiLeft + 95, guiTop + 113, xSize, 128, 40, 16);
}
drawTexturedModalRect(guiWidth + 123, guiHeight + 68, xSize, xAxis >= 123 && xAxis <= 134 && yAxis >= 68 && yAxis <= 79, 11);
drawTexturedModalRect(guiLeft + 123, guiTop + 68, xSize, xAxis >= 123 && xAxis <= 134 && yAxis >= 68 && yAxis <= 79, 11);
trustedField.drawTextBox();
}
}
@@ -81,9 +81,9 @@ public class GuiSideConfiguration extends GuiMekanismTile<TileEntityContainerBlo
}
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
drawTexturedModalRect(guiWidth + 6, guiHeight + 6, 204, xAxis >= 6 && xAxis <= 20 && yAxis >= 6 && yAxis <= 20, 14);
drawTexturedModalRect(guiWidth + 156, guiHeight + 6, 190, xAxis >= 156 && xAxis <= 170 && yAxis >= 6 && yAxis <= 20, 14);
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
drawTexturedModalRect(guiLeft + 6, guiTop + 6, 204, xAxis >= 6 && xAxis <= 20 && yAxis >= 6 && yAxis <= 20, 14);
drawTexturedModalRect(guiLeft + 156, guiTop + 6, 190, xAxis >= 156 && xAxis <= 170 && yAxis >= 6 && yAxis <= 20, 14);
for (int i = 0; i < slotPosMap.size(); i++) {
int x = slotPosMap.get(i).xPos;
int y = slotPosMap.get(i).yPos;
@@ -93,12 +93,12 @@ public class GuiSideConfiguration extends GuiMekanismTile<TileEntityContainerBlo
if (doColor) {
GLSMHelper.INSTANCE.color(data.color);
}
drawTexturedModalRect(guiWidth + x, guiHeight + y, 176, xAxis >= x && xAxis <= x + 14 && yAxis >= y && yAxis <= y + 14, 14);
drawTexturedModalRect(guiLeft + x, guiTop + y, 176, xAxis >= x && xAxis <= x + 14 && yAxis >= y && yAxis <= y + 14, 14);
if (doColor) {
GLSMHelper.INSTANCE.resetColor();
}
} else {
drawTexturedModalRect(guiWidth + x, guiHeight + y, 176, 28, 14, 14);
drawTexturedModalRect(guiLeft + x, guiTop + y, 176, 28, 14, 14);
}
}
}
@@ -123,17 +123,15 @@ public class GuiTeleporter extends GuiMekanismTile<TileEntityTeleporter> {
@Override
public void initGui() {
super.initGui();
int guiWidth = (width - xSize) / 2;
int guiHeight = (height - ySize) / 2;
buttonList.clear();
publicButton = new GuiButton(0, guiWidth + 27, guiHeight + 14, 60, 20, LangUtils.localize("gui.public"));
privateButton = new GuiButton(1, guiWidth + 89, guiHeight + 14, 60, 20, LangUtils.localize("gui.private"));
setButton = new GuiButton(2, guiWidth + 27, guiHeight + 116, 60, 20, LangUtils.localize("gui.set"));
deleteButton = new GuiButton(3, guiWidth + 89, guiHeight + 116, 60, 20, LangUtils.localize("gui.delete"));
publicButton = new GuiButton(0, guiLeft + 27, guiTop + 14, 60, 20, LangUtils.localize("gui.public"));
privateButton = new GuiButton(1, guiLeft + 89, guiTop + 14, 60, 20, LangUtils.localize("gui.private"));
setButton = new GuiButton(2, guiLeft + 27, guiTop + 116, 60, 20, LangUtils.localize("gui.set"));
deleteButton = new GuiButton(3, guiLeft + 89, guiTop + 116, 60, 20, LangUtils.localize("gui.delete"));
if (!itemStack.isEmpty()) {
teleportButton = new GuiButton(4, guiWidth + 42, guiHeight + 140, 92, 20, LangUtils.localize("gui.teleport"));
teleportButton = new GuiButton(4, guiLeft + 42, guiTop + 140, 92, 20, LangUtils.localize("gui.teleport"));
}
frequencyField = new GuiTextField(5, fontRenderer, guiWidth + 50, guiHeight + 104, 86, 11);
frequencyField = new GuiTextField(5, fontRenderer, guiLeft + 50, guiTop + 104, 86, 11);
frequencyField.setMaxStringLength(FrequencyManager.MAX_FREQ_LENGTH);
frequencyField.setEnableBackgroundDrawing(false);
updateButtons();
@@ -312,10 +310,10 @@ public class GuiTeleporter extends GuiMekanismTile<TileEntityTeleporter> {
}
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
drawTexturedModalRect(guiWidth + 137, guiHeight + 103, xSize, xAxis >= 137 && xAxis <= 148 && yAxis >= 103 && yAxis <= 114, 11);
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
drawTexturedModalRect(guiLeft + 137, guiTop + 103, xSize, xAxis >= 137 && xAxis <= 148 && yAxis >= 103 && yAxis <= 114, 11);
int y = getFrequency() == null ? 94 : getStatus() == 2 ? 22 : getStatus() == 3 ? 40 : getStatus() == 4 ? 58 : 76;
drawTexturedModalRect(guiWidth + 6, guiHeight + 6, 176, y, 18, 18);
drawTexturedModalRect(guiLeft + 6, guiTop + 6, 176, y, 18, 18);
frequencyField.drawTextBox();
}
@@ -72,8 +72,8 @@ public class GuiThermalEvaporationController extends GuiMekanismTile<TileEntityT
}
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
drawTexturedModalRect(guiWidth + 49, guiHeight + 64, 176, 59, tileEntity.getScaledTempLevel(78), 8);
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
drawTexturedModalRect(guiLeft + 49, guiTop + 64, 176, 59, tileEntity.getScaledTempLevel(78), 8);
}
@Override
@@ -80,7 +80,7 @@ public class GuiThermoelectricBoiler extends GuiEmbeddedGaugeTile<TileEntityBoil
}
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
if (tileEntity.structure != null) {
if (tileEntity.getScaledWaterLevel(58) > 0) {
displayGauge(7, 14, tileEntity.getScaledWaterLevel(58), tileEntity.structure.waterStored);
@@ -48,18 +48,18 @@ public class GuiTransporterConfig extends GuiMekanismTile<TileEntityContainerBlo
}
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
drawTexturedModalRect(guiWidth + 6, guiHeight + 6, 190, xAxis >= 6 && xAxis <= 20 && yAxis >= 6 && yAxis <= 20, 14);
drawTexturedModalRect(guiWidth + 156, guiHeight + 6, 204, xAxis >= 156 && xAxis <= 170 && yAxis >= 6 && yAxis <= 20, 14);
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
drawTexturedModalRect(guiLeft + 6, guiTop + 6, 190, xAxis >= 6 && xAxis <= 20 && yAxis >= 6 && yAxis <= 20, 14);
drawTexturedModalRect(guiLeft + 156, guiTop + 6, 204, xAxis >= 156 && xAxis <= 170 && yAxis >= 6 && yAxis <= 20, 14);
for (int i = 0; i < slotPosMap.size(); i++) {
int x = slotPosMap.get(i).xPos;
int y = slotPosMap.get(i).yPos;
if (configurable.getConfig().getOutput(TransmissionType.ITEM, EnumFacing.byIndex(i)) != TileComponentConfig.EMPTY) {
GLSMHelper.INSTANCE.color(configurable.getEjector().getInputColor(EnumFacing.byIndex(i)));
drawTexturedModalRect(guiWidth + x, guiHeight + y, 176, xAxis >= x && xAxis <= x + 14 && yAxis >= y && yAxis <= y + 14, 14);
drawTexturedModalRect(guiLeft + x, guiTop + y, 176, xAxis >= x && xAxis <= x + 14 && yAxis >= y && yAxis <= y + 14, 14);
GLSMHelper.INSTANCE.resetColor();
} else {
drawTexturedModalRect(guiWidth + x, guiHeight + y, 176, 28, 14, 14);
drawTexturedModalRect(guiLeft + x, guiTop + y, 176, 28, 14, 14);
}
}
}
@@ -110,15 +110,15 @@ public class GuiUpgradeManagement extends GuiMekanism {
}
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
drawTexturedModalRect(guiWidth + 6, guiHeight + 6, 176, xAxis >= 6 && xAxis <= 20 && yAxis >= 6 && yAxis <= 20, 14);
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
drawTexturedModalRect(guiLeft + 6, guiTop + 6, 176, xAxis >= 6 && xAxis <= 20 && yAxis >= 6 && yAxis <= 20, 14);
if (selectedType == null) {
drawTexturedModalRect(guiWidth + 136, guiHeight + 57, 176 + 14, 24, 12, 12);
drawTexturedModalRect(guiLeft + 136, guiTop + 57, 176 + 14, 24, 12, 12);
} else {
drawTexturedModalRect(guiWidth + 136, guiHeight + 57, 176 + 14, xAxis >= 136 && xAxis <= 148 && yAxis >= 57 && yAxis <= 69, 12);
drawTexturedModalRect(guiLeft + 136, guiTop + 57, 176 + 14, xAxis >= 136 && xAxis <= 148 && yAxis >= 57 && yAxis <= 69, 12);
}
int displayInt = tileEntity.getComponent().getScaledUpgradeProgress(14);
drawTexturedModalRect(guiWidth + 154, guiHeight + 26, 176, 28, 10, displayInt);
drawTexturedModalRect(guiLeft + 154, guiTop + 26, 176, 28, 10, displayInt);
if (selectedType != null && tileEntity.getComponent().getUpgrades(selectedType) == 0) {
selectedType = null;
}
@@ -140,7 +140,7 @@ public class GuiUpgradeManagement extends GuiMekanism {
yRender = 166 + 12;
}
GLSMHelper.INSTANCE.color(upgrade.getColor(), 1.0F, 2.5F);
drawTexturedModalRect(guiWidth + xPos, guiHeight + yPos, 0, yRender, 58, 12);
drawTexturedModalRect(guiLeft + xPos, guiTop + yPos, 0, yRender, 58, 12);
GLSMHelper.INSTANCE.resetColor();
}
}
@@ -17,8 +17,8 @@ public abstract class GuiChemical<TILE extends TileEntityElectricBlock> extends
protected abstract void drawForegroundText();
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
drawTexturedModalRect(guiWidth + 116, guiHeight + 76, 176, 0, tileEntity.getScaledEnergyLevel(52), 4);
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
drawTexturedModalRect(guiLeft + 116, guiTop + 76, 176, 0, tileEntity.getScaledEnergyLevel(52), 4);
}
@Override
@@ -22,4 +22,11 @@ public abstract class GuiFilter<TILE extends TileEntityContainerBlock> extends G
protected abstract void addButtons(int guiWidth, int guiHeight);
protected abstract void sendPacketToServer(int guiID);
@Override
public void initGui() {
super.initGui();
buttonList.clear();
addButtons(guiLeft, guiTop);
}
}
@@ -39,10 +39,6 @@ public abstract class GuiFilterBase<FILTER extends IFilter, TILE extends TileEnt
@Override
public void initGui() {
super.initGui();
int guiWidth = (width - xSize) / 2;
int guiHeight = (height - ySize) / 2;
buttonList.clear();
addButtons(guiWidth, guiHeight);
if (isNew) {
buttonList.get(1).enabled = false;
}
@@ -22,15 +22,6 @@ public abstract class GuiFilterSelect<TILE extends TileEntityContainerBlock> ext
return xAxis >= 5 && xAxis <= 16 && yAxis >= 5 && yAxis <= 16;
}
@Override
public void initGui() {
super.initGui();
int guiWidth = (width - xSize) / 2;
int guiHeight = (height - ySize) / 2;
buttonList.clear();
addButtons(guiWidth, guiHeight);
}
@Override
protected void addButtons(int guiWidth, int guiHeight) {
buttonList.add(new GuiButton(0, guiWidth + 24, guiHeight + 32, 128, 20, LangUtils.localize("gui.itemstack")));
@@ -46,8 +37,8 @@ public abstract class GuiFilterSelect<TILE extends TileEntityContainerBlock> ext
}
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
drawTexturedModalRect(guiWidth + 5, guiHeight + 5, 176, inBounds(xAxis, yAxis), 11);
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
drawTexturedModalRect(guiLeft + 5, guiTop + 5, 176, inBounds(xAxis, yAxis), 11);
}
@Override
@@ -111,11 +111,11 @@ public class GuiOredictionificatorFilter extends GuiTextFilterBase<Oredictionifi
}
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
drawTexturedModalRect(guiWidth + 5, guiHeight + 5, 212, xAxis >= 5 && xAxis <= 16 && yAxis >= 5 && yAxis <= 16, 11);
drawTexturedModalRect(guiWidth + 31, guiHeight + 21, 200, xAxis >= 31 && xAxis <= 43 && yAxis >= 21 && yAxis <= 33, 12);
drawTexturedModalRect(guiWidth + 63, guiHeight + 21, 188, xAxis >= 63 && xAxis <= 75 && yAxis >= 21 && yAxis <= 33, 12);
drawTexturedModalRect(guiWidth + 130, guiHeight + 48, 176, xAxis >= 130 && xAxis <= 142 && yAxis >= 48 && yAxis <= 60, 12);
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
drawTexturedModalRect(guiLeft + 5, guiTop + 5, 212, xAxis >= 5 && xAxis <= 16 && yAxis >= 5 && yAxis <= 16, 11);
drawTexturedModalRect(guiLeft + 31, guiTop + 21, 200, xAxis >= 31 && xAxis <= 43 && yAxis >= 21 && yAxis <= 33, 12);
drawTexturedModalRect(guiLeft + 63, guiTop + 21, 188, xAxis >= 63 && xAxis <= 75 && yAxis >= 21 && yAxis <= 33, 12);
drawTexturedModalRect(guiLeft + 130, guiTop + 48, 176, xAxis >= 130 && xAxis <= 142 && yAxis >= 48 && yAxis <= 60, 12);
text.drawTextBox();
}
@@ -53,12 +53,10 @@ public class GuiTItemStackFilter extends GuiItemStackFilter<TItemStackFilter, Ti
@Override
public void initGui() {
super.initGui();
int guiWidth = (width - xSize) / 2;
int guiHeight = (height - ySize) / 2;
minField = new GuiTextField(2, fontRenderer, guiWidth + 149, guiHeight + 19, 20, 11);
minField = new GuiTextField(2, fontRenderer, guiLeft + 149, guiTop + 19, 20, 11);
minField.setMaxStringLength(2);
minField.setText("" + filter.min);
maxField = new GuiTextField(3, fontRenderer, guiWidth + 149, guiHeight + 31, 20, 11);
maxField = new GuiTextField(3, fontRenderer, guiLeft + 149, guiTop + 31, 20, 11);
maxField.setMaxStringLength(2);
maxField.setText("" + filter.max);
}
@@ -67,15 +67,15 @@ public abstract class GuiTextFilter<FILTER extends IFilter, TILE extends TileEnt
}
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
drawTexturedModalRect(guiWidth + 5, guiHeight + 5, 176, xAxis >= 5 && xAxis <= 16 && yAxis >= 5 && yAxis <= 16, 11);
drawTexturedModalRect(guiWidth + 131, guiHeight + 47, 187, xAxis >= 131 && xAxis <= 143 && yAxis >= 47 && yAxis <= 59, 12);
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
drawTexturedModalRect(guiLeft + 5, guiTop + 5, 176, xAxis >= 5 && xAxis <= 16 && yAxis >= 5 && yAxis <= 16, 11);
drawTexturedModalRect(guiLeft + 131, guiTop + 47, 187, xAxis >= 131 && xAxis <= 143 && yAxis >= 47 && yAxis <= 59, 12);
if (tileEntity instanceof TileEntityDigitalMiner) {
drawTexturedModalRect(guiWidth + 148, guiHeight + 45, 199, xAxis >= 148 && xAxis <= 162 && yAxis >= 45 && yAxis <= 59, 14);
drawTexturedModalRect(guiLeft + 148, guiTop + 45, 199, xAxis >= 148 && xAxis <= 162 && yAxis >= 45 && yAxis <= 59, 14);
text.drawTextBox();
drawRect(xAxis, yAxis, guiWidth, guiHeight);
drawRect(xAxis, yAxis, guiLeft, guiTop);
} else if (tileEntity instanceof TileEntityLogisticalSorter) {
drawTexturedModalRect(guiWidth + 11, guiHeight + 64, 199, xAxis >= 11 && xAxis <= 22 && yAxis >= 64 && yAxis <= 75, 11);
drawTexturedModalRect(guiLeft + 11, guiTop + 64, 199, xAxis >= 11 && xAxis <= 22 && yAxis >= 64 && yAxis <= 75, 11);
text.drawTextBox();
}
}
@@ -19,17 +19,17 @@ public abstract class GuiTypeFilter<FILTER extends IFilter, TILE extends TileEnt
}
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
drawTexturedModalRect(guiWidth + 5, guiHeight + 5, 176, xAxis >= 5 && xAxis <= 16 && yAxis >= 5 && yAxis <= 16, 11);
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
drawTexturedModalRect(guiLeft + 5, guiTop + 5, 176, xAxis >= 5 && xAxis <= 16 && yAxis >= 5 && yAxis <= 16, 11);
if (tileEntity instanceof TileEntityDigitalMiner) {
drawTexturedModalRect(guiWidth + 148, guiHeight + 45, 199, xAxis >= 148 && xAxis <= 162 && yAxis >= 45 && yAxis <= 59, 11);
drawRect(xAxis, yAxis, guiWidth, guiHeight);
drawTexturedModalRect(guiLeft + 148, guiTop + 45, 199, xAxis >= 148 && xAxis <= 162 && yAxis >= 45 && yAxis <= 59, 11);
drawRect(xAxis, yAxis, guiLeft, guiTop);
} else if (tileEntity instanceof TileEntityLogisticalSorter) {
drawTexturedModalRect(guiWidth + 11, guiHeight + 64, 198, xAxis >= 11 && xAxis <= 22 && yAxis >= 64 && yAxis <= 75, 11);
drawTexturedModalRect(guiLeft + 11, guiTop + 64, 198, xAxis >= 11 && xAxis <= 22 && yAxis >= 64 && yAxis <= 75, 11);
}
//Draw the itemstack specific background
drawItemStackBackground(guiWidth, guiHeight, xAxis, yAxis);
drawItemStackBackground(guiLeft, guiTop, xAxis, yAxis);
drawRect(xAxis, yAxis, guiWidth, guiHeight);
drawRect(xAxis, yAxis, guiLeft, guiTop);
}
}
@@ -34,18 +34,18 @@ public abstract class GuiRobit extends GuiMekanism {
protected abstract String getBackgroundImage();
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
boolean correctX = xAxis >= 179 && xAxis <= 197;
drawRect(correctX, yAxis, guiWidth, guiHeight, 10, 0);
drawRect(correctX, yAxis, guiWidth, guiHeight, 30, 36);
drawRect(correctX, yAxis, guiWidth, guiHeight, 50, 72);
drawRect(correctX, yAxis, guiWidth, guiHeight, 70, 108);
drawRect(correctX, yAxis, guiWidth, guiHeight, 90, 144);
drawRect(correctX, yAxis, 10, 0);
drawRect(correctX, yAxis, 30, 36);
drawRect(correctX, yAxis, 50, 72);
drawRect(correctX, yAxis, 70, 108);
drawRect(correctX, yAxis, 90, 144);
}
private void drawRect(boolean correctX, int yAxis, int guiWidth, int guiHeight, int heightBonus, int textureY) {
private void drawRect(boolean correctX, int yAxis, int heightBonus, int textureY) {
int yBonus = correctX && yAxis >= heightBonus && yAxis <= heightBonus + 18 ? 0 : 18;
drawTexturedModalRect(guiWidth + 179, guiHeight + heightBonus, 201, textureY + yBonus, 18, 18);
drawTexturedModalRect(guiLeft + 179, guiTop + heightBonus, 201, textureY + yBonus, 18, 18);
}
private void buttonClicked(int id) {
@@ -59,15 +59,11 @@ public class GuiRobitMain extends GuiMekanism {
@Override
public void initGui() {
super.initGui();
int guiWidth = (width - xSize) / 2;
int guiHeight = (height - ySize) / 2;
buttonList.clear();
buttonList.add(confirmName = new GuiButton(0, guiWidth + 58, guiHeight + 47, 60, 20, LangUtils.localize("gui.confirm")));
buttonList.add(confirmName = new GuiButton(0, guiLeft + 58, guiTop + 47, 60, 20, LangUtils.localize("gui.confirm")));
confirmName.visible = displayNameChange;
nameChangeField = new GuiTextField(1, fontRenderer, guiWidth + 48, guiHeight + 21, 80, 12);
nameChangeField = new GuiTextField(1, fontRenderer, guiLeft + 48, guiTop + 21, 80, 12);
nameChangeField.setMaxStringLength(12);
nameChangeField.setFocused(true);
}
@@ -117,20 +113,20 @@ public class GuiRobitMain extends GuiMekanism {
}
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
drawTexturedModalRect(guiWidth + 179, guiHeight + 10, 201, xAxis >= 179 && xAxis <= 197 && yAxis >= 10 && yAxis <= 28, 18);
drawTexturedModalRect(guiWidth + 179, guiHeight + 30, 201, 36, xAxis >= 179 && xAxis <= 197 && yAxis >= 30 && yAxis <= 48, 18);
drawTexturedModalRect(guiWidth + 179, guiHeight + 50, 201, 72, xAxis >= 179 && xAxis <= 197 && yAxis >= 50 && yAxis <= 68, 18);
drawTexturedModalRect(guiWidth + 179, guiHeight + 70, 201, 108, xAxis >= 179 && xAxis <= 197 && yAxis >= 70 && yAxis <= 88, 18);
drawTexturedModalRect(guiWidth + 179, guiHeight + 90, 201, 144, xAxis >= 179 && xAxis <= 197 && yAxis >= 90 && yAxis <= 108, 18);
drawTexturedModalRect(guiWidth + 152, guiHeight + 54, 201, 180, xAxis >= 152 && xAxis <= 170 && yAxis >= 54 && yAxis <= 72, 18);
drawTexturedModalRect(guiWidth + 6, guiHeight + 54, 201, 216, xAxis >= 6 && xAxis <= 24 && yAxis >= 54 && yAxis <= 72, 18);
drawTexturedModalRect(guiWidth + 6, guiHeight + 16, 219, 36, xAxis >= 6 && xAxis <= 24 && yAxis >= 16 && yAxis <= 34, 18);
drawTexturedModalRect(guiWidth + 6, guiHeight + 35, 219, 72, xAxis >= 6 && xAxis <= 24 && yAxis >= 35 && yAxis <= 53, 18);
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
drawTexturedModalRect(guiLeft + 179, guiTop + 10, 201, xAxis >= 179 && xAxis <= 197 && yAxis >= 10 && yAxis <= 28, 18);
drawTexturedModalRect(guiLeft + 179, guiTop + 30, 201, 36, xAxis >= 179 && xAxis <= 197 && yAxis >= 30 && yAxis <= 48, 18);
drawTexturedModalRect(guiLeft + 179, guiTop + 50, 201, 72, xAxis >= 179 && xAxis <= 197 && yAxis >= 50 && yAxis <= 68, 18);
drawTexturedModalRect(guiLeft + 179, guiTop + 70, 201, 108, xAxis >= 179 && xAxis <= 197 && yAxis >= 70 && yAxis <= 88, 18);
drawTexturedModalRect(guiLeft + 179, guiTop + 90, 201, 144, xAxis >= 179 && xAxis <= 197 && yAxis >= 90 && yAxis <= 108, 18);
drawTexturedModalRect(guiLeft + 152, guiTop + 54, 201, 180, xAxis >= 152 && xAxis <= 170 && yAxis >= 54 && yAxis <= 72, 18);
drawTexturedModalRect(guiLeft + 6, guiTop + 54, 201, 216, xAxis >= 6 && xAxis <= 24 && yAxis >= 54 && yAxis <= 72, 18);
drawTexturedModalRect(guiLeft + 6, guiTop + 16, 219, 36, xAxis >= 6 && xAxis <= 24 && yAxis >= 16 && yAxis <= 34, 18);
drawTexturedModalRect(guiLeft + 6, guiTop + 35, 219, 72, xAxis >= 6 && xAxis <= 24 && yAxis >= 35 && yAxis <= 53, 18);
int displayInt = getScaledEnergyLevel(120);
drawTexturedModalRect(guiWidth + 28, guiHeight + 75, 0, 166, displayInt, 4);
drawTexturedModalRect(guiLeft + 28, guiTop + 75, 0, 166, displayInt, 4);
if (displayNameChange) {
drawTexturedModalRect(guiWidth + 28, guiHeight + 17, 0, 166 + 4, 120, 54);
drawTexturedModalRect(guiLeft + 28, guiTop + 17, 0, 166 + 4, 120, 54);
nameChangeField.drawTextBox();
}
}
@@ -131,11 +131,11 @@ public class GuiRobitRepair extends GuiRobit implements IContainerListener {
}
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
super.drawGuiContainerBackgroundLayer(guiWidth, guiHeight, xAxis, yAxis);
drawTexturedModalRect(guiWidth + 59, guiHeight + 20, 0, ySize + (repairContainer.getSlot(0).getHasStack() ? 0 : 16), 110, 16);
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
super.drawGuiContainerBackgroundLayer(xAxis, yAxis);
drawTexturedModalRect(guiLeft + 59, guiTop + 20, 0, ySize + (repairContainer.getSlot(0).getHasStack() ? 0 : 16), 110, 16);
if ((repairContainer.getSlot(0).getHasStack() || repairContainer.getSlot(1).getHasStack()) && !repairContainer.getSlot(2).getHasStack()) {
drawTexturedModalRect(guiWidth + 99, guiHeight + 45, xSize + 18, 36, 28, 21);
drawTexturedModalRect(guiLeft + 99, guiTop + 45, xSize + 18, 36, 28, 21);
}
}
@@ -27,15 +27,15 @@ public class GuiRobitSmelting extends GuiRobit {
}
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
super.drawGuiContainerBackgroundLayer(guiWidth, guiHeight, xAxis, yAxis);
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
super.drawGuiContainerBackgroundLayer(xAxis, yAxis);
int displayInt;
if (robit.furnaceBurnTime > 0) {
displayInt = getBurnTimeRemainingScaled(12);
drawTexturedModalRect(guiWidth + 56, guiHeight + 36 + 12 - displayInt, 176 + 25 + 18, 36 + 12 - displayInt, 14, displayInt + 2);
drawTexturedModalRect(guiLeft + 56, guiTop + 36 + 12 - displayInt, 176 + 25 + 18, 36 + 12 - displayInt, 14, displayInt + 2);
}
displayInt = getCookProgressScaled(24);
drawTexturedModalRect(guiWidth + 79, guiHeight + 34, 176 + 25 + 18, 36 + 14, displayInt + 1, 16);
drawTexturedModalRect(guiLeft + 79, guiTop + 34, 176 + 25 + 18, 36 + 14, displayInt + 1, 16);
}
@Override
@@ -47,9 +47,9 @@ public class GuiBioGenerator extends GuiMekanismTile<TileEntityBioGenerator> {
}
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
int displayInt = tileEntity.getScaledFuelLevel(52);
drawTexturedModalRect(guiWidth + 7, guiHeight + 17 + 52 - displayInt, 176, 52 + 52 - displayInt, 4, displayInt);
drawTexturedModalRect(guiLeft + 7, guiTop + 17 + 52 - displayInt, 176, 52 + 52 - displayInt, 4, displayInt);
}
@Override
@@ -90,10 +90,10 @@ public class GuiIndustrialTurbine extends GuiEmbeddedGaugeTile<TileEntityTurbine
}
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
if (tileEntity.structure != null) {
int displayInt = chooseByMode(tileEntity.structure.dumpMode, 142, 150, 158);
drawTexturedModalRect(guiWidth + 160, guiHeight + 73, 176, displayInt, 8, 8);
drawTexturedModalRect(guiLeft + 160, guiTop + 73, 176, displayInt, 8, 8);
int scaledFluidLevel = tileEntity.getScaledFluidLevel(58);
if (scaledFluidLevel > 0) {
displayGauge(7, 14, scaledFluidLevel, tileEntity.structure.fluidStored, 0);
@@ -72,8 +72,8 @@ public class GuiReactorFuel extends GuiMekanismTile<TileEntityReactorController>
}
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
drawTexturedModalRect(guiWidth + 6, guiHeight + 6, 176, xAxis >= 6 && xAxis <= 20 && yAxis >= 6 && yAxis <= 20, 14);
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
drawTexturedModalRect(guiLeft + 6, guiTop + 6, 176, xAxis >= 6 && xAxis <= 20 && yAxis >= 6 && yAxis <= 20, 14);
injectionRateField.drawTextBox();
}
@@ -130,10 +130,8 @@ public class GuiReactorFuel extends GuiMekanismTile<TileEntityReactorController>
@Override
public void initGui() {
super.initGui();
int guiWidth = (width - xSize) / 2;
int guiHeight = (height - ySize) / 2;
String prevRad = injectionRateField != null ? injectionRateField.getText() : "";
injectionRateField = new GuiTextField(0, fontRenderer, guiWidth + 98, guiHeight + 115, 26, 11);
injectionRateField = new GuiTextField(0, fontRenderer, guiLeft + 98, guiTop + 115, 26, 11);
injectionRateField.setMaxStringLength(2);
injectionRateField.setText(prevRad);
}
@@ -119,8 +119,8 @@ public class GuiReactorHeat extends GuiMekanismTile<TileEntityReactorController>
}
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
drawTexturedModalRect(guiWidth + 6, guiHeight + 6, 176, xAxis >= 6 && xAxis <= 20 && yAxis >= 6 && yAxis <= 20, 14);
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
drawTexturedModalRect(guiLeft + 6, guiTop + 6, 176, xAxis >= 6 && xAxis <= 20 && yAxis >= 6 && yAxis <= 20, 14);
}
@Override
@@ -56,13 +56,13 @@ public class GuiReactorLogicAdapter extends GuiMekanismTile<TileEntityReactorLog
}
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
for (ReactorLogic type : ReactorLogic.values()) {
GLSMHelper.INSTANCE.color(EnumColor.RED);
drawTexturedModalRect(guiWidth + 24, guiHeight + 32 + (22 * type.ordinal()), 0, 166 + (type == tileEntity.logicType ? 22 : 0), 128, 22);
drawTexturedModalRect(guiLeft + 24, guiTop + 32 + (22 * type.ordinal()), 0, 166 + (type == tileEntity.logicType ? 22 : 0), 128, 22);
GLSMHelper.INSTANCE.resetColor();
}
drawTexturedModalRect(guiWidth + 23, guiHeight + 19, 176, xAxis >= 23 && xAxis <= 34 && yAxis >= 19 && yAxis <= 30, 11);
drawTexturedModalRect(guiLeft + 23, guiTop + 19, 176, xAxis >= 23 && xAxis <= 34 && yAxis >= 19 && yAxis <= 30, 11);
}
@Override
@@ -71,8 +71,8 @@ public class GuiReactorStats extends GuiMekanismTile<TileEntityReactorController
}
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
drawTexturedModalRect(guiWidth + 6, guiHeight + 6, 176, xAxis >= 6 && xAxis <= 20 && yAxis >= 6 && yAxis <= 20, 14);
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
drawTexturedModalRect(guiLeft + 6, guiTop + 6, 176, xAxis >= 6 && xAxis <= 20 && yAxis >= 6 && yAxis <= 20, 14);
}
@Override
@@ -40,8 +40,8 @@ public class GuiSolarGenerator extends GuiMekanismTile<TileEntitySolarGenerator>
}
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
drawTexturedModalRect(guiWidth + 20, guiHeight + 37, 176, 52, tileEntity.canSeeSun(), 12);
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
drawTexturedModalRect(guiLeft + 20, guiTop + 37, 176, 52, tileEntity.canSeeSun(), 12);
}
@Override
@@ -61,8 +61,8 @@ public class GuiWindGenerator extends GuiMekanismTile<TileEntityWindGenerator> {
}
@Override
protected void drawGuiContainerBackgroundLayer(int guiWidth, int guiHeight, int xAxis, int yAxis) {
drawTexturedModalRect(guiWidth + 20, guiHeight + 37, 176, 52, tileEntity.getActive(), 12);
protected void drawGuiContainerBackgroundLayer(int xAxis, int yAxis) {
drawTexturedModalRect(guiLeft + 20, guiTop + 37, 176, 52, tileEntity.getActive(), 12);
}
@Override