Package mekanism.client.gui

Source Code of mekanism.client.gui.GuiFluidicPlenisher

package mekanism.client.gui;

import mekanism.client.gui.GuiFluidGauge.IFluidInfoHandler;
import mekanism.client.gui.GuiSlot.SlotOverlay;
import mekanism.client.gui.GuiSlot.SlotType;
import mekanism.common.inventory.container.ContainerFluidicPlenisher;
import mekanism.common.tile.TileEntityFluidicPlenisher;
import mekanism.common.util.LangUtils;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;

import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fluids.FluidTank;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

import org.lwjgl.opengl.GL11;

@SideOnly(Side.CLIENT)
public class GuiFluidicPlenisher extends GuiMekanism
{
  public TileEntityFluidicPlenisher tileEntity;

  public ResourceLocation guiLocation = MekanismUtils.getResource(ResourceType.GUI, "GuiElectricPump.png");

  public GuiFluidicPlenisher(InventoryPlayer inventory, TileEntityFluidicPlenisher tentity)
  {
    super(new ContainerFluidicPlenisher(inventory, tentity));
    tileEntity = tentity;

    guiElements.add(new GuiSlot(SlotType.NORMAL, this, guiLocation, 27, 19));
    guiElements.add(new GuiSlot(SlotType.NORMAL, this, guiLocation, 27, 50));
    guiElements.add(new GuiSlot(SlotType.POWER, this, guiLocation, 142, 34).with(SlotOverlay.POWER));
    guiElements.add(new GuiPowerBar(this, tileEntity, guiLocation, 164, 15));
    guiElements.add(new GuiFluidGauge(new IFluidInfoHandler() {
      @Override
      public FluidTank getTank()
      {
        return tileEntity.fluidTank;
      }
    }, GuiGauge.Type.STANDARD, this, guiLocation, 6, 13));

  }

  @Override
  protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
  {
    fontRendererObj.drawString(tileEntity.getInventoryName(), 45, 6, 0x404040);
    fontRendererObj.drawString(MekanismUtils.localize("container.inventory"), 8, (ySize - 94) + 2, 0x404040);
    fontRendererObj.drawString(MekanismUtils.getEnergyDisplay(tileEntity.getEnergy()), 51, 26, 0x00CD00);
    fontRendererObj.drawString(MekanismUtils.localize("gui.finished") + ": " + LangUtils.transYesNo(tileEntity.finishedCalc), 51, 35, 0x00CD00);
    fontRendererObj.drawString(tileEntity.fluidTank.getFluid() != null ? tileEntity.fluidTank.getFluid().getFluid().getName() + ": " + tileEntity.fluidTank.getFluid().amount : MekanismUtils.localize("gui.noFluid"), 51, 44, 0x00CD00);

    super.drawGuiContainerForegroundLayer(mouseX, mouseY);
  }

  @Override
  protected void drawGuiContainerBackgroundLayer(float partialTick, int mouseX, int mouseY)
  {
    mc.renderEngine.bindTexture(guiLocation);
    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);
  }
}
TOP

Related Classes of mekanism.client.gui.GuiFluidicPlenisher

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.