1 package chemicraft.gui;
3 import net.minecraft.client.gui.GuiButton;
4 import net.minecraft.client.gui.GuiTextField;
5 import net.minecraft.client.gui.inventory.GuiContainer;
6 import net.minecraft.entity.player.EntityPlayer;
7 import chemicraft.ChemiCraft;
8 import chemicraft.container.ContainerChemicalCombinationTable;
9 import chemicraft.tileentity.TileEntityChemicalCombinationTable;
10 import cpw.mods.fml.common.network.PacketDispatcher;
12 public class GuiChemicalCombinationTable extends GuiContainer {
14 private GuiTextField atomList;
16 private TileEntityChemicalCombinationTable tileentity;
18 public GuiChemicalCombinationTable(EntityPlayer par1EntityPlayer, TileEntityChemicalCombinationTable par2) {
19 super(new ContainerChemicalCombinationTable(par1EntityPlayer, par2));
20 this.tileentity = par2;
25 public void initGui(){
27 this.atomList = new GuiTextField(this.fontRenderer, 9, 103, 160, 15);
28 this.atomList.setFocused(false);
29 this.atomList.setMaxStringLength(25);
30 this.controlList.add(new GuiButton(0, this.guiLeft + 172 - 41, this.guiTop + 80 - 21, 40, 20, "Add"));
31 this.controlList.add(new GuiButton(1, this.guiLeft + 172 - 41, this.guiTop + 80, 40, 20, "Eject"));
35 protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) {
36 this.mc.renderEngine.bindTexture(this.mc.renderEngine.getTexture(ChemiCraft.instance.guiChemicalCombinationTexture));
37 this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
41 protected void actionPerformed(GuiButton par1GuiButton) {
42 if(par1GuiButton.id == 0){
43 this.tileentity.field_00001();
44 PacketDispatcher.sendPacketToServer(this.tileentity.getDescriptionPacket());
45 }else if(par1GuiButton.id == 1){
46 this.tileentity.field_00002();
47 PacketDispatcher.sendPacketToServer(this.tileentity.getDescriptionPacket());
53 protected void drawGuiContainerForegroundLayer(int par1, int par2) {
54 this.atomList.setText(this.tileentity.getAtoms());
55 this.atomList.drawTextBox();