1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
package reactor;
import org.lwjgl.opengl.GL11;
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import kekztech.KekzCore;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
public class GUIContainer_ModularNuclearReactor extends GT_GUIContainerMetaTile_Machine {
private final String resourceName;
private final ResourceLocation texture;
public GUIContainer_ModularNuclearReactor(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity,
String aName, String aTextureFile) {
super(new Container_ModularNuclearReactor(aInventoryPlayer, aTileEntity), aTextureFile);
this.resourceName = aTextureFile;
this.texture = new ResourceLocation(KekzCore.MODID, "textures/gui/" + resourceName);
}
@SuppressWarnings("unchecked")
@Override
public void initGui() {
super.initGui();
// The parameters of GuiButton are (id, x, y, width, height, text)
super.buttonList.add(new GuiButton(1, 100, 200, 100, 20, "Hello"));
}
@Override
protected void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) {
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
final int x = (super.width - super.xSize);
final int y = (super.height - super.ySize);
super.drawTexturedModalRect(x, y, 0, 0, super.xSize, super.ySize);
}
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
}
}
|