package com.harry9137.ct.client.gui;
import com.harry9137.ct.CreepTech;
import com.harry9137.ct.client.container.ContainerTechTable;
import com.harry9137.ct.client.gui.elements.ChangeGuiButton;
import com.harry9137.ct.reference.reference;
import com.harry9137.ct.tileentity.TileEntityTechTable;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import org.lwjgl.opengl.GL11;
public class GuiTechTable extends GuiContainer {
private static final ResourceLocation furnaceGuiTextures = new ResourceLocation("textures/gui/container/furnace.png");
protected ChangeGuiButton Threebutton = new ChangeGuiButton(0, 100, 100, "3");
protected GuiButton Fourbutton = new GuiButton(1, 150, 100, 60, 60, "4");
protected GuiButton Fivebutton = new GuiButton(2, 200, 100, 60, 60, "5");
public static final int GUI_ID = 0;
private int OldYSize = this.ySize;
public int guiLeft;
protected static final ResourceLocation buttonTextures = new ResourceLocation("textures/gui/ChangeSizeButton.png");
protected static EntityPlayer player;
private static int[] coords = new int[3];
public GuiTechTable(World world, int xCoord, int yCoord, int zCoord, InventoryPlayer inventoryPlayer, TileEntityTechTable tileEntityTechTable, EntityPlayer player1) {
super(new ContainerTechTable(inventoryPlayer, tileEntityTechTable, 162, 173));
tileEntityTechTable.container = new ContainerTechTable(inventoryPlayer, tileEntityTechTable, 162, 173);
this.player = player1;
coords[0] = xCoord;
coords[1] = yCoord;
coords[2] = zCoord;
}
@Override
public void initGui() {
super.initGui();
buttonList.clear();
buttonList.add(Threebutton);
buttonList.add(Fourbutton);
buttonList.add(Fivebutton);
}
@Override
public boolean doesGuiPauseGame() {
return false;
}
@Override
public void drawScreen(int i, int j, float f) {
super.drawDefaultBackground();
this.drawGuiContainerBackgroundLayer(f, i, j);
super.drawScreen(i, j, f);
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
this.ySize = OldYSize + 7;
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
// CreepTech.proxy.bindTexture(new ResourceLocation(reference.MOD_ID, "textures/gui/guiTechTable3.png"));
this.mc.renderEngine.bindTexture(new ResourceLocation(reference.MOD_ID.toLowerCase(), "textures/gui/guiTechTable3.png"));
//this.mc.getTextureManager().bindTexture(furnaceGuiTextures);
int x = (this.width - this.xSize) / 2;
int y = ((this.height - this.ySize) / 2);
drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
// CreepTech.proxy.bindTexture(new ResourceLocation(reference.MOD_ID, "textures/gui/guiTechTable3.png"));
}
@Override
public void actionPerformed(GuiButton button) {
if(button.equals(Threebutton)){
player.closeScreen();
player.openGui(CreepTech.INSTANCE, 0, player.getEntityWorld(), this.coords[0], this.coords[1], this.coords[2]);
}
if(button.equals(Fourbutton)){
player.closeScreen();
player.openGui(CreepTech.INSTANCE, 1, player.getEntityWorld(), this.coords[0], this.coords[1], this.coords[2]);
}
if(button.equals(Fivebutton)){
player.closeScreen();
player.openGui(CreepTech.INSTANCE, 2, player.getEntityWorld(), this.coords[0], this.coords[1], this.coords[2]);
}
}
}