2014-12-15 00:11:48 +00:00
|
|
|
package com.cricketcraft.chisel.client.gui;
|
2014-11-27 13:07:59 -05:00
|
|
|
|
|
|
|
|
import net.minecraft.client.gui.inventory.GuiContainer;
|
|
|
|
|
import net.minecraft.entity.player.InventoryPlayer;
|
|
|
|
|
import net.minecraft.util.ResourceLocation;
|
2014-12-14 20:05:39 +00:00
|
|
|
|
2014-11-27 13:07:59 -05:00
|
|
|
import org.lwjgl.opengl.GL11;
|
|
|
|
|
|
2014-12-15 00:11:48 +00:00
|
|
|
import com.cricketcraft.chisel.block.tileentity.TileEntityPresent;
|
|
|
|
|
import com.cricketcraft.chisel.inventory.ContainerPresent;
|
|
|
|
|
|
2014-11-27 13:07:59 -05:00
|
|
|
public class GuiPresent extends GuiContainer {
|
|
|
|
|
|
2015-01-07 19:50:18 -05:00
|
|
|
private static final ResourceLocation gui = new ResourceLocation("chisel:textures/present-gui.png");
|
|
|
|
|
private int rows;
|
2014-11-27 13:07:59 -05:00
|
|
|
|
2015-01-07 19:50:18 -05:00
|
|
|
public GuiPresent(InventoryPlayer inventoryPlayer, TileEntityPresent tileEntityPresent) {
|
|
|
|
|
super(new ContainerPresent(inventoryPlayer, tileEntityPresent));
|
|
|
|
|
rows = tileEntityPresent.getSizeInventory() / 9;
|
|
|
|
|
this.ySize = 114 + rows * 18;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
|
|
|
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
|
|
|
|
this.mc.getTextureManager().bindTexture(gui);
|
|
|
|
|
int x = (this.width - this.xSize) / 2;
|
|
|
|
|
int y = (this.height - this.ySize) / 2;
|
|
|
|
|
this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.rows * 18 + 17);
|
|
|
|
|
this.drawTexturedModalRect(x, y + this.rows * 18 + 17, 0, 126, this.xSize, 96);
|
|
|
|
|
}
|
2014-11-27 13:07:59 -05:00
|
|
|
}
|