Revert "Changes to GUI's for more flexibility & consistancy"
This reverts commit 61406c2b2d
.
|
@ -38,14 +38,11 @@ public class GuiAdvancedElectricMachine extends GuiMekanism
|
||||||
super(tentity, new ContainerAdvancedElectricMachine(inventory, tentity));
|
super(tentity, new ContainerAdvancedElectricMachine(inventory, tentity));
|
||||||
tileEntity = tentity;
|
tileEntity = tentity;
|
||||||
|
|
||||||
xSize = 176;
|
guiElements.add(new GuiRedstoneControl(this, tileEntity, tileEntity.guiLocation));
|
||||||
ySize = 186;
|
guiElements.add(new GuiUpgradeTab(this, tileEntity, tileEntity.guiLocation));
|
||||||
|
guiElements.add(new GuiSideConfigurationTab(this, tileEntity, tileEntity.guiLocation));
|
||||||
guiElements.add(new GuiRedstoneControl(this, tileEntity, tileEntity.guiLocation, xSize, 63));
|
guiElements.add(new GuiTransporterConfigTab(this, 34, tileEntity, tileEntity.guiLocation));
|
||||||
guiElements.add(new GuiUpgradeTab(this, tileEntity, tileEntity.guiLocation, xSize, 5));
|
guiElements.add(new GuiPowerBar(this, tileEntity, tileEntity.guiLocation, 164, 15));
|
||||||
guiElements.add(new GuiSideConfigurationTab(this, tileEntity, tileEntity.guiLocation,-26, 5));
|
|
||||||
guiElements.add(new GuiTransporterConfigTab(this, tileEntity, tileEntity.guiLocation,-26, 34));
|
|
||||||
guiElements.add(new GuiPowerBar(this, tileEntity, tileEntity.guiLocation, 7, 35));
|
|
||||||
guiElements.add(new GuiEnergyInfo(new IInfoHandler() {
|
guiElements.add(new GuiEnergyInfo(new IInfoHandler() {
|
||||||
@Override
|
@Override
|
||||||
public List<String> getInfo()
|
public List<String> getInfo()
|
||||||
|
@ -53,12 +50,12 @@ public class GuiAdvancedElectricMachine extends GuiMekanism
|
||||||
String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.energyPerTick);
|
String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.energyPerTick);
|
||||||
return ListUtils.asList(MekanismUtils.localize("gui.using") + ": " + multiplier + "/t", MekanismUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
|
return ListUtils.asList(MekanismUtils.localize("gui.using") + ": " + multiplier + "/t", MekanismUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
|
||||||
}
|
}
|
||||||
}, this, tileEntity.guiLocation,-26, 63));
|
}, this, tileEntity.guiLocation));
|
||||||
|
|
||||||
guiElements.add(new GuiSlot(SlotType.INPUT, this, tileEntity.guiLocation, 39, 20));
|
guiElements.add(new GuiSlot(SlotType.INPUT, this, tileEntity.guiLocation, 55, 16));
|
||||||
guiElements.add(new GuiSlot(SlotType.POWER, this, tileEntity.guiLocation, 13, 71).with(SlotOverlay.POWER));
|
guiElements.add(new GuiSlot(SlotType.POWER, this, tileEntity.guiLocation, 30, 34).with(SlotOverlay.POWER));
|
||||||
guiElements.add(new GuiSlot(SlotType.EXTRA, this, tileEntity.guiLocation, 39, 56));
|
guiElements.add(new GuiSlot(SlotType.EXTRA, this, tileEntity.guiLocation, 55, 52));
|
||||||
guiElements.add(new GuiSlot(SlotType.OUTPUT_LARGE, this, tileEntity.guiLocation, 111, 34));
|
guiElements.add(new GuiSlot(SlotType.OUTPUT_LARGE, this, tileEntity.guiLocation, 111, 30));
|
||||||
|
|
||||||
guiElements.add(new GuiProgress(new IProgressInfoHandler()
|
guiElements.add(new GuiProgress(new IProgressInfoHandler()
|
||||||
{
|
{
|
||||||
|
@ -67,7 +64,7 @@ public class GuiAdvancedElectricMachine extends GuiMekanism
|
||||||
{
|
{
|
||||||
return tileEntity.getScaledProgress();
|
return tileEntity.getScaledProgress();
|
||||||
}
|
}
|
||||||
}, getProgressType(), this, tileEntity.guiLocation, 57, 39));
|
}, getProgressType(), this, tileEntity.guiLocation, 77, 37));
|
||||||
}
|
}
|
||||||
|
|
||||||
public ProgressBar getProgressType()
|
public ProgressBar getProgressType()
|
||||||
|
@ -78,17 +75,13 @@ public class GuiAdvancedElectricMachine extends GuiMekanism
|
||||||
@Override
|
@Override
|
||||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
||||||
{
|
{
|
||||||
int xAxis = mouseX - guiLeft;
|
int xAxis = (mouseX - (width - xSize) / 2);
|
||||||
int yAxis = mouseY - guiTop;
|
int yAxis = (mouseY - (height - ySize) / 2);
|
||||||
|
|
||||||
mc.renderEngine.bindTexture(tileEntity.guiLocation);
|
|
||||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
|
||||||
drawTexturedModalRect(guiLeft + 44, guiTop + 40, 176, 0, 8, 14);
|
|
||||||
|
|
||||||
fontRendererObj.drawString(tileEntity.getInventoryName(), (xSize/2)-(fontRendererObj.getStringWidth(tileEntity.getInventoryName())/2), 6, 0x404040);
|
fontRendererObj.drawString(tileEntity.getInventoryName(), (xSize/2)-(fontRendererObj.getStringWidth(tileEntity.getInventoryName())/2), 6, 0x404040);
|
||||||
fontRendererObj.drawString(MekanismUtils.localize("container.inventory"), 8, (ySize - 96) + 2, 0x404040);
|
fontRendererObj.drawString(MekanismUtils.localize("container.inventory"), 8, (ySize - 96) + 2, 0x404040);
|
||||||
|
|
||||||
if(xAxis >= 43 && xAxis <= 52 && yAxis >= 39 && yAxis <= 54)
|
if(xAxis >= 61 && xAxis <= 67 && yAxis >= 37 && yAxis <= 49)
|
||||||
{
|
{
|
||||||
drawCreativeTabHoveringText(tileEntity.gasTank.getGas() != null ? tileEntity.gasTank.getGas().getGas().getLocalizedName() + ": " + tileEntity.gasTank.getStored() : MekanismUtils.localize("gui.none"), xAxis, yAxis);
|
drawCreativeTabHoveringText(tileEntity.gasTank.getGas() != null ? tileEntity.gasTank.getGas().getGas().getLocalizedName() + ": " + tileEntity.gasTank.getStored() : MekanismUtils.localize("gui.none"), xAxis, yAxis);
|
||||||
}
|
}
|
||||||
|
@ -101,14 +94,16 @@ public class GuiAdvancedElectricMachine extends GuiMekanism
|
||||||
{
|
{
|
||||||
mc.renderEngine.bindTexture(tileEntity.guiLocation);
|
mc.renderEngine.bindTexture(tileEntity.guiLocation);
|
||||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
int guiWidth = (width - xSize) / 2;
|
||||||
|
int guiHeight = (height - ySize) / 2;
|
||||||
|
drawTexturedModalRect(guiWidth, guiHeight, 0, 0, xSize, ySize);
|
||||||
|
|
||||||
int displayInt;
|
int displayInt;
|
||||||
|
|
||||||
if(tileEntity.getScaledGasLevel(12) > 0)
|
if(tileEntity.getScaledGasLevel(12) > 0)
|
||||||
{
|
{
|
||||||
displayInt = tileEntity.getScaledGasLevel(12);
|
displayInt = tileEntity.getScaledGasLevel(12);
|
||||||
displayGauge(45, 41 + 12 - displayInt, 6, displayInt, tileEntity.gasTank.getGas());
|
displayGauge(61, 37 + 12 - displayInt, 6, displayInt, tileEntity.gasTank.getGas());
|
||||||
}
|
}
|
||||||
|
|
||||||
super.drawGuiContainerBackgroundLayer(partialTick, mouseX, mouseY);
|
super.drawGuiContainerBackgroundLayer(partialTick, mouseX, mouseY);
|
||||||
|
@ -121,7 +116,10 @@ public class GuiAdvancedElectricMachine extends GuiMekanism
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int guiWidth = (width - xSize) / 2;
|
||||||
|
int guiHeight = (height - ySize) / 2;
|
||||||
|
|
||||||
mc.renderEngine.bindTexture(MekanismRenderer.getBlocksTexture());
|
mc.renderEngine.bindTexture(MekanismRenderer.getBlocksTexture());
|
||||||
drawTexturedModelRectFromIcon(guiLeft + xPos, guiTop + yPos, gas.getGas().getIcon(), sizeX, sizeY);
|
drawTexturedModelRectFromIcon(guiWidth + xPos, guiHeight + yPos, gas.getGas().getIcon(), sizeX, sizeY);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -7,9 +7,9 @@ import mekanism.client.gui.element.GuiEnergyInfo;
|
||||||
import mekanism.client.gui.element.GuiEnergyInfo.IInfoHandler;
|
import mekanism.client.gui.element.GuiEnergyInfo.IInfoHandler;
|
||||||
import mekanism.client.gui.element.GuiPowerBar;
|
import mekanism.client.gui.element.GuiPowerBar;
|
||||||
import mekanism.client.gui.element.GuiProgress;
|
import mekanism.client.gui.element.GuiProgress;
|
||||||
|
import mekanism.client.gui.element.GuiRedstoneControl;
|
||||||
import mekanism.client.gui.element.GuiProgress.IProgressInfoHandler;
|
import mekanism.client.gui.element.GuiProgress.IProgressInfoHandler;
|
||||||
import mekanism.client.gui.element.GuiProgress.ProgressBar;
|
import mekanism.client.gui.element.GuiProgress.ProgressBar;
|
||||||
import mekanism.client.gui.element.GuiRedstoneControl;
|
|
||||||
import mekanism.client.gui.element.GuiSideConfigurationTab;
|
import mekanism.client.gui.element.GuiSideConfigurationTab;
|
||||||
import mekanism.client.gui.element.GuiSlot;
|
import mekanism.client.gui.element.GuiSlot;
|
||||||
import mekanism.client.gui.element.GuiSlot.SlotOverlay;
|
import mekanism.client.gui.element.GuiSlot.SlotOverlay;
|
||||||
|
@ -36,14 +36,11 @@ public class GuiChanceMachine extends GuiMekanism
|
||||||
super(tentity, new ContainerChanceMachine(inventory, tentity));
|
super(tentity, new ContainerChanceMachine(inventory, tentity));
|
||||||
tileEntity = tentity;
|
tileEntity = tentity;
|
||||||
|
|
||||||
xSize = 176;
|
guiElements.add(new GuiRedstoneControl(this, tileEntity, tileEntity.guiLocation));
|
||||||
ySize = 186;
|
guiElements.add(new GuiUpgradeTab(this, tileEntity, tileEntity.guiLocation));
|
||||||
|
guiElements.add(new GuiSideConfigurationTab(this, tileEntity, tileEntity.guiLocation));
|
||||||
guiElements.add(new GuiRedstoneControl(this, tileEntity, tileEntity.guiLocation, xSize, 63));
|
guiElements.add(new GuiTransporterConfigTab(this, 34, tileEntity, tileEntity.guiLocation));
|
||||||
guiElements.add(new GuiUpgradeTab(this, tileEntity, tileEntity.guiLocation, xSize, 5));
|
guiElements.add(new GuiPowerBar(this, tileEntity, tileEntity.guiLocation, 164, 15));
|
||||||
guiElements.add(new GuiSideConfigurationTab(this, tileEntity, tileEntity.guiLocation,-26, 5));
|
|
||||||
guiElements.add(new GuiTransporterConfigTab(this, tileEntity, tileEntity.guiLocation,-26, 34));
|
|
||||||
guiElements.add(new GuiPowerBar(this, tileEntity, tileEntity.guiLocation, 7, 35));
|
|
||||||
guiElements.add(new GuiEnergyInfo(new IInfoHandler() {
|
guiElements.add(new GuiEnergyInfo(new IInfoHandler() {
|
||||||
@Override
|
@Override
|
||||||
public List<String> getInfo()
|
public List<String> getInfo()
|
||||||
|
@ -51,11 +48,11 @@ public class GuiChanceMachine extends GuiMekanism
|
||||||
String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.energyPerTick);
|
String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.energyPerTick);
|
||||||
return ListUtils.asList(MekanismUtils.localize("gui.using") + ": " + multiplier + "/t", MekanismUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
|
return ListUtils.asList(MekanismUtils.localize("gui.using") + ": " + multiplier + "/t", MekanismUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
|
||||||
}
|
}
|
||||||
}, this, tileEntity.guiLocation,-26, 63));
|
}, this, tileEntity.guiLocation));
|
||||||
|
|
||||||
guiElements.add(new GuiSlot(SlotType.INPUT, this, tileEntity.guiLocation, 31, 38));
|
guiElements.add(new GuiSlot(SlotType.INPUT, this, tileEntity.guiLocation, 55, 16));
|
||||||
guiElements.add(new GuiSlot(SlotType.POWER, this, tileEntity.guiLocation, 13, 71).with(SlotOverlay.POWER));
|
guiElements.add(new GuiSlot(SlotType.POWER, this, tileEntity.guiLocation, 55, 52).with(SlotOverlay.POWER));
|
||||||
guiElements.add(new GuiSlot(SlotType.OUTPUT_WIDE, this, tileEntity.guiLocation, 103, 34));
|
guiElements.add(new GuiSlot(SlotType.OUTPUT_WIDE, this, tileEntity.guiLocation, 111, 30));
|
||||||
|
|
||||||
guiElements.add(new GuiProgress(new IProgressInfoHandler()
|
guiElements.add(new GuiProgress(new IProgressInfoHandler()
|
||||||
{
|
{
|
||||||
|
@ -64,7 +61,7 @@ public class GuiChanceMachine extends GuiMekanism
|
||||||
{
|
{
|
||||||
return tileEntity.getScaledProgress();
|
return tileEntity.getScaledProgress();
|
||||||
}
|
}
|
||||||
}, getProgressType(), this, tileEntity.guiLocation, 49, 39));
|
}, getProgressType(), this, tileEntity.guiLocation, 77, 37));
|
||||||
}
|
}
|
||||||
|
|
||||||
public ProgressBar getProgressType()
|
public ProgressBar getProgressType()
|
||||||
|
@ -86,7 +83,9 @@ public class GuiChanceMachine extends GuiMekanism
|
||||||
{
|
{
|
||||||
mc.renderEngine.bindTexture(tileEntity.guiLocation);
|
mc.renderEngine.bindTexture(tileEntity.guiLocation);
|
||||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
int guiWidth = (width - xSize) / 2;
|
||||||
|
int guiHeight = (height - ySize) / 2;
|
||||||
|
drawTexturedModalRect(guiWidth, guiHeight, 0, 0, xSize, ySize);
|
||||||
|
|
||||||
super.drawGuiContainerBackgroundLayer(partialTick, mouseX, mouseY);
|
super.drawGuiContainerBackgroundLayer(partialTick, mouseX, mouseY);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,6 @@ public class GuiCombiner extends GuiAdvancedElectricMachine
|
||||||
@Override
|
@Override
|
||||||
public ProgressBar getProgressType()
|
public ProgressBar getProgressType()
|
||||||
{
|
{
|
||||||
return ProgressBar.COMBINE;
|
return ProgressBar.STONE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,6 @@ public class GuiCrusher extends GuiElectricMachine
|
||||||
@Override
|
@Override
|
||||||
public ProgressBar getProgressType()
|
public ProgressBar getProgressType()
|
||||||
{
|
{
|
||||||
return ProgressBar.CRUSH2;
|
return ProgressBar.CRUSH;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,6 @@ import mekanism.common.util.MekanismUtils;
|
||||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||||
import net.minecraft.client.gui.GuiButton;
|
import net.minecraft.client.gui.GuiButton;
|
||||||
import net.minecraft.entity.player.InventoryPlayer;
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
import net.minecraft.util.ResourceLocation;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
@ -44,19 +43,15 @@ public class GuiDigitalMiner extends GuiMekanism
|
||||||
public GuiButton stopButton;
|
public GuiButton stopButton;
|
||||||
public GuiButton configButton;
|
public GuiButton configButton;
|
||||||
|
|
||||||
public ResourceLocation guiLocation = MekanismUtils.getResource(ResourceType.GUI, "GuiDigitalMiner.png");
|
|
||||||
|
|
||||||
public GuiDigitalMiner(InventoryPlayer inventory, TileEntityDigitalMiner tentity)
|
public GuiDigitalMiner(InventoryPlayer inventory, TileEntityDigitalMiner tentity)
|
||||||
{
|
{
|
||||||
super(tentity, new ContainerDigitalMiner(inventory, tentity));
|
super(tentity, new ContainerDigitalMiner(inventory, tentity));
|
||||||
tileEntity = tentity;
|
tileEntity = tentity;
|
||||||
|
|
||||||
//guiLocation = MekanismUtils.getResource(ResourceType.GUI, "GuiDigitalMiner.png");
|
guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiDigitalMiner.png")));
|
||||||
|
guiElements.add(new GuiUpgradeTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiDigitalMiner.png")));
|
||||||
guiElements.add(new GuiRedstoneControl(this, tileEntity, guiLocation, 176, 107));
|
guiElements.add(new GuiPowerBar(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiDigitalMiner.png"), 163, 23));
|
||||||
guiElements.add(new GuiUpgradeTab(this, tileEntity, guiLocation, 176, 5));
|
guiElements.add(new GuiVisualsTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiDigitalMiner.png")));
|
||||||
guiElements.add(new GuiPowerBar(this, tileEntity, guiLocation, 7, 23));
|
|
||||||
guiElements.add(new GuiVisualsTab(this, tileEntity, guiLocation, -26, 5));
|
|
||||||
guiElements.add(new GuiEnergyInfo(new IInfoHandler() {
|
guiElements.add(new GuiEnergyInfo(new IInfoHandler() {
|
||||||
@Override
|
@Override
|
||||||
public List<String> getInfo()
|
public List<String> getInfo()
|
||||||
|
@ -64,10 +59,10 @@ public class GuiDigitalMiner extends GuiMekanism
|
||||||
String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.getPerTick());
|
String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.getPerTick());
|
||||||
return ListUtils.asList(MekanismUtils.localize("gui.using") + ": " + multiplier + "/t", MekanismUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
|
return ListUtils.asList(MekanismUtils.localize("gui.using") + ": " + multiplier + "/t", MekanismUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
|
||||||
}
|
}
|
||||||
}, this, guiLocation,-26, 107));
|
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiDigitalMiner.png")));
|
||||||
|
|
||||||
guiElements.add(new GuiSlot(SlotType.POWER, this, guiLocation, 13, 59).with(SlotOverlay.POWER));
|
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiDigitalMiner.png"), 151, 5).with(SlotOverlay.POWER));
|
||||||
guiElements.add(new GuiSlot(SlotType.NORMAL, this, guiLocation, 13, 17));
|
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiDigitalMiner.png"), 143, 26));
|
||||||
|
|
||||||
ySize+=64;
|
ySize+=64;
|
||||||
}
|
}
|
||||||
|
@ -81,21 +76,21 @@ public class GuiDigitalMiner extends GuiMekanism
|
||||||
int guiHeight = (height - ySize) / 2;
|
int guiHeight = (height - ySize) / 2;
|
||||||
|
|
||||||
buttonList.clear();
|
buttonList.clear();
|
||||||
startButton = new GuiButton(0, guiWidth + 49, guiHeight + 17, 60, 20, MekanismUtils.localize("gui.start"));
|
startButton = new GuiButton(0, guiWidth + 69, guiHeight + 17, 60, 20, MekanismUtils.localize("gui.start"));
|
||||||
|
|
||||||
if(tileEntity.searcher.state != State.IDLE && tileEntity.running)
|
if(tileEntity.searcher.state != State.IDLE && tileEntity.running)
|
||||||
{
|
{
|
||||||
startButton.enabled = false;
|
startButton.enabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
stopButton = new GuiButton(1, guiWidth + 49, guiHeight + 37, 60, 20, MekanismUtils.localize("gui.stop"));
|
stopButton = new GuiButton(1, guiWidth + 69, guiHeight + 37, 60, 20, MekanismUtils.localize("gui.stop"));
|
||||||
|
|
||||||
if(tileEntity.searcher.state == State.IDLE || !tileEntity.running)
|
if(tileEntity.searcher.state == State.IDLE || !tileEntity.running)
|
||||||
{
|
{
|
||||||
stopButton.enabled = false;
|
stopButton.enabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
configButton = new GuiButton(2, guiWidth + 49, guiHeight + 57, 60, 20, MekanismUtils.localize("gui.config"));
|
configButton = new GuiButton(2, guiWidth + 69, guiHeight + 57, 60, 20, MekanismUtils.localize("gui.config"));
|
||||||
|
|
||||||
if(tileEntity.searcher.state != State.IDLE)
|
if(tileEntity.searcher.state != State.IDLE)
|
||||||
{
|
{
|
||||||
|
@ -165,21 +160,21 @@ public class GuiDigitalMiner extends GuiMekanism
|
||||||
@Override
|
@Override
|
||||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
||||||
{
|
{
|
||||||
int xAxis = mouseX - guiLeft;
|
int xAxis = (mouseX - (width - xSize) / 2);
|
||||||
int yAxis = mouseY - guiTop;
|
int yAxis = (mouseY - (height - ySize) / 2);
|
||||||
|
|
||||||
fontRendererObj.drawString(tileEntity.getInventoryName(), 8, 6, 0x404040);
|
fontRendererObj.drawString(tileEntity.getInventoryName(), 69, 6, 0x404040);
|
||||||
fontRendererObj.drawString(MekanismUtils.localize("container.inventory"), 8, (ySize - 96) + 2, 0x404040);
|
fontRendererObj.drawString(MekanismUtils.localize("container.inventory"), 8, (ySize - 96) + 2, 0x404040);
|
||||||
|
|
||||||
fontRendererObj.drawString(tileEntity.running ? MekanismUtils.localize("gui.digitalMiner.running") : MekanismUtils.localize("gui.idle"), 113, 10, 0x00CD00);
|
fontRendererObj.drawString(tileEntity.running ? MekanismUtils.localize("gui.digitalMiner.running") : MekanismUtils.localize("gui.idle"), 9, 10, 0x00CD00);
|
||||||
fontRendererObj.drawString(tileEntity.searcher.state.desc, 113, 19, 0x00CD00);
|
fontRendererObj.drawString(tileEntity.searcher.state.desc, 9, 19, 0x00CD00);
|
||||||
|
|
||||||
fontRendererObj.drawString(MekanismUtils.localize("gui.eject") + ": " + MekanismUtils.localize("gui." + (tileEntity.doEject ? "on" : "off")), 113, 30, 0x00CD00);
|
fontRendererObj.drawString(MekanismUtils.localize("gui.eject") + ": " + MekanismUtils.localize("gui." + (tileEntity.doEject ? "on" : "off")), 9, 30, 0x00CD00);
|
||||||
fontRendererObj.drawString(MekanismUtils.localize("gui.digitalMiner.pull") + ": " + MekanismUtils.localize("gui." + (tileEntity.doPull ? "on" : "off")), 113, 39, 0x00CD00);
|
fontRendererObj.drawString(MekanismUtils.localize("gui.digitalMiner.pull") + ": " + MekanismUtils.localize("gui." + (tileEntity.doPull ? "on" : "off")), 9, 39, 0x00CD00);
|
||||||
fontRendererObj.drawString(MekanismUtils.localize("gui.digitalMiner.silk") + ": " + MekanismUtils.localize("gui." + (tileEntity.silkTouch ? "on" : "off")), 113, 48, 0x00CD00);
|
fontRendererObj.drawString(MekanismUtils.localize("gui.digitalMiner.silk") + ": " + MekanismUtils.localize("gui." + (tileEntity.silkTouch ? "on" : "off")), 9, 48, 0x00CD00);
|
||||||
|
|
||||||
fontRendererObj.drawString(MekanismUtils.localize("gui.digitalMiner.toMine") + ":", 113, 59, 0x00CD00);
|
fontRendererObj.drawString(MekanismUtils.localize("gui.digitalMiner.toMine") + ":", 9, 59, 0x00CD00);
|
||||||
fontRendererObj.drawString("" + tileEntity.clientToMine, 113, 68, 0x00CD00);
|
fontRendererObj.drawString("" + tileEntity.clientToMine, 9, 68, 0x00CD00);
|
||||||
|
|
||||||
if(tileEntity.missingStack != null)
|
if(tileEntity.missingStack != null)
|
||||||
{
|
{
|
||||||
|
@ -190,15 +185,15 @@ public class GuiDigitalMiner extends GuiMekanism
|
||||||
|
|
||||||
mc.getTextureManager().bindTexture(MekanismRenderer.getBlocksTexture());
|
mc.getTextureManager().bindTexture(MekanismRenderer.getBlocksTexture());
|
||||||
|
|
||||||
itemRender.renderIcon(14, 18, MekanismRenderer.getColorIcon(EnumColor.DARK_RED), 16, 16);
|
itemRender.renderIcon(144, 27, MekanismRenderer.getColorIcon(EnumColor.DARK_RED), 16, 16);
|
||||||
itemRender.renderItemAndEffectIntoGUI(fontRendererObj, mc.getTextureManager(), tileEntity.missingStack, 14, 18);
|
itemRender.renderItemAndEffectIntoGUI(fontRendererObj, mc.getTextureManager(), tileEntity.missingStack, 144, 27);
|
||||||
|
|
||||||
GL11.glDisable(GL11.GL_LIGHTING);
|
GL11.glDisable(GL11.GL_LIGHTING);
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
mc.getTextureManager().bindTexture(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiSlot.png"));
|
mc.getTextureManager().bindTexture(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiSlot.png"));
|
||||||
drawTexturedModalRect(13, 17, SlotOverlay.CHECK.textureX, SlotOverlay.CHECK.textureY, 18, 18);
|
drawTexturedModalRect(143, 26, SlotOverlay.CHECK.textureX, SlotOverlay.CHECK.textureY, 18, 18);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(xAxis >= 164 && xAxis <= 168 && yAxis >= 25 && yAxis <= 77)
|
if(xAxis >= 164 && xAxis <= 168 && yAxis >= 25 && yAxis <= 77)
|
||||||
|
@ -206,19 +201,17 @@ public class GuiDigitalMiner extends GuiMekanism
|
||||||
drawCreativeTabHoveringText(MekanismUtils.getEnergyDisplay(tileEntity.getEnergy()), xAxis, yAxis);
|
drawCreativeTabHoveringText(MekanismUtils.getEnergyDisplay(tileEntity.getEnergy()), xAxis, yAxis);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Auto eject
|
if(xAxis >= 147 && xAxis <= 161 && yAxis >= 47 && yAxis <= 61)
|
||||||
if(xAxis >= 33 && xAxis <= 46 && yAxis >= 32 && yAxis <= 45)
|
|
||||||
{
|
{
|
||||||
drawCreativeTabHoveringText(MekanismUtils.localize("gui.autoEject"), xAxis, yAxis);
|
drawCreativeTabHoveringText(MekanismUtils.localize("gui.autoEject"), xAxis, yAxis);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Auto pull
|
if(xAxis >= 147 && xAxis <= 161 && yAxis >= 63 && yAxis <= 77)
|
||||||
if(xAxis >= 33 && xAxis <= 46 && yAxis >= 48 && yAxis <= 61)
|
|
||||||
{
|
{
|
||||||
drawCreativeTabHoveringText(MekanismUtils.localize("gui.digitalMiner.autoPull"), xAxis, yAxis);
|
drawCreativeTabHoveringText(MekanismUtils.localize("gui.digitalMiner.autoPull"), xAxis, yAxis);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(xAxis >= 13 && xAxis <= 30 && yAxis >= 17 && yAxis <= 34)
|
if(xAxis >= 144 && xAxis <= 160 && yAxis >= 27 && yAxis <= 43)
|
||||||
{
|
{
|
||||||
if(tileEntity.missingStack != null)
|
if(tileEntity.missingStack != null)
|
||||||
{
|
{
|
||||||
|
@ -229,14 +222,12 @@ public class GuiDigitalMiner extends GuiMekanism
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset
|
if(xAxis >= 131 && xAxis <= 145 && yAxis >= 47 && yAxis <= 61)
|
||||||
if(xAxis >= 33 && xAxis <= 46 && yAxis >= 17 && yAxis <= 30)
|
|
||||||
{
|
{
|
||||||
drawCreativeTabHoveringText(MekanismUtils.localize("gui.digitalMiner.reset"), xAxis, yAxis);
|
drawCreativeTabHoveringText(MekanismUtils.localize("gui.digitalMiner.reset"), xAxis, yAxis);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Silk touch
|
if(xAxis >= 131 && xAxis <= 145 && yAxis >= 63 && yAxis <= 77)
|
||||||
if(xAxis >= 33 && xAxis <= 46 && yAxis >= 63 && yAxis <= 76)
|
|
||||||
{
|
{
|
||||||
drawCreativeTabHoveringText(MekanismUtils.localize("gui.digitalMiner.silkTouch"), xAxis, yAxis);
|
drawCreativeTabHoveringText(MekanismUtils.localize("gui.digitalMiner.silkTouch"), xAxis, yAxis);
|
||||||
}
|
}
|
||||||
|
@ -249,31 +240,49 @@ public class GuiDigitalMiner extends GuiMekanism
|
||||||
{
|
{
|
||||||
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.GUI, "GuiDigitalMiner.png"));
|
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.GUI, "GuiDigitalMiner.png"));
|
||||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
int guiWidth = (width - xSize) / 2;
|
||||||
|
int guiHeight = (height - ySize) / 2;
|
||||||
|
drawTexturedModalRect(guiWidth, guiHeight, 0, 0, xSize, ySize);
|
||||||
|
|
||||||
int xAxis = mouseX - guiLeft;
|
int xAxis = mouseX - guiWidth;
|
||||||
int yAxis = mouseY - guiTop;
|
int yAxis = mouseY - guiHeight;
|
||||||
|
|
||||||
int displayInt;
|
int displayInt;
|
||||||
|
|
||||||
displayInt = tileEntity.getScaledEnergyLevel(52);
|
displayInt = tileEntity.getScaledEnergyLevel(52);
|
||||||
drawTexturedModalRect(guiLeft + 164, guiTop + 25 + 52 - displayInt, 176, 52 - displayInt, 4, displayInt);
|
drawTexturedModalRect(guiWidth + 164, guiHeight + 25 + 52 - displayInt, 176, 52 - displayInt, 4, displayInt);
|
||||||
|
|
||||||
// Reset
|
if(xAxis >= 147 && xAxis <= 161 && yAxis >= 47 && yAxis <= 61)
|
||||||
boolean mouseOver = xAxis >= 33 && xAxis <= 46 && yAxis >= 17 && yAxis <= 30;
|
{
|
||||||
drawTexturedModalRect(guiLeft + 33, guiTop + 17, 180, mouseOver? 0: 14, 14, 14);
|
drawTexturedModalRect(guiWidth + 147, guiHeight + 47, 176 + 4, 0, 14, 14);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
drawTexturedModalRect(guiWidth + 147, guiHeight + 47, 176 + 4, 14, 14, 14);
|
||||||
|
}
|
||||||
|
|
||||||
// Auto eject
|
if(xAxis >= 147 && xAxis <= 161 && yAxis >= 63 && yAxis <= 77)
|
||||||
mouseOver = xAxis >= 33 && xAxis <= 46 && yAxis >= 32 && yAxis <= 45;
|
{
|
||||||
drawTexturedModalRect(guiLeft + 33, guiTop + 32, tileEntity.doEject ? 194 : 180, mouseOver? 28: 42, 14, 14);
|
drawTexturedModalRect(guiWidth + 147, guiHeight + 63, 176 + 4 + 14, 0, 14, 14);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
drawTexturedModalRect(guiWidth + 147, guiHeight + 63, 176 + 4 + 14, 14, 14, 14);
|
||||||
|
}
|
||||||
|
|
||||||
// Auto pull
|
if(xAxis >= 131 && xAxis <= 145 && yAxis >= 47 && yAxis <= 61)
|
||||||
mouseOver = xAxis >= 33 && xAxis <= 46 && yAxis >= 48 && yAxis <= 61;
|
{
|
||||||
drawTexturedModalRect(guiLeft + 33, guiTop + 48, tileEntity.doPull ? 194 : 180, mouseOver? 56: 70, 14, 14);
|
drawTexturedModalRect(guiWidth + 131, guiHeight + 47, 176 + 4 + 28, 0, 14, 14);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
drawTexturedModalRect(guiWidth + 131, guiHeight + 47, 176 + 4 + 28, 14, 14, 14);
|
||||||
|
}
|
||||||
|
|
||||||
// Silk touch
|
if(xAxis >= 131 && xAxis <= 145 && yAxis >= 63 && yAxis <= 77)
|
||||||
mouseOver = xAxis >= 33 && xAxis <= 46 && yAxis >= 63 && yAxis <= 76;
|
{
|
||||||
drawTexturedModalRect(guiLeft + 33, guiTop + 63, tileEntity.silkTouch ? 194 : 180, mouseOver? 84: 98, 14, 14);
|
drawTexturedModalRect(guiWidth + 131, guiHeight + 63, 176 + 4 + 42, 0, 14, 14);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
drawTexturedModalRect(guiWidth + 131, guiHeight + 63, 176 + 4 + 42, 14, 14, 14);
|
||||||
|
}
|
||||||
|
|
||||||
super.drawGuiContainerBackgroundLayer(partialTick, mouseX, mouseY);
|
super.drawGuiContainerBackgroundLayer(partialTick, mouseX, mouseY);
|
||||||
}
|
}
|
||||||
|
@ -285,11 +294,10 @@ public class GuiDigitalMiner extends GuiMekanism
|
||||||
|
|
||||||
if(button == 0)
|
if(button == 0)
|
||||||
{
|
{
|
||||||
int xAxis = mouseX - guiLeft;
|
int xAxis = (mouseX - (width - xSize) / 2);
|
||||||
int yAxis = mouseY - guiTop;
|
int yAxis = (mouseY - (height - ySize) / 2);
|
||||||
|
|
||||||
// Auto eject
|
if(xAxis >= 147 && xAxis <= 161 && yAxis >= 47 && yAxis <= 61)
|
||||||
if(xAxis >= 33 && xAxis <= 46 && yAxis >= 32 && yAxis <= 45)
|
|
||||||
{
|
{
|
||||||
SoundHandler.playSound("gui.button.press");
|
SoundHandler.playSound("gui.button.press");
|
||||||
|
|
||||||
|
@ -299,8 +307,7 @@ public class GuiDigitalMiner extends GuiMekanism
|
||||||
Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data));
|
Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Auto pull
|
if(xAxis >= 147 && xAxis <= 161 && yAxis >= 63 && yAxis <= 77)
|
||||||
if(xAxis >= 33 && xAxis <= 46 && yAxis >= 48 && yAxis <= 61)
|
|
||||||
{
|
{
|
||||||
SoundHandler.playSound("gui.button.press");
|
SoundHandler.playSound("gui.button.press");
|
||||||
|
|
||||||
|
@ -310,8 +317,7 @@ public class GuiDigitalMiner extends GuiMekanism
|
||||||
Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data));
|
Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset
|
if(xAxis >= 131 && xAxis <= 145 && yAxis >= 47 && yAxis <= 61)
|
||||||
if(xAxis >= 33 && xAxis <= 46 && yAxis >= 17 && yAxis <= 30)
|
|
||||||
{
|
{
|
||||||
SoundHandler.playSound("gui.button.press");
|
SoundHandler.playSound("gui.button.press");
|
||||||
|
|
||||||
|
@ -321,8 +327,7 @@ public class GuiDigitalMiner extends GuiMekanism
|
||||||
Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data));
|
Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Silk touch
|
if(xAxis >= 131 && xAxis <= 145 && yAxis >= 63 && yAxis <= 77)
|
||||||
if(xAxis >= 33 && xAxis <= 46 && yAxis >= 63 && yAxis <= 76)
|
|
||||||
{
|
{
|
||||||
SoundHandler.playSound("gui.button.press");
|
SoundHandler.playSound("gui.button.press");
|
||||||
|
|
||||||
|
|
|
@ -36,14 +36,11 @@ public class GuiElectricMachine extends GuiMekanism
|
||||||
super(tentity, new ContainerElectricMachine(inventory, tentity));
|
super(tentity, new ContainerElectricMachine(inventory, tentity));
|
||||||
tileEntity = tentity;
|
tileEntity = tentity;
|
||||||
|
|
||||||
xSize = 176;
|
guiElements.add(new GuiRedstoneControl(this, tileEntity, tileEntity.guiLocation));
|
||||||
ySize = 186;
|
guiElements.add(new GuiUpgradeTab(this, tileEntity, tileEntity.guiLocation));
|
||||||
|
guiElements.add(new GuiSideConfigurationTab(this, tileEntity, tileEntity.guiLocation));
|
||||||
guiElements.add(new GuiRedstoneControl(this, tileEntity, tileEntity.guiLocation, xSize, 63));
|
guiElements.add(new GuiTransporterConfigTab(this, 34, tileEntity, tileEntity.guiLocation));
|
||||||
guiElements.add(new GuiUpgradeTab(this, tileEntity, tileEntity.guiLocation, xSize, 5));
|
guiElements.add(new GuiPowerBar(this, tileEntity, tileEntity.guiLocation, 164, 15));
|
||||||
guiElements.add(new GuiSideConfigurationTab(this, tileEntity, tileEntity.guiLocation,-26, 5));
|
|
||||||
guiElements.add(new GuiTransporterConfigTab(this, tileEntity, tileEntity.guiLocation,-26, 34));
|
|
||||||
guiElements.add(new GuiPowerBar(this, tileEntity, tileEntity.guiLocation, 7, 35));
|
|
||||||
guiElements.add(new GuiEnergyInfo(new IInfoHandler() {
|
guiElements.add(new GuiEnergyInfo(new IInfoHandler() {
|
||||||
@Override
|
@Override
|
||||||
public List<String> getInfo()
|
public List<String> getInfo()
|
||||||
|
@ -51,11 +48,11 @@ public class GuiElectricMachine extends GuiMekanism
|
||||||
String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.energyPerTick);
|
String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.energyPerTick);
|
||||||
return ListUtils.asList(MekanismUtils.localize("gui.using") + ": " + multiplier + "/t", MekanismUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
|
return ListUtils.asList(MekanismUtils.localize("gui.using") + ": " + multiplier + "/t", MekanismUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
|
||||||
}
|
}
|
||||||
}, this, tileEntity.guiLocation,-26, 63));
|
}, this, tileEntity.guiLocation));
|
||||||
|
|
||||||
guiElements.add(new GuiSlot(SlotType.INPUT, this, tileEntity.guiLocation, 39, 38));
|
guiElements.add(new GuiSlot(SlotType.INPUT, this, tileEntity.guiLocation, 55, 16));
|
||||||
guiElements.add(new GuiSlot(SlotType.POWER, this, tileEntity.guiLocation, 13, 71).with(SlotOverlay.POWER));
|
guiElements.add(new GuiSlot(SlotType.POWER, this, tileEntity.guiLocation, 55, 52).with(SlotOverlay.POWER));
|
||||||
guiElements.add(new GuiSlot(SlotType.OUTPUT_LARGE, this, tileEntity.guiLocation, 111, 34));
|
guiElements.add(new GuiSlot(SlotType.OUTPUT_LARGE, this, tileEntity.guiLocation, 111, 30));
|
||||||
|
|
||||||
guiElements.add(new GuiProgress(new IProgressInfoHandler()
|
guiElements.add(new GuiProgress(new IProgressInfoHandler()
|
||||||
{
|
{
|
||||||
|
@ -64,7 +61,7 @@ public class GuiElectricMachine extends GuiMekanism
|
||||||
{
|
{
|
||||||
return tileEntity.getScaledProgress();
|
return tileEntity.getScaledProgress();
|
||||||
}
|
}
|
||||||
}, getProgressType(), this, tileEntity.guiLocation, 57, 39));
|
}, getProgressType(), this, tileEntity.guiLocation, 77, 37));
|
||||||
}
|
}
|
||||||
|
|
||||||
public ProgressBar getProgressType()
|
public ProgressBar getProgressType()
|
||||||
|
@ -86,7 +83,9 @@ public class GuiElectricMachine extends GuiMekanism
|
||||||
{
|
{
|
||||||
mc.renderEngine.bindTexture(tileEntity.guiLocation);
|
mc.renderEngine.bindTexture(tileEntity.guiLocation);
|
||||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
int guiWidth = (width - xSize) / 2;
|
||||||
|
int guiHeight = (height - ySize) / 2;
|
||||||
|
drawTexturedModalRect(guiWidth, guiHeight, 0, 0, xSize, ySize);
|
||||||
|
|
||||||
super.drawGuiContainerBackgroundLayer(partialTick, mouseX, mouseY);
|
super.drawGuiContainerBackgroundLayer(partialTick, mouseX, mouseY);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,6 @@ public class GuiEnrichmentChamber extends GuiElectricMachine
|
||||||
@Override
|
@Override
|
||||||
public ProgressBar getProgressType()
|
public ProgressBar getProgressType()
|
||||||
{
|
{
|
||||||
return ProgressBar.ENRICH;
|
return ProgressBar.BLUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,8 +79,8 @@ public abstract class GuiMekanism extends GuiContainer implements IGuiWrapper
|
||||||
{
|
{
|
||||||
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
||||||
|
|
||||||
int xAxis = mouseX - guiLeft;
|
int xAxis = (mouseX - (width - xSize) / 2);
|
||||||
int yAxis = mouseY - guiTop;
|
int yAxis = (mouseY - (height - ySize) / 2);
|
||||||
|
|
||||||
for(GuiElement element : guiElements)
|
for(GuiElement element : guiElements)
|
||||||
{
|
{
|
||||||
|
@ -150,20 +150,23 @@ public abstract class GuiMekanism extends GuiContainer implements IGuiWrapper
|
||||||
@Override
|
@Override
|
||||||
protected void drawGuiContainerBackgroundLayer(float partialTick, int mouseX, int mouseY)
|
protected void drawGuiContainerBackgroundLayer(float partialTick, int mouseX, int mouseY)
|
||||||
{
|
{
|
||||||
int xAxis = mouseX - guiLeft;
|
int guiWidth = (width - xSize) / 2;
|
||||||
int yAxis = mouseY - guiTop;
|
int guiHeight = (height - ySize) / 2;
|
||||||
|
|
||||||
|
int xAxis = mouseX - guiWidth;
|
||||||
|
int yAxis = mouseY - guiHeight;
|
||||||
|
|
||||||
for(GuiElement element : guiElements)
|
for(GuiElement element : guiElements)
|
||||||
{
|
{
|
||||||
element.renderBackground(xAxis, yAxis, guiLeft, guiTop);
|
element.renderBackground(xAxis, yAxis, guiWidth, guiHeight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void mouseClicked(int mouseX, int mouseY, int button)
|
protected void mouseClicked(int mouseX, int mouseY, int button)
|
||||||
{
|
{
|
||||||
int xAxis = mouseX - guiLeft;
|
int xAxis = (mouseX - (width - xSize) / 2);
|
||||||
int yAxis = mouseY - guiTop;
|
int yAxis = (mouseY - (height - ySize) / 2);
|
||||||
|
|
||||||
for(GuiElement element : guiElements)
|
for(GuiElement element : guiElements)
|
||||||
{
|
{
|
||||||
|
@ -227,8 +230,8 @@ public abstract class GuiMekanism extends GuiContainer implements IGuiWrapper
|
||||||
{
|
{
|
||||||
super.mouseClickMove(mouseX, mouseY, button, ticks);
|
super.mouseClickMove(mouseX, mouseY, button, ticks);
|
||||||
|
|
||||||
int xAxis = mouseX - guiLeft;
|
int xAxis = (mouseX - (width - xSize) / 2);
|
||||||
int yAxis = mouseY - guiTop;
|
int yAxis = (mouseY - (height - ySize) / 2);
|
||||||
|
|
||||||
for(GuiElement element : guiElements)
|
for(GuiElement element : guiElements)
|
||||||
{
|
{
|
||||||
|
@ -241,8 +244,8 @@ public abstract class GuiMekanism extends GuiContainer implements IGuiWrapper
|
||||||
{
|
{
|
||||||
super.mouseMovedOrUp(mouseX, mouseY, type);
|
super.mouseMovedOrUp(mouseX, mouseY, type);
|
||||||
|
|
||||||
int xAxis = mouseX - guiLeft;
|
int xAxis = (mouseX - (width - xSize) / 2);
|
||||||
int yAxis = mouseY - guiTop;
|
int yAxis = (mouseY - (height - ySize) / 2);
|
||||||
|
|
||||||
for(GuiElement element : guiElements)
|
for(GuiElement element : guiElements)
|
||||||
{
|
{
|
||||||
|
@ -257,12 +260,12 @@ public abstract class GuiMekanism extends GuiContainer implements IGuiWrapper
|
||||||
|
|
||||||
public int getXPos()
|
public int getXPos()
|
||||||
{
|
{
|
||||||
return guiLeft;
|
return (width - xSize) / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getYPos()
|
public int getYPos()
|
||||||
{
|
{
|
||||||
return guiTop;
|
return (height - ySize) / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected FontRenderer getFontRenderer()
|
protected FontRenderer getFontRenderer()
|
||||||
|
|
|
@ -17,6 +17,6 @@ public class GuiOsmiumCompressor extends GuiAdvancedElectricMachine
|
||||||
@Override
|
@Override
|
||||||
public ProgressBar getProgressType()
|
public ProgressBar getProgressType()
|
||||||
{
|
{
|
||||||
return ProgressBar.COMPRESS;
|
return ProgressBar.RED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,6 @@ public class GuiPrecisionSawmill extends GuiChanceMachine
|
||||||
@Override
|
@Override
|
||||||
public ProgressBar getProgressType()
|
public ProgressBar getProgressType()
|
||||||
{
|
{
|
||||||
return ProgressBar.SAW;
|
return ProgressBar.PURPLE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,8 @@ package mekanism.client.gui.element;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import mekanism.client.gui.IGuiWrapper;
|
import mekanism.client.gui.IGuiWrapper;
|
||||||
import mekanism.common.ObfuscatedNames;
|
import mekanism.common.ObfuscatedNames;
|
||||||
import mekanism.common.util.MekanismUtils;
|
import mekanism.common.util.MekanismUtils;
|
||||||
|
@ -9,9 +11,6 @@ import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.FontRenderer;
|
import net.minecraft.client.gui.FontRenderer;
|
||||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
|
||||||
|
|
||||||
import codechicken.lib.vec.Rectangle4i;
|
import codechicken.lib.vec.Rectangle4i;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
@ -19,11 +18,6 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public abstract class GuiElement
|
public abstract class GuiElement
|
||||||
{
|
{
|
||||||
protected int lmntLeft = 0;
|
|
||||||
protected int lmntTop = 0;
|
|
||||||
protected int lmntWidth = 26;
|
|
||||||
protected int lmntHeight = 26;
|
|
||||||
|
|
||||||
public static Minecraft mc = Minecraft.getMinecraft();
|
public static Minecraft mc = Minecraft.getMinecraft();
|
||||||
|
|
||||||
public ResourceLocation RESOURCE;
|
public ResourceLocation RESOURCE;
|
||||||
|
@ -133,10 +127,7 @@ public abstract class GuiElement
|
||||||
|
|
||||||
public void mouseMovedOrUp(int x, int y, int type) {}
|
public void mouseMovedOrUp(int x, int y, int type) {}
|
||||||
|
|
||||||
public Rectangle4i getBounds( int guiLeft, int guiTop )
|
public abstract Rectangle4i getBounds(int guiWidth, int guiHeight);
|
||||||
{
|
|
||||||
return new Rectangle4i(guiLeft + lmntLeft, guiTop + lmntTop, lmntWidth, lmntHeight);
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract void renderBackground(int xAxis, int yAxis, int guiWidth, int guiHeight);
|
public abstract void renderBackground(int xAxis, int yAxis, int guiWidth, int guiHeight);
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@ import mekanism.common.util.MekanismUtils.ResourceType;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import codechicken.lib.vec.Rectangle4i;
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public class GuiEnergyInfo extends GuiElement
|
public class GuiEnergyInfo extends GuiElement
|
||||||
|
@ -18,20 +19,13 @@ public class GuiEnergyInfo extends GuiElement
|
||||||
{
|
{
|
||||||
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiEnergyInfo.png"), gui, def);
|
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiEnergyInfo.png"), gui, def);
|
||||||
|
|
||||||
lmntLeft = -26;
|
|
||||||
lmntTop = 138;
|
|
||||||
|
|
||||||
infoHandler = handler;
|
infoHandler = handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GuiEnergyInfo(IInfoHandler handler, IGuiWrapper gui, ResourceLocation def, int guiLeft, int guiTop)
|
@Override
|
||||||
|
public Rectangle4i getBounds(int guiWidth, int guiHeight)
|
||||||
{
|
{
|
||||||
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiEnergyInfo.png"), gui, def);
|
return new Rectangle4i(guiWidth - 26, guiHeight + 138, 26, 26);
|
||||||
|
|
||||||
lmntLeft = guiLeft;
|
|
||||||
lmntTop = guiTop;
|
|
||||||
|
|
||||||
infoHandler = handler;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static interface IInfoHandler
|
public static interface IInfoHandler
|
||||||
|
@ -40,11 +34,11 @@ public class GuiEnergyInfo extends GuiElement
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderBackground(int xAxis, int yAxis, int guiLeft, int guiTop)
|
public void renderBackground(int xAxis, int yAxis, int guiWidth, int guiHeight)
|
||||||
{
|
{
|
||||||
mc.renderEngine.bindTexture(RESOURCE);
|
mc.renderEngine.bindTexture(RESOURCE);
|
||||||
|
|
||||||
guiObj.drawTexturedRect(guiLeft + lmntLeft, guiTop + lmntTop, 0, 0, lmntWidth, lmntHeight);
|
guiObj.drawTexturedRect(guiWidth - 26, guiHeight + 138, 0, 0, 26, 26);
|
||||||
|
|
||||||
mc.renderEngine.bindTexture(defaultLocation);
|
mc.renderEngine.bindTexture(defaultLocation);
|
||||||
}
|
}
|
||||||
|
@ -52,7 +46,7 @@ public class GuiEnergyInfo extends GuiElement
|
||||||
@Override
|
@Override
|
||||||
public void renderForeground(int xAxis, int yAxis)
|
public void renderForeground(int xAxis, int yAxis)
|
||||||
{
|
{
|
||||||
if(xAxis >= lmntLeft + 5 && xAxis <= lmntLeft + 23 && yAxis >= lmntTop + 4 && yAxis <= lmntTop + 22)
|
if(xAxis >= -21 && xAxis <= -3 && yAxis >= 142 && yAxis <= 160)
|
||||||
{
|
{
|
||||||
displayTooltips(infoHandler.getInfo(), xAxis, yAxis);
|
displayTooltips(infoHandler.getInfo(), xAxis, yAxis);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,12 +12,17 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public class GuiPowerBar extends GuiElement
|
public class GuiPowerBar extends GuiElement
|
||||||
{
|
{
|
||||||
|
private int xLocation;
|
||||||
|
private int yLocation;
|
||||||
|
|
||||||
|
private int width = 6;
|
||||||
|
private int height = 56;
|
||||||
private int innerOffsetY = 2;
|
private int innerOffsetY = 2;
|
||||||
|
|
||||||
private TileEntityElectricBlock tileEntity;
|
private TileEntityElectricBlock tileEntity;
|
||||||
private IPowerInfoHandler handler;
|
private IPowerInfoHandler handler;
|
||||||
|
|
||||||
public GuiPowerBar(IGuiWrapper gui, TileEntityElectricBlock tile, ResourceLocation def, int guiLeft, int guiTop)
|
public GuiPowerBar(IGuiWrapper gui, TileEntityElectricBlock tile, ResourceLocation def, int x, int y)
|
||||||
{
|
{
|
||||||
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiPowerBar.png"), gui, def);
|
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiPowerBar.png"), gui, def);
|
||||||
|
|
||||||
|
@ -37,28 +42,24 @@ public class GuiPowerBar extends GuiElement
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
lmntLeft = guiLeft;
|
xLocation = x;
|
||||||
lmntTop = guiTop;
|
yLocation = y;
|
||||||
lmntWidth = 6;
|
|
||||||
lmntHeight = 54;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public GuiPowerBar(IGuiWrapper gui, IPowerInfoHandler h, ResourceLocation def, int guiLeft, int guiTop)
|
public GuiPowerBar(IGuiWrapper gui, IPowerInfoHandler h, ResourceLocation def, int x, int y)
|
||||||
{
|
{
|
||||||
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiPowerBar.png"), gui, def);
|
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiPowerBar.png"), gui, def);
|
||||||
|
|
||||||
handler = h;
|
handler = h;
|
||||||
|
|
||||||
lmntLeft = guiLeft;
|
xLocation = x;
|
||||||
lmntTop = guiTop;
|
yLocation = y;
|
||||||
lmntWidth = 6;
|
|
||||||
lmntHeight = 54;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Rectangle4i getBounds(int guiLeft, int guiTop)
|
public Rectangle4i getBounds(int guiWidth, int guiHeight)
|
||||||
{
|
{
|
||||||
return new Rectangle4i(guiLeft + lmntLeft, guiTop + lmntTop, lmntWidth, lmntHeight);
|
return new Rectangle4i(guiWidth + xLocation, guiHeight + yLocation, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static abstract class IPowerInfoHandler
|
public static abstract class IPowerInfoHandler
|
||||||
|
@ -72,19 +73,16 @@ public class GuiPowerBar extends GuiElement
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderBackground(int xAxis, int yAxis, int guiLeft, int guiTop)
|
public void renderBackground(int xAxis, int yAxis, int guiWidth, int guiHeight)
|
||||||
{
|
{
|
||||||
mc.renderEngine.bindTexture(RESOURCE);
|
mc.renderEngine.bindTexture(RESOURCE);
|
||||||
|
|
||||||
guiObj.drawTexturedRect(guiLeft + lmntLeft, guiTop + lmntTop, 0, 0, lmntWidth, lmntHeight);
|
guiObj.drawTexturedRect(guiWidth + xLocation, guiHeight + yLocation, 0, 0, width, height);
|
||||||
|
|
||||||
if(handler.getLevel() > 0)
|
if(handler.getLevel() > 0)
|
||||||
{
|
{
|
||||||
int barX = lmntLeft + 1;
|
int displayInt = (int)(handler.getLevel()*52) + innerOffsetY;
|
||||||
int barH = (int)(handler.getLevel()*52);
|
guiObj.drawTexturedRect(guiWidth + xLocation, guiHeight + yLocation + height - displayInt, 6, height - displayInt, width, displayInt);
|
||||||
int barY = lmntTop + 1 + 52 - barH;
|
|
||||||
int barV = (int)((1.0 - handler.getLevel())*104);
|
|
||||||
guiObj.drawTexturedRect(guiLeft + barX, guiTop + barY, 6, barV, 4, barH);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mc.renderEngine.bindTexture(defaultLocation);
|
mc.renderEngine.bindTexture(defaultLocation);
|
||||||
|
@ -95,7 +93,7 @@ public class GuiPowerBar extends GuiElement
|
||||||
{
|
{
|
||||||
mc.renderEngine.bindTexture(RESOURCE);
|
mc.renderEngine.bindTexture(RESOURCE);
|
||||||
|
|
||||||
if(handler.getTooltip() != null && xAxis >= lmntLeft && xAxis <= lmntLeft + lmntWidth && yAxis >= lmntTop && yAxis <= lmntTop + lmntHeight)
|
if(handler.getTooltip() != null && xAxis >= xLocation && xAxis <= xLocation + width && yAxis >= yLocation && yAxis <= yLocation + height)
|
||||||
{
|
{
|
||||||
displayTooltip(handler.getTooltip(), xAxis, yAxis);
|
displayTooltip(handler.getTooltip(), xAxis, yAxis);
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,26 +71,20 @@ public class GuiProgress extends GuiElement
|
||||||
|
|
||||||
public enum ProgressBar
|
public enum ProgressBar
|
||||||
{
|
{
|
||||||
BLUE(54, 18, 0, 0),
|
BLUE(28, 11, 0, 0),
|
||||||
YELLOW(54, 18, 0, 18),
|
YELLOW(28, 11, 0, 11),
|
||||||
RED(54, 18, 0, 36),
|
RED(28, 11, 0, 22),
|
||||||
GREEN(54, 18, 0, 54),
|
GREEN(28, 11, 0, 33),
|
||||||
PURPLE(54, 18, 0, 72),
|
PURPLE(28, 11, 0, 44),
|
||||||
STONE(54, 18, 0, 90),
|
STONE(28, 11, 0, 55),
|
||||||
CRUSH(54, 18, 0, 108),
|
CRUSH(28, 11, 0, 66),
|
||||||
|
|
||||||
LARGE_RIGHT(52, 10, 128, 0),
|
LARGE_RIGHT(52, 10, 128, 0),
|
||||||
LARGE_LEFT(52, 10, 128, 10),
|
LARGE_LEFT(52, 10, 128, 10),
|
||||||
MEDIUM(36, 10, 128, 20),
|
MEDIUM(36, 10, 128, 20),
|
||||||
SMALL_RIGHT(32, 10, 128, 30),
|
SMALL_RIGHT(32, 10, 128, 30),
|
||||||
SMALL_LEFT(32, 10, 128, 40),
|
SMALL_LEFT(32, 10, 128, 40),
|
||||||
BI(20, 8, 128, 50),
|
BI(20, 8, 128, 50);
|
||||||
|
|
||||||
SAW(54, 18, 0, 126),
|
|
||||||
ENRICH(54, 18, 0, 144),
|
|
||||||
COMPRESS(54, 18, 0, 162),
|
|
||||||
COMBINE(54, 18, 0, 180),
|
|
||||||
CRUSH2(54, 18, 0, 198);
|
|
||||||
|
|
||||||
public int width;
|
public int width;
|
||||||
public int height;
|
public int height;
|
||||||
|
|
|
@ -11,6 +11,7 @@ import mekanism.common.util.MekanismUtils;
|
||||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import codechicken.lib.vec.Rectangle4i;
|
||||||
|
|
||||||
public class GuiRedstoneControl extends GuiElement
|
public class GuiRedstoneControl extends GuiElement
|
||||||
{
|
{
|
||||||
|
@ -20,34 +21,32 @@ public class GuiRedstoneControl extends GuiElement
|
||||||
{
|
{
|
||||||
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiRedstoneControl.png"), gui, def);
|
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiRedstoneControl.png"), gui, def);
|
||||||
|
|
||||||
lmntLeft = 176;
|
|
||||||
lmntTop = 138;
|
|
||||||
|
|
||||||
tileEntity = tile;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GuiRedstoneControl( IGuiWrapper gui, TileEntity tile, ResourceLocation def, int guiLeft, int guiTop )
|
|
||||||
{
|
|
||||||
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiRedstoneControl.png"), gui, def );
|
|
||||||
|
|
||||||
lmntLeft = guiLeft;
|
|
||||||
lmntTop = guiTop;
|
|
||||||
|
|
||||||
tileEntity = tile;
|
tileEntity = tile;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderBackground(int xAxis, int yAxis, int guiLeft, int guiTop)
|
public Rectangle4i getBounds(int guiWidth, int guiHeight)
|
||||||
|
{
|
||||||
|
return new Rectangle4i(guiWidth + 176, guiHeight + 138, 26, 26);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderBackground(int xAxis, int yAxis, int guiWidth, int guiHeight)
|
||||||
{
|
{
|
||||||
mc.renderEngine.bindTexture(RESOURCE);
|
mc.renderEngine.bindTexture(RESOURCE);
|
||||||
|
|
||||||
guiObj.drawTexturedRect(guiLeft + lmntLeft, guiTop + lmntTop, 0, 0, lmntWidth, lmntHeight);
|
guiObj.drawTexturedRect(guiWidth + 176, guiHeight + 138, 0, 0, 26, 26);
|
||||||
|
|
||||||
IRedstoneControl control = (IRedstoneControl)tileEntity;
|
IRedstoneControl control = (IRedstoneControl)tileEntity;
|
||||||
int renderX = 26 + (18*control.getControlType().ordinal());
|
int renderX = 26 + (18*control.getControlType().ordinal());
|
||||||
boolean mouseOver = xAxis >= lmntLeft + 3 && xAxis <= lmntLeft + 21 && yAxis >= lmntTop + 4 && yAxis <= lmntTop + 22;
|
|
||||||
|
|
||||||
guiObj.drawTexturedRect(guiLeft + lmntLeft + 3, guiTop + lmntTop + 4, renderX, mouseOver? 0: 18, 18, 18);
|
if(xAxis >= 179 && xAxis <= 197 && yAxis >= 142 && yAxis <= 160)
|
||||||
|
{
|
||||||
|
guiObj.drawTexturedRect(guiWidth + 179, guiHeight + 142, renderX, 0, 18, 18);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
guiObj.drawTexturedRect(guiWidth + 179, guiHeight + 142, renderX, 18, 18, 18);
|
||||||
|
}
|
||||||
|
|
||||||
mc.renderEngine.bindTexture(defaultLocation);
|
mc.renderEngine.bindTexture(defaultLocation);
|
||||||
}
|
}
|
||||||
|
@ -59,7 +58,7 @@ public class GuiRedstoneControl extends GuiElement
|
||||||
|
|
||||||
IRedstoneControl control = (IRedstoneControl)tileEntity;
|
IRedstoneControl control = (IRedstoneControl)tileEntity;
|
||||||
|
|
||||||
if(xAxis >= lmntLeft + 3 && xAxis <= lmntLeft + 21 && yAxis >= lmntTop + 4 && yAxis <= lmntTop + 22)
|
if(xAxis >= 179 && xAxis <= 197 && yAxis >= 142 && yAxis <= 160)
|
||||||
{
|
{
|
||||||
displayTooltip(control.getControlType().getDisplay(), xAxis, yAxis);
|
displayTooltip(control.getControlType().getDisplay(), xAxis, yAxis);
|
||||||
}
|
}
|
||||||
|
@ -77,7 +76,7 @@ public class GuiRedstoneControl extends GuiElement
|
||||||
|
|
||||||
if(button == 0)
|
if(button == 0)
|
||||||
{
|
{
|
||||||
if(xAxis >= lmntLeft + 3 && xAxis <= lmntLeft + 21 && yAxis >= lmntTop + 4 && yAxis <= lmntTop + 22)
|
if(xAxis >= 179 && xAxis <= 197 && yAxis >= 142 && yAxis <= 160)
|
||||||
{
|
{
|
||||||
RedstoneControl current = control.getControlType();
|
RedstoneControl current = control.getControlType();
|
||||||
int ordinalToSet = current.ordinal() < (RedstoneControl.values().length-1) ? current.ordinal()+1 : 0;
|
int ordinalToSet = current.ordinal() < (RedstoneControl.values().length-1) ? current.ordinal()+1 : 0;
|
||||||
|
|
|
@ -11,6 +11,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import codechicken.lib.vec.Rectangle4i;
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public class GuiSideConfigurationTab extends GuiElement
|
public class GuiSideConfigurationTab extends GuiElement
|
||||||
|
@ -21,31 +22,29 @@ public class GuiSideConfigurationTab extends GuiElement
|
||||||
{
|
{
|
||||||
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiConfigurationTab.png"), gui, def);
|
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiConfigurationTab.png"), gui, def);
|
||||||
|
|
||||||
lmntLeft = -26;
|
|
||||||
lmntTop = 6;
|
|
||||||
|
|
||||||
tileEntity = tile;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GuiSideConfigurationTab(IGuiWrapper gui, TileEntity tile, ResourceLocation def, int guiLeft, int guiTop)
|
|
||||||
{
|
|
||||||
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiConfigurationTab.png"), gui, def);
|
|
||||||
|
|
||||||
lmntLeft = guiLeft;
|
|
||||||
lmntTop = guiTop;
|
|
||||||
|
|
||||||
tileEntity = tile;
|
tileEntity = tile;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderBackground(int xAxis, int yAxis, int guiLeft, int guiTop)
|
public Rectangle4i getBounds(int guiWidth, int guiHeight)
|
||||||
|
{
|
||||||
|
return new Rectangle4i(guiWidth - 26, guiHeight + 6, 26, 26);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderBackground(int xAxis, int yAxis, int guiWidth, int guiHeight)
|
||||||
{
|
{
|
||||||
mc.renderEngine.bindTexture(RESOURCE);
|
mc.renderEngine.bindTexture(RESOURCE);
|
||||||
|
|
||||||
guiObj.drawTexturedRect(guiLeft + lmntLeft, guiTop + lmntTop, 0, 0, lmntWidth, lmntHeight);
|
guiObj.drawTexturedRect(guiWidth - 26, guiHeight + 6, 0, 0, 26, 26);
|
||||||
boolean mouseOver = xAxis >= lmntLeft + 5 && xAxis <= lmntLeft + 23 && yAxis >= lmntTop + 4 && yAxis <= lmntTop + 22;
|
|
||||||
|
|
||||||
guiObj.drawTexturedRect(guiLeft + lmntLeft + 5, guiTop + lmntTop + 4, 26, mouseOver? 0: 18, 18, 18);
|
if(xAxis >= -21 && xAxis <= -3 && yAxis >= 10 && yAxis <= 28)
|
||||||
|
{
|
||||||
|
guiObj.drawTexturedRect(guiWidth - 21, guiHeight + 10, 26, 0, 18, 18);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
guiObj.drawTexturedRect(guiWidth - 21, guiHeight + 10, 26, 18, 18, 18);
|
||||||
|
}
|
||||||
|
|
||||||
mc.renderEngine.bindTexture(defaultLocation);
|
mc.renderEngine.bindTexture(defaultLocation);
|
||||||
}
|
}
|
||||||
|
@ -55,7 +54,7 @@ public class GuiSideConfigurationTab extends GuiElement
|
||||||
{
|
{
|
||||||
mc.renderEngine.bindTexture(RESOURCE);
|
mc.renderEngine.bindTexture(RESOURCE);
|
||||||
|
|
||||||
if(xAxis >= lmntLeft + 5 && xAxis <= lmntLeft + 23 && yAxis >= lmntTop + 4 && yAxis <= lmntTop + 22)
|
if(xAxis >= -21 && xAxis <= -3 && yAxis >= 10 && yAxis <= 28)
|
||||||
{
|
{
|
||||||
displayTooltip(MekanismUtils.localize("gui.configuration.side"), xAxis, yAxis);
|
displayTooltip(MekanismUtils.localize("gui.configuration.side"), xAxis, yAxis);
|
||||||
}
|
}
|
||||||
|
@ -71,7 +70,7 @@ public class GuiSideConfigurationTab extends GuiElement
|
||||||
{
|
{
|
||||||
if(button == 0)
|
if(button == 0)
|
||||||
{
|
{
|
||||||
if(xAxis >= lmntLeft + 5 && xAxis <= lmntLeft + 23 && yAxis >= lmntTop + 4 && yAxis <= lmntTop + 22)
|
if(xAxis >= -21 && xAxis <= -3 && yAxis >= 10 && yAxis <= 28)
|
||||||
{
|
{
|
||||||
Mekanism.packetHandler.sendToServer(new SimpleGuiMessage(Coord4D.get(tileEntity), 9));
|
Mekanism.packetHandler.sendToServer(new SimpleGuiMessage(Coord4D.get(tileEntity), 9));
|
||||||
SoundHandler.playSound("gui.button.press");
|
SoundHandler.playSound("gui.button.press");
|
||||||
|
|
|
@ -4,23 +4,30 @@ import mekanism.client.gui.IGuiWrapper;
|
||||||
import mekanism.common.util.MekanismUtils;
|
import mekanism.common.util.MekanismUtils;
|
||||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import codechicken.lib.vec.Rectangle4i;
|
||||||
|
|
||||||
public class GuiSlot extends GuiElement
|
public class GuiSlot extends GuiElement
|
||||||
{
|
{
|
||||||
|
protected int xLocation;
|
||||||
|
protected int yLocation;
|
||||||
|
|
||||||
protected int textureX;
|
protected int textureX;
|
||||||
protected int textureY;
|
protected int textureY;
|
||||||
|
|
||||||
|
protected int width;
|
||||||
|
protected int height;
|
||||||
|
|
||||||
protected SlotOverlay overlay = null;
|
protected SlotOverlay overlay = null;
|
||||||
|
|
||||||
public GuiSlot(SlotType type, IGuiWrapper gui, ResourceLocation def, int guiLeft, int guiTop)
|
public GuiSlot(SlotType type, IGuiWrapper gui, ResourceLocation def, int x, int y)
|
||||||
{
|
{
|
||||||
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiSlot.png"), gui, def);
|
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiSlot.png"), gui, def);
|
||||||
|
|
||||||
lmntLeft = guiLeft;
|
xLocation = x;
|
||||||
lmntTop = guiTop;
|
yLocation = y;
|
||||||
|
|
||||||
lmntWidth = type.width;
|
width = type.width;
|
||||||
lmntHeight = type.height;
|
height = type.height;
|
||||||
|
|
||||||
textureX = type.textureX;
|
textureX = type.textureX;
|
||||||
textureY = type.textureY;
|
textureY = type.textureY;
|
||||||
|
@ -32,19 +39,25 @@ public class GuiSlot extends GuiElement
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Rectangle4i getBounds(int guiWidth, int guiHeight)
|
||||||
|
{
|
||||||
|
return new Rectangle4i(guiWidth + xLocation, guiHeight + yLocation, width, height);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderBackground(int xAxis, int yAxis, int guiWidth, int guiHeight)
|
public void renderBackground(int xAxis, int yAxis, int guiWidth, int guiHeight)
|
||||||
{
|
{
|
||||||
mc.renderEngine.bindTexture(RESOURCE);
|
mc.renderEngine.bindTexture(RESOURCE);
|
||||||
|
|
||||||
guiObj.drawTexturedRect(guiWidth + lmntLeft, guiHeight + lmntTop, textureX, textureY, lmntWidth, lmntHeight);
|
guiObj.drawTexturedRect(guiWidth + xLocation, guiHeight + yLocation, textureX, textureY, width, height);
|
||||||
|
|
||||||
if(overlay != null)
|
if(overlay != null)
|
||||||
{
|
{
|
||||||
int w = overlay.width;
|
int w = overlay.width;
|
||||||
int h = overlay.height;
|
int h = overlay.height;
|
||||||
int xLocationOverlay = lmntLeft + (lmntWidth-w)/2;
|
int xLocationOverlay = xLocation + (width-w)/2;
|
||||||
int yLocationOverlay = lmntTop + (lmntHeight-h)/2;
|
int yLocationOverlay = yLocation + (height-h)/2;
|
||||||
|
|
||||||
guiObj.drawTexturedRect(guiWidth + xLocationOverlay, guiHeight + yLocationOverlay, overlay.textureX, overlay.textureY, w, h);
|
guiObj.drawTexturedRect(guiWidth + xLocationOverlay, guiHeight + yLocationOverlay, overlay.textureX, overlay.textureY, w, h);
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@ import mekanism.common.util.MekanismUtils;
|
||||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import codechicken.lib.vec.Rectangle4i;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
@ -16,36 +17,36 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||||
public class GuiTransporterConfigTab extends GuiElement
|
public class GuiTransporterConfigTab extends GuiElement
|
||||||
{
|
{
|
||||||
public TileEntity tileEntity;
|
public TileEntity tileEntity;
|
||||||
|
public int yPos;
|
||||||
|
|
||||||
public GuiTransporterConfigTab(IGuiWrapper gui, int y, TileEntity tile, ResourceLocation def)
|
public GuiTransporterConfigTab(IGuiWrapper gui, int y, TileEntity tile, ResourceLocation def)
|
||||||
{
|
{
|
||||||
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiTransporterConfigTab.png"), gui, def);
|
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiTransporterConfigTab.png"), gui, def);
|
||||||
|
|
||||||
lmntLeft = -26;
|
yPos = y;
|
||||||
lmntTop = y;
|
|
||||||
|
|
||||||
tileEntity = tile;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GuiTransporterConfigTab(IGuiWrapper gui, TileEntity tile, ResourceLocation def, int guiLeft, int guiTop)
|
|
||||||
{
|
|
||||||
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiTransporterConfigTab.png"), gui, def);
|
|
||||||
|
|
||||||
lmntLeft = guiLeft;
|
|
||||||
lmntTop = guiTop;
|
|
||||||
|
|
||||||
tileEntity = tile;
|
tileEntity = tile;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderBackground(int xAxis, int yAxis, int guiLeft, int guiTop)
|
public Rectangle4i getBounds(int guiWidth, int guiHeight)
|
||||||
|
{
|
||||||
|
return new Rectangle4i(guiWidth - 26, guiHeight + yPos, 26, 26);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderBackground(int xAxis, int yAxis, int guiWidth, int guiHeight)
|
||||||
{
|
{
|
||||||
mc.renderEngine.bindTexture(RESOURCE);
|
mc.renderEngine.bindTexture(RESOURCE);
|
||||||
|
|
||||||
guiObj.drawTexturedRect(guiLeft + lmntLeft, guiTop + lmntTop, 0, 0, lmntWidth, lmntHeight);
|
guiObj.drawTexturedRect(guiWidth - 26, guiHeight + yPos, 0, 0, 26, 26);
|
||||||
boolean mouseOver = xAxis >= lmntLeft + 5 && xAxis <= lmntLeft + 23 && yAxis >= lmntTop + 4 && yAxis <= lmntTop + 22;
|
|
||||||
|
|
||||||
guiObj.drawTexturedRect(guiLeft + lmntLeft + 5, guiTop + lmntTop + 4, 26, mouseOver? 0: 18, 18, 18);
|
if(xAxis >= -21 && xAxis <= -3 && yAxis >= yPos+4 && yAxis <= yPos+22)
|
||||||
|
{
|
||||||
|
guiObj.drawTexturedRect(guiWidth - 21, guiHeight + yPos+4, 26, 0, 18, 18);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
guiObj.drawTexturedRect(guiWidth - 21, guiHeight + yPos+4, 26, 18, 18, 18);
|
||||||
|
}
|
||||||
|
|
||||||
mc.renderEngine.bindTexture(defaultLocation);
|
mc.renderEngine.bindTexture(defaultLocation);
|
||||||
}
|
}
|
||||||
|
@ -55,7 +56,7 @@ public class GuiTransporterConfigTab extends GuiElement
|
||||||
{
|
{
|
||||||
mc.renderEngine.bindTexture(RESOURCE);
|
mc.renderEngine.bindTexture(RESOURCE);
|
||||||
|
|
||||||
if(xAxis >= lmntLeft + 5 && xAxis <= lmntLeft + 23 && yAxis >= lmntTop + 4 && yAxis <= lmntTop + 22)
|
if(xAxis >= -21 && xAxis <= -3 && yAxis >= yPos+4 && yAxis <= yPos+22)
|
||||||
{
|
{
|
||||||
displayTooltip(MekanismUtils.localize("gui.configuration.transporter"), xAxis, yAxis);
|
displayTooltip(MekanismUtils.localize("gui.configuration.transporter"), xAxis, yAxis);
|
||||||
}
|
}
|
||||||
|
@ -71,7 +72,7 @@ public class GuiTransporterConfigTab extends GuiElement
|
||||||
{
|
{
|
||||||
if(button == 0)
|
if(button == 0)
|
||||||
{
|
{
|
||||||
if(xAxis >= lmntLeft + 5 && xAxis <= lmntLeft + 23 && yAxis >= lmntTop + 4 && yAxis <= lmntTop + 22)
|
if(xAxis >= -21 && xAxis <= -3 && yAxis >= yPos+4 && yAxis <= yPos+22)
|
||||||
{
|
{
|
||||||
Mekanism.packetHandler.sendToServer(new SimpleGuiMessage(Coord4D.get(tileEntity), 51));
|
Mekanism.packetHandler.sendToServer(new SimpleGuiMessage(Coord4D.get(tileEntity), 51));
|
||||||
SoundHandler.playSound("gui.button.press");
|
SoundHandler.playSound("gui.button.press");
|
||||||
|
|
|
@ -9,6 +9,7 @@ import mekanism.common.util.MekanismUtils;
|
||||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import codechicken.lib.vec.Rectangle4i;
|
||||||
|
|
||||||
public class GuiUpgradeTab extends GuiElement
|
public class GuiUpgradeTab extends GuiElement
|
||||||
{
|
{
|
||||||
|
@ -18,32 +19,29 @@ public class GuiUpgradeTab extends GuiElement
|
||||||
{
|
{
|
||||||
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiUpgradeTab.png"), gui, def);
|
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiUpgradeTab.png"), gui, def);
|
||||||
|
|
||||||
lmntLeft = 176;
|
|
||||||
lmntTop = 6;
|
|
||||||
|
|
||||||
tileEntity = tile;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GuiUpgradeTab(IGuiWrapper gui, TileEntity tile, ResourceLocation def, int guiLeft, int guiTop)
|
|
||||||
{
|
|
||||||
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiUpgradeTab.png"), gui, def);
|
|
||||||
|
|
||||||
lmntLeft = guiLeft;
|
|
||||||
lmntTop = guiTop;
|
|
||||||
|
|
||||||
tileEntity = tile;
|
tileEntity = tile;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderBackground(int xAxis, int yAxis, int guiLeft, int guiTop)
|
public Rectangle4i getBounds(int guiWidth, int guiHeight)
|
||||||
|
{
|
||||||
|
return new Rectangle4i(guiWidth + 176, guiHeight + 6, 26, 26);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderBackground(int xAxis, int yAxis, int guiWidth, int guiHeight)
|
||||||
{
|
{
|
||||||
mc.renderEngine.bindTexture(RESOURCE);
|
mc.renderEngine.bindTexture(RESOURCE);
|
||||||
|
|
||||||
guiObj.drawTexturedRect(guiLeft + lmntLeft, guiTop + lmntTop, 0, 0, lmntWidth, lmntHeight);
|
guiObj.drawTexturedRect(guiWidth + 176, guiHeight + 6, 0, 0, 26, 26);
|
||||||
|
|
||||||
boolean mouseOver = xAxis >= lmntLeft + 3 && xAxis <= lmntLeft + 21 && yAxis >= lmntTop + 4 && yAxis <= lmntTop + 22;
|
if(xAxis >= 179 && xAxis <= 197 && yAxis >= 10 && yAxis <= 28)
|
||||||
|
{
|
||||||
guiObj.drawTexturedRect(guiLeft + lmntLeft + 3, guiTop + lmntTop + 4, 26, mouseOver? 0: 18, 18, 18);
|
guiObj.drawTexturedRect(guiWidth + 179, guiHeight + 10, 26, 0, 18, 18);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
guiObj.drawTexturedRect(guiWidth + 179, guiHeight + 10, 26, 18, 18, 18);
|
||||||
|
}
|
||||||
|
|
||||||
mc.renderEngine.bindTexture(defaultLocation);
|
mc.renderEngine.bindTexture(defaultLocation);
|
||||||
}
|
}
|
||||||
|
@ -53,7 +51,7 @@ public class GuiUpgradeTab extends GuiElement
|
||||||
{
|
{
|
||||||
mc.renderEngine.bindTexture(RESOURCE);
|
mc.renderEngine.bindTexture(RESOURCE);
|
||||||
|
|
||||||
if(xAxis >= lmntLeft + 3 && xAxis <= lmntLeft + 21 && yAxis >= lmntTop + 4 && yAxis <= lmntTop + 22)
|
if(xAxis >= 179 && xAxis <= 197 && yAxis >= 10 && yAxis <= 28)
|
||||||
{
|
{
|
||||||
displayTooltip(MekanismUtils.localize("gui.upgrades"), xAxis, yAxis);
|
displayTooltip(MekanismUtils.localize("gui.upgrades"), xAxis, yAxis);
|
||||||
}
|
}
|
||||||
|
@ -69,7 +67,7 @@ public class GuiUpgradeTab extends GuiElement
|
||||||
{
|
{
|
||||||
if(button == 0)
|
if(button == 0)
|
||||||
{
|
{
|
||||||
if(xAxis >= lmntLeft + 3 && xAxis <= lmntLeft + 21 && yAxis >= lmntTop + 4 && yAxis <= lmntTop + 22)
|
if(xAxis >= 179 && xAxis <= 197 && yAxis >= 10 && yAxis <= 28)
|
||||||
{
|
{
|
||||||
Mekanism.packetHandler.sendToServer(new SimpleGuiMessage(Coord4D.get(tileEntity), 43));
|
Mekanism.packetHandler.sendToServer(new SimpleGuiMessage(Coord4D.get(tileEntity), 43));
|
||||||
SoundHandler.playSound("gui.button.press");
|
SoundHandler.playSound("gui.button.press");
|
||||||
|
|
|
@ -17,31 +17,29 @@ public class GuiVisualsTab extends GuiElement
|
||||||
{
|
{
|
||||||
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiVisualsTab.png"), gui, def);
|
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiVisualsTab.png"), gui, def);
|
||||||
|
|
||||||
lmntLeft = -26;
|
|
||||||
lmntTop = 5;
|
|
||||||
|
|
||||||
tileEntity = tile;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GuiVisualsTab(IGuiWrapper gui, TileEntityDigitalMiner tile, ResourceLocation def, int guiLeft, int guiTop)
|
|
||||||
{
|
|
||||||
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiVisualsTab.png"), gui, def);
|
|
||||||
|
|
||||||
lmntLeft = guiLeft;
|
|
||||||
lmntTop = guiTop;
|
|
||||||
|
|
||||||
tileEntity = tile;
|
tileEntity = tile;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderBackground(int xAxis, int yAxis, int guiLeft, int guiTop)
|
public Rectangle4i getBounds(int guiWidth, int guiHeight)
|
||||||
|
{
|
||||||
|
return new Rectangle4i(guiWidth - 26, guiHeight + 6, 26, 26);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderBackground(int xAxis, int yAxis, int guiWidth, int guiHeight)
|
||||||
{
|
{
|
||||||
mc.renderEngine.bindTexture(RESOURCE);
|
mc.renderEngine.bindTexture(RESOURCE);
|
||||||
|
|
||||||
guiObj.drawTexturedRect(guiLeft + lmntLeft, guiTop + lmntTop, 0, 0, lmntWidth, lmntHeight);
|
guiObj.drawTexturedRect(guiWidth - 26, guiHeight + 6, 0, 0, 26, 26);
|
||||||
|
|
||||||
boolean mouseOver = xAxis >= lmntLeft + 5 && xAxis <= lmntLeft + 23 && yAxis >= lmntTop + 4 && yAxis <= lmntTop + 22;
|
if(xAxis >= -21 && xAxis <= -3 && yAxis >= 10 && yAxis <= 28)
|
||||||
guiObj.drawTexturedRect(guiLeft + lmntLeft + 5, guiTop + lmntTop + 4, 26, mouseOver? 0: 18, 18, 18);
|
{
|
||||||
|
guiObj.drawTexturedRect(guiWidth - 21, guiHeight + 10, 26, 0, 18, 18);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
guiObj.drawTexturedRect(guiWidth - 21, guiHeight + 10, 26, 18, 18, 18);
|
||||||
|
}
|
||||||
|
|
||||||
mc.renderEngine.bindTexture(defaultLocation);
|
mc.renderEngine.bindTexture(defaultLocation);
|
||||||
}
|
}
|
||||||
|
@ -51,7 +49,7 @@ public class GuiVisualsTab extends GuiElement
|
||||||
{
|
{
|
||||||
mc.renderEngine.bindTexture(RESOURCE);
|
mc.renderEngine.bindTexture(RESOURCE);
|
||||||
|
|
||||||
if(xAxis >= lmntLeft + 5 && xAxis <= lmntLeft + 23 && yAxis >= lmntTop + 4 && yAxis <= lmntTop + 22)
|
if(xAxis >= -21 && xAxis <= -3 && yAxis >= 10 && yAxis <= 28)
|
||||||
{
|
{
|
||||||
displayTooltip(MekanismUtils.localize("gui.visuals") + ": " + LangUtils.transOnOff(tileEntity.clientRendering), xAxis, yAxis);
|
displayTooltip(MekanismUtils.localize("gui.visuals") + ": " + LangUtils.transOnOff(tileEntity.clientRendering), xAxis, yAxis);
|
||||||
}
|
}
|
||||||
|
@ -67,7 +65,7 @@ public class GuiVisualsTab extends GuiElement
|
||||||
{
|
{
|
||||||
if(button == 0)
|
if(button == 0)
|
||||||
{
|
{
|
||||||
if(xAxis >= lmntLeft + 5 && xAxis <= lmntLeft + 23 && yAxis >= lmntTop + 4 && yAxis <= lmntTop + 22)
|
if(xAxis >= -21 && xAxis <= -3 && yAxis >= 10 && yAxis <= 28)
|
||||||
{
|
{
|
||||||
tileEntity.clientRendering = !tileEntity.clientRendering;
|
tileEntity.clientRendering = !tileEntity.clientRendering;
|
||||||
SoundHandler.playSound("gui.button.press");
|
SoundHandler.playSound("gui.button.press");
|
||||||
|
|
|
@ -21,10 +21,10 @@ public class ContainerAdvancedElectricMachine extends Container
|
||||||
public ContainerAdvancedElectricMachine(InventoryPlayer inventory, TileEntityAdvancedElectricMachine tentity)
|
public ContainerAdvancedElectricMachine(InventoryPlayer inventory, TileEntityAdvancedElectricMachine tentity)
|
||||||
{
|
{
|
||||||
tileEntity = tentity;
|
tileEntity = tentity;
|
||||||
addSlotToContainer(new Slot(tentity, 0, 40, 21));
|
addSlotToContainer(new Slot(tentity, 0, 56, 17));
|
||||||
addSlotToContainer(new Slot(tentity, 1, 40, 57));
|
addSlotToContainer(new Slot(tentity, 1, 56, 53));
|
||||||
addSlotToContainer(new SlotOutput(tentity, 2, 116, 39));
|
addSlotToContainer(new SlotOutput(tentity, 2, 116, 35));
|
||||||
addSlotToContainer(new SlotDischarge(tentity, 3, 14, 72));
|
addSlotToContainer(new SlotDischarge(tentity, 3, 31, 35));
|
||||||
|
|
||||||
int slotY;
|
int slotY;
|
||||||
|
|
||||||
|
@ -32,13 +32,13 @@ public class ContainerAdvancedElectricMachine extends Container
|
||||||
{
|
{
|
||||||
for(int slotX = 0; slotX < 9; slotX++)
|
for(int slotX = 0; slotX < 9; slotX++)
|
||||||
{
|
{
|
||||||
addSlotToContainer(new Slot(inventory, slotX + slotY * 9 + 9, 8 + slotX * 18, 104 + slotY * 18));
|
addSlotToContainer(new Slot(inventory, slotX + slotY * 9 + 9, 8 + slotX * 18, 84 + slotY * 18));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(slotY = 0; slotY < 9; slotY++)
|
for(slotY = 0; slotY < 9; slotY++)
|
||||||
{
|
{
|
||||||
addSlotToContainer(new Slot(inventory, slotY, 8 + slotY * 18, 162));
|
addSlotToContainer(new Slot(inventory, slotY, 8 + slotY * 18, 142));
|
||||||
}
|
}
|
||||||
|
|
||||||
tileEntity.open(inventory.player);
|
tileEntity.open(inventory.player);
|
||||||
|
|
|
@ -20,10 +20,10 @@ public class ContainerChanceMachine extends Container
|
||||||
public ContainerChanceMachine(InventoryPlayer inventory, TileEntityChanceMachine tentity)
|
public ContainerChanceMachine(InventoryPlayer inventory, TileEntityChanceMachine tentity)
|
||||||
{
|
{
|
||||||
tileEntity = tentity;
|
tileEntity = tentity;
|
||||||
addSlotToContainer(new Slot(tentity, 0, 32, 39));
|
addSlotToContainer(new Slot(tentity, 0, 56, 17));
|
||||||
addSlotToContainer(new SlotDischarge(tentity, 1, 14, 72));
|
addSlotToContainer(new SlotDischarge(tentity, 1, 56, 53));
|
||||||
addSlotToContainer(new SlotOutput(tentity, 2, 107, 39));
|
addSlotToContainer(new SlotOutput(tentity, 2, 116, 35));
|
||||||
addSlotToContainer(new SlotOutput(tentity, 4, 125, 39));
|
addSlotToContainer(new SlotOutput(tentity, 4, 132, 35));
|
||||||
|
|
||||||
int slotY;
|
int slotY;
|
||||||
|
|
||||||
|
@ -31,13 +31,13 @@ public class ContainerChanceMachine extends Container
|
||||||
{
|
{
|
||||||
for(int slotX = 0; slotX < 9; slotX++)
|
for(int slotX = 0; slotX < 9; slotX++)
|
||||||
{
|
{
|
||||||
addSlotToContainer(new Slot(inventory, slotX + slotY * 9 + 9, 8 + slotX * 18, 104 + slotY * 18));
|
addSlotToContainer(new Slot(inventory, slotX + slotY * 9 + 9, 8 + slotX * 18, 84 + slotY * 18));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(slotY = 0; slotY < 9; slotY++)
|
for(slotY = 0; slotY < 9; slotY++)
|
||||||
{
|
{
|
||||||
addSlotToContainer(new Slot(inventory, slotY, 8 + slotY * 18, 162));
|
addSlotToContainer(new Slot(inventory, slotY, 8 + slotY * 18, 142));
|
||||||
}
|
}
|
||||||
|
|
||||||
tileEntity.open(inventory.player);
|
tileEntity.open(inventory.player);
|
||||||
|
|
|
@ -20,9 +20,9 @@ public class ContainerElectricMachine extends Container
|
||||||
public ContainerElectricMachine(InventoryPlayer inventory, TileEntityElectricMachine tentity)
|
public ContainerElectricMachine(InventoryPlayer inventory, TileEntityElectricMachine tentity)
|
||||||
{
|
{
|
||||||
tileEntity = tentity;
|
tileEntity = tentity;
|
||||||
addSlotToContainer(new Slot(tentity, 0, 40, 39));
|
addSlotToContainer(new Slot(tentity, 0, 56, 17));
|
||||||
addSlotToContainer(new SlotDischarge(tentity, 1, 14, 72));
|
addSlotToContainer(new SlotDischarge(tentity, 1, 56, 53));
|
||||||
addSlotToContainer(new SlotOutput(tentity, 2, 116, 39));
|
addSlotToContainer(new SlotOutput(tentity, 2, 116, 35));
|
||||||
|
|
||||||
int slotY;
|
int slotY;
|
||||||
|
|
||||||
|
@ -30,13 +30,13 @@ public class ContainerElectricMachine extends Container
|
||||||
{
|
{
|
||||||
for(int slotX = 0; slotX < 9; slotX++)
|
for(int slotX = 0; slotX < 9; slotX++)
|
||||||
{
|
{
|
||||||
addSlotToContainer(new Slot(inventory, slotX + slotY * 9 + 9, 8 + slotX * 18, 104 + slotY * 18));
|
addSlotToContainer(new Slot(inventory, slotX + slotY * 9 + 9, 8 + slotX * 18, 84 + slotY * 18));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(slotY = 0; slotY < 9; slotY++)
|
for(slotY = 0; slotY < 9; slotY++)
|
||||||
{
|
{
|
||||||
addSlotToContainer(new Slot(inventory, slotY, 8 + slotY * 18, 162));
|
addSlotToContainer(new Slot(inventory, slotY, 8 + slotY * 18, 142));
|
||||||
}
|
}
|
||||||
|
|
||||||
tileEntity.open(inventory.player);
|
tileEntity.open(inventory.player);
|
||||||
|
|
Before Width: | Height: | Size: 988 B After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 898 B After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 553 B |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 4.9 KiB |