OSDN Git Service

Merge branch 'master' of https://scm.sourceforge.jp/gitroot/chemicraft/chemicraft
[chemicraft/chemicraft.git] / common / chemicraft / GuiScienceCraftingTable.java
1 package chemicraft;
2
3 import java.util.ArrayList;
4
5 import net.minecraft.src.GuiContainer;
6 import net.minecraft.src.InventoryPlayer;
7 import net.minecraft.src.Slot;
8
9 import org.lwjgl.opengl.GL11;
10
11 import cpw.mods.fml.common.Side;
12 import cpw.mods.fml.common.asm.SideOnly;
13
14 @SideOnly(Side.CLIENT)
15 public class GuiScienceCraftingTable extends GuiContainer
16 {
17
18         private ArrayList<ChemiCraftTabs> tabList = new ArrayList<ChemiCraftTabs>();
19
20         public GuiScienceCraftingTable(InventoryPlayer par1InventoryPlayer, TileEntityScienceCraftingTable par2)
21         {
22                 super(new ContainerScienceCraftingTable(par1InventoryPlayer, par2));
23         }
24
25         @Override
26         protected void drawGuiContainerForegroundLayer()
27         {
28                 //this.fontRenderer.drawString(StatCollector.translateToLocal("container.crafting"), 28, 6, 4210752);
29                 //this.fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
30         }
31
32         @Override
33         protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
34         {
35                 int var4 = this.mc.renderEngine.getTexture("/ChemiCraft/guis/Decomposition.png");
36                 int var7 = this.mc.renderEngine.getTexture("/gui/allitems.png");
37                 GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
38                 this.mc.renderEngine.bindTexture(var4);
39                 int var5 = (this.width - this.xSize) / 2;
40                 int var6 = (this.height - this.ySize) / 2;
41                 this.drawTexturedModalRect(var5, var6, 0, 0, this.xSize, this.ySize);
42
43                 for(int i = 0;i < tabList.size();i++){
44                         this.mc.renderEngine.bindTexture(var7);
45                         int var8 = var5 + tabList.get(i).getID() * 28;
46                         int var9 = var6 - 32;
47                         this.drawTexturedModalRect(var8, var9, 0, 0, 28, 32);
48                 }
49         }
50
51         @Override
52         protected void handleMouseClick(Slot par1Slot, int par2, int par3, boolean par4){
53                 System.out.println(par2);
54                 System.out.println(par3);
55         }
56
57         @Override
58         protected void mouseClicked(int par1, int par2, int par3)
59         {
60                 super.mouseClicked(par1, par2, par3);
61         }
62
63         private void addTabs(int id, int Texture, String name){
64                 for(int i = 0;i < tabList.size();i++){
65                         if(id == tabList.get(i).getID()){
66                                 try {
67                                         throw new Exception("ChemiCraft内でエラー:ChemiCraftTabのIDが重複しています");
68                                 } catch (Exception e) {
69                                         e.printStackTrace();
70                                 }
71                         }
72                 }
73                 tabList.add(new ChemiCraftTabs(id, Texture, name));
74         }
75
76 }