mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-22 21:09:45 +00:00
I went for what seemed like a good level of organisation: Java __________ Mekanism __________ Minecraft Forge FML __________ Netty LWJGL __________ Other APIs __________ Static Imports.
54 lines
1.7 KiB
Java
54 lines
1.7 KiB
Java
package mekanism.client.gui;
|
|
|
|
import mekanism.api.gas.GasTank;
|
|
import mekanism.client.gui.GuiGasGauge.IGasInfoHandler;
|
|
import mekanism.client.gui.GuiGauge.Type;
|
|
import mekanism.common.inventory.container.ContainerNull;
|
|
import mekanism.common.tile.TileEntityAmbientAccumulator;
|
|
import mekanism.common.util.MekanismUtils;
|
|
import mekanism.common.util.MekanismUtils.ResourceType;
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
|
|
import org.lwjgl.opengl.GL11;
|
|
|
|
public class GuiAmbientAccumulator extends GuiMekanism
|
|
{
|
|
TileEntityAmbientAccumulator tileEntity;
|
|
|
|
public GuiAmbientAccumulator(EntityPlayer player, TileEntityAmbientAccumulator tile)
|
|
{
|
|
super(new ContainerNull(player, tile));
|
|
tileEntity = tile;
|
|
|
|
guiElements.add(new GuiGasGauge(new IGasInfoHandler() {
|
|
@Override
|
|
public GasTank getTank()
|
|
{
|
|
return tileEntity.collectedGas;
|
|
}
|
|
}, Type.WIDE, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"), 26, 16));
|
|
}
|
|
|
|
@Override
|
|
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
|
{
|
|
fontRendererObj.drawString(tileEntity.getInventoryName(), 45, 6, 0x404040);
|
|
fontRendererObj.drawString(MekanismUtils.localize("container.inventory"), 8, (ySize - 96) + 2, 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);
|
|
|
|
super.drawGuiContainerBackgroundLayer(partialTick, mouseX, mouseY);
|
|
}
|
|
}
|