2013-08-26 18:49:32 -04:00
|
|
|
package mekanism.client.gui;
|
2012-08-15 16:41:41 -04:00
|
|
|
|
2013-08-26 18:49:32 -04:00
|
|
|
import mekanism.common.inventory.container.ContainerAdvancedElectricMachine;
|
|
|
|
import mekanism.common.tileentity.TileEntityAdvancedElectricMachine;
|
2013-11-22 20:58:49 -05:00
|
|
|
import mekanism.common.util.MekanismUtils;
|
2012-12-20 16:53:39 -05:00
|
|
|
import net.minecraft.entity.player.InventoryPlayer;
|
|
|
|
|
|
|
|
import org.lwjgl.opengl.GL11;
|
2012-08-15 16:41:41 -04:00
|
|
|
|
2013-04-13 10:33:37 -04:00
|
|
|
import cpw.mods.fml.relauncher.Side;
|
|
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
|
|
|
|
|
|
|
@SideOnly(Side.CLIENT)
|
2013-08-26 18:28:55 -04:00
|
|
|
public class GuiAdvancedElectricMachine extends GuiMekanism
|
2012-08-15 16:41:41 -04:00
|
|
|
{
|
2012-10-17 14:46:27 -04:00
|
|
|
public TileEntityAdvancedElectricMachine tileEntity;
|
2012-08-15 16:41:41 -04:00
|
|
|
|
2012-10-17 14:46:27 -04:00
|
|
|
public GuiAdvancedElectricMachine(InventoryPlayer inventory, TileEntityAdvancedElectricMachine tentity)
|
2012-08-15 16:41:41 -04:00
|
|
|
{
|
2013-11-29 19:11:07 -05:00
|
|
|
super(tentity, new ContainerAdvancedElectricMachine(inventory, tentity));
|
2012-10-03 15:12:17 -04:00
|
|
|
tileEntity = tentity;
|
2013-08-25 20:54:34 -04:00
|
|
|
|
2013-08-26 18:28:55 -04:00
|
|
|
guiElements.add(new GuiRedstoneControl(this, tileEntity, tileEntity.guiLocation));
|
|
|
|
guiElements.add(new GuiUpgradeManagement(this, tileEntity, tileEntity.guiLocation));
|
2013-10-30 15:22:43 -04:00
|
|
|
guiElements.add(new GuiConfigurationTab(this, tileEntity, tileEntity.guiLocation));
|
2012-08-15 16:41:41 -04:00
|
|
|
}
|
|
|
|
|
2012-11-06 10:44:14 -05:00
|
|
|
@Override
|
2013-05-19 18:43:01 -04:00
|
|
|
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
2013-11-26 20:11:26 -05:00
|
|
|
{
|
2013-05-19 18:43:01 -04:00
|
|
|
int xAxis = (mouseX - (width - xSize) / 2);
|
|
|
|
int yAxis = (mouseY - (height - ySize) / 2);
|
|
|
|
|
2013-11-30 00:28:02 -05:00
|
|
|
fontRenderer.drawString(tileEntity.getInvName(), 45, 6, 0x404040);
|
2012-08-15 16:41:41 -04:00
|
|
|
fontRenderer.drawString("Inventory", 8, (ySize - 96) + 2, 0x404040);
|
2013-05-19 18:43:01 -04:00
|
|
|
|
|
|
|
if(xAxis >= 165 && xAxis <= 169 && yAxis >= 17 && yAxis <= 69)
|
|
|
|
{
|
2013-11-22 20:58:49 -05:00
|
|
|
drawCreativeTabHoveringText(MekanismUtils.getEnergyDisplay(tileEntity.getEnergy()), xAxis, yAxis);
|
2013-05-19 18:43:01 -04:00
|
|
|
}
|
2013-11-26 20:11:26 -05:00
|
|
|
|
|
|
|
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
2012-08-15 16:41:41 -04:00
|
|
|
}
|
|
|
|
|
2012-11-06 10:44:14 -05:00
|
|
|
@Override
|
2013-08-26 18:28:55 -04:00
|
|
|
protected void drawGuiContainerBackgroundLayer(float partialTick, int mouseX, int mouseY)
|
2012-08-15 16:41:41 -04:00
|
|
|
{
|
2013-08-26 18:28:55 -04:00
|
|
|
super.drawGuiContainerBackgroundLayer(partialTick, mouseX, mouseY);
|
|
|
|
|
2013-09-28 02:59:47 +01:00
|
|
|
mc.renderEngine.bindTexture(tileEntity.guiLocation);
|
2012-08-15 16:41:41 -04:00
|
|
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
2012-10-03 15:12:17 -04:00
|
|
|
int guiWidth = (width - xSize) / 2;
|
|
|
|
int guiHeight = (height - ySize) / 2;
|
|
|
|
drawTexturedModalRect(guiWidth, guiHeight, 0, 0, xSize, ySize);
|
2013-08-02 03:16:38 -04:00
|
|
|
|
2013-08-26 18:28:55 -04:00
|
|
|
int xAxis = mouseX - guiWidth;
|
|
|
|
int yAxis = mouseY - guiHeight;
|
2013-08-02 03:16:38 -04:00
|
|
|
|
2012-10-03 15:12:17 -04:00
|
|
|
int displayInt;
|
2012-10-02 14:39:40 -04:00
|
|
|
|
2012-10-23 09:23:23 -04:00
|
|
|
displayInt = tileEntity.getScaledEnergyLevel(52);
|
2013-08-25 20:54:34 -04:00
|
|
|
drawTexturedModalRect(guiWidth + 165, guiHeight + 17 + 52 - displayInt, 176, 19 + 52 - displayInt, 4, displayInt);
|
2012-10-23 09:23:23 -04:00
|
|
|
|
|
|
|
displayInt = tileEntity.getScaledSecondaryEnergyLevel(12);
|
2013-08-25 20:54:34 -04:00
|
|
|
drawTexturedModalRect(guiWidth + 61, guiHeight + 37 + 12 - displayInt, 176, 7 + 12 - displayInt, 5, displayInt);
|
2012-08-15 16:41:41 -04:00
|
|
|
|
2012-10-03 15:12:17 -04:00
|
|
|
displayInt = tileEntity.getScaledProgress(24);
|
2013-08-25 20:54:34 -04:00
|
|
|
drawTexturedModalRect(guiWidth + 79, guiHeight + 39, 176, 0, displayInt + 1, 7);
|
2012-08-15 16:41:41 -04:00
|
|
|
}
|
2013-07-06 21:33:08 -04:00
|
|
|
}
|