Files
TinkersConstruct/src/main/java/tconstruct/client/gui/FrypanGui.java
T
2014-02-01 14:18:17 -05:00

47 lines
1.8 KiB
Java

package tconstruct.client.gui;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import org.lwjgl.opengl.GL11;
import tconstruct.blocks.logic.FrypanLogic;
public class FrypanGui extends GuiContainer
{
public FrypanLogic logic;
public FrypanGui(InventoryPlayer inventoryplayer, FrypanLogic frypan, World world, int x, int y, int z)
{
super(frypan.getGuiContainer(inventoryplayer, world, x, y, z));
logic = frypan;
}
protected void drawGuiContainerForegroundLayer (int par1, int par2)
{
field_146289_q.drawString(StatCollector.translateToLocal("crafters.Frypan"), 60, 6, 0x404040);
field_146289_q.drawString(StatCollector.translateToLocal("container.inventory"), 8, (field_147000_g - 96) + 2, 0x404040);
}
private static final ResourceLocation background = new ResourceLocation("tinker", "textures/gui/frypan.png");
protected void func_146976_a (float f, int i, int j)
{
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.field_146297_k.getTextureManager().bindTexture(background);
int cornerX = (field_146294_l - field_146999_f) / 2;
int cornerY = (field_146295_m - field_147000_g) / 2;
drawTexturedModalRect(cornerX, cornerY, 0, 0, field_146999_f, field_147000_g);
if (logic.fuel > 0)
{
int fuel = logic.gaugeFuelScaled(12);
drawTexturedModalRect(cornerX + 27, (cornerY + 40) - fuel, 176, 12 - fuel, 14, fuel + 2);
}
int fuelgague = logic.gaugeProgressScaled(24);
drawTexturedModalRect(cornerX + 140, cornerY + 8, 176, 14, fuelgague, 16);
}
}