OSDN Git Service

commonとsrc統合。電解機中途半端なので注意。
[chemicraft/chemicraft.git] / src / chemicraft / gui / GuiChemicalCombinationTable.java
diff --git a/src/chemicraft/gui/GuiChemicalCombinationTable.java b/src/chemicraft/gui/GuiChemicalCombinationTable.java
new file mode 100644 (file)
index 0000000..7daf181
--- /dev/null
@@ -0,0 +1,58 @@
+package chemicraft.gui;
+
+import net.minecraft.client.gui.GuiButton;
+import net.minecraft.client.gui.GuiTextField;
+import net.minecraft.client.gui.inventory.GuiContainer;
+import net.minecraft.entity.player.EntityPlayer;
+import chemicraft.ChemiCraft;
+import chemicraft.container.ContainerChemicalCombinationTable;
+import chemicraft.tileentity.TileEntityChemicalCombinationTable;
+import cpw.mods.fml.common.network.PacketDispatcher;
+
+public class GuiChemicalCombinationTable extends GuiContainer {
+
+       private GuiTextField atomList;
+
+       private TileEntityChemicalCombinationTable tileentity;
+
+       public GuiChemicalCombinationTable(EntityPlayer par1EntityPlayer, TileEntityChemicalCombinationTable par2) {
+               super(new ContainerChemicalCombinationTable(par1EntityPlayer, par2));
+               this.tileentity = par2;
+               this.ySize = 204;
+       }
+
+       @Override
+       public void initGui(){
+               super.initGui();
+               this.atomList = new GuiTextField(this.fontRenderer, 9, 103, 160, 15);
+               this.atomList.setFocused(false);
+               this.atomList.setMaxStringLength(25);
+               this.controlList.add(new GuiButton(0, this.guiLeft + 172 - 41, this.guiTop + 80 - 21, 40, 20, "Add"));
+               this.controlList.add(new GuiButton(1, this.guiLeft + 172 - 41, this.guiTop + 80, 40, 20, "Eject"));
+       }
+
+       @Override
+       protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) {
+               this.mc.renderEngine.bindTexture(this.mc.renderEngine.getTexture(ChemiCraft.instance.guiChemicalCombinationTexture));
+               this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
+       }
+
+       @Override
+       protected void actionPerformed(GuiButton par1GuiButton) {
+               if(par1GuiButton.id == 0){
+                       this.tileentity.field_00001();
+                       PacketDispatcher.sendPacketToServer(this.tileentity.getDescriptionPacket());
+               }else if(par1GuiButton.id == 1){
+                       this.tileentity.field_00002();
+                       PacketDispatcher.sendPacketToServer(this.tileentity.getDescriptionPacket());
+               }
+               return;
+       }
+
+       @Override
+       protected void drawGuiContainerForegroundLayer(int par1, int par2) {
+               this.atomList.setText(this.tileentity.getAtoms());
+               this.atomList.drawTextBox();
+       }
+
+}