mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-22 04:52:25 +00:00
87 lines
3.2 KiB
Java
87 lines
3.2 KiB
Java
package mekanism.client.gui;
|
|
|
|
import mekanism.api.gas.GasTank;
|
|
import mekanism.client.gui.GuiGasGauge.IGasInfoHandler;
|
|
import mekanism.client.gui.GuiProgress.IProgressInfoHandler;
|
|
import mekanism.client.gui.GuiProgress.ProgressBar;
|
|
import mekanism.client.gui.GuiSlot.SlotOverlay;
|
|
import mekanism.client.gui.GuiSlot.SlotType;
|
|
import mekanism.common.inventory.container.ContainerSolarNeutronActivator;
|
|
import mekanism.common.tile.TileEntitySolarNeutronActivator;
|
|
import mekanism.common.util.MekanismUtils;
|
|
import mekanism.common.util.MekanismUtils.ResourceType;
|
|
import net.minecraft.entity.player.InventoryPlayer;
|
|
|
|
import org.lwjgl.opengl.GL11;
|
|
|
|
import cpw.mods.fml.relauncher.Side;
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
|
|
|
@SideOnly(Side.CLIENT)
|
|
public class GuiSolarNeutronActivator extends GuiMekanism
|
|
{
|
|
public TileEntitySolarNeutronActivator tileEntity;
|
|
|
|
public GuiSolarNeutronActivator(InventoryPlayer inventory, TileEntitySolarNeutronActivator tentity)
|
|
{
|
|
super(new ContainerSolarNeutronActivator(inventory, tentity));
|
|
tileEntity = tentity;
|
|
|
|
guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png")));
|
|
guiElements.add(new GuiUpgradeTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png")));
|
|
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"), 4, 24).with(SlotOverlay.PLUS));
|
|
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"), 4, 55).with(SlotOverlay.MINUS));
|
|
|
|
guiElements.add(new GuiGasGauge(new IGasInfoHandler() {
|
|
@Override
|
|
public GasTank getTank()
|
|
{
|
|
return tileEntity.inputTank;
|
|
}
|
|
}, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"), 25, 13));
|
|
guiElements.add(new GuiGasGauge(new IGasInfoHandler() {
|
|
@Override
|
|
public GasTank getTank()
|
|
{
|
|
return tileEntity.outputTank;
|
|
}
|
|
}, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"), 133, 13));
|
|
|
|
guiElements.add(new GuiProgress(new IProgressInfoHandler()
|
|
{
|
|
@Override
|
|
public double getProgress()
|
|
{
|
|
return tileEntity.isActive ? 1 : 0;
|
|
}
|
|
}, ProgressBar.LARGE_RIGHT, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"), 62, 38));
|
|
}
|
|
|
|
@Override
|
|
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
|
{
|
|
int xAxis = (mouseX - (width - xSize) / 2);
|
|
int yAxis = (mouseY - (height - ySize) / 2);
|
|
|
|
fontRendererObj.drawString(tileEntity.getInventoryName(), 26, 4, 0x404040);
|
|
|
|
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
|
}
|
|
|
|
@Override
|
|
protected void drawGuiContainerBackgroundLayer(float partialTick, int mouseX, int mouseY)
|
|
{
|
|
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"));
|
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
|
int guiWidth = (width - xSize) / 2;
|
|
int guiHeight = (height - ySize) / 2;
|
|
drawTexturedModalRect(guiWidth, guiHeight, 0, 0, xSize, ySize);
|
|
int displayInt;
|
|
|
|
int xAxis = (mouseX - (width - xSize) / 2);
|
|
int yAxis = (mouseY - (height - ySize) / 2);
|
|
|
|
super.drawGuiContainerBackgroundLayer(partialTick, mouseX, mouseY);
|
|
}
|
|
}
|