2015-05-09 21:19:40 +02:00
|
|
|
package techreborn.client.gui;
|
|
|
|
|
2015-06-10 14:52:54 +02:00
|
|
|
import net.minecraft.client.gui.GuiButton;
|
2015-05-09 21:19:40 +02:00
|
|
|
import net.minecraft.client.gui.inventory.GuiContainer;
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
|
|
import net.minecraft.util.ResourceLocation;
|
|
|
|
import net.minecraft.util.StatCollector;
|
|
|
|
import techreborn.client.container.ContainerAesu;
|
2015-06-10 14:52:54 +02:00
|
|
|
import techreborn.client.gui.componets.GuiHiddenButton;
|
|
|
|
import techreborn.packets.PacketAesu;
|
|
|
|
import techreborn.packets.PacketHandler;
|
2015-05-09 21:19:40 +02:00
|
|
|
import techreborn.tiles.TileAesu;
|
|
|
|
|
2015-06-10 17:12:16 +02:00
|
|
|
import java.awt.*;
|
|
|
|
|
2015-05-09 21:19:40 +02:00
|
|
|
public class GuiAesu extends GuiContainer {
|
|
|
|
|
|
|
|
private static final ResourceLocation texture = new ResourceLocation(
|
|
|
|
"techreborn", "textures/gui/aesu.png");
|
|
|
|
|
|
|
|
TileAesu aesu;
|
|
|
|
|
2015-06-10 17:12:16 +02:00
|
|
|
ContainerAesu containerAesu;
|
|
|
|
|
2015-05-09 21:19:40 +02:00
|
|
|
public GuiAesu(EntityPlayer player,
|
|
|
|
TileAesu tileaesu)
|
|
|
|
{
|
|
|
|
super(new ContainerAesu(tileaesu, player));
|
2015-06-14 12:37:42 +02:00
|
|
|
this.xSize = 156;
|
|
|
|
this.ySize = 200;
|
2015-05-09 21:19:40 +02:00
|
|
|
aesu = tileaesu;
|
2015-06-10 17:12:16 +02:00
|
|
|
this.containerAesu = (ContainerAesu) this.inventorySlots;
|
2015-05-09 21:19:40 +02:00
|
|
|
}
|
|
|
|
|
2015-06-10 14:52:54 +02:00
|
|
|
@Override
|
|
|
|
public void initGui() {
|
|
|
|
super.initGui();
|
|
|
|
this.buttonList.clear();
|
|
|
|
int k = (this.width - this.xSize) / 2;
|
|
|
|
int l = (this.height - this.ySize) / 2;
|
2015-06-14 12:37:42 +02:00
|
|
|
this.buttonList.add(new GuiButton(0, k + 96, l + 8, 18, 20, "++"));
|
|
|
|
this.buttonList.add(new GuiButton(1, k + 96, l + 8 + 22, 18, 20, "+"));
|
|
|
|
this.buttonList.add(new GuiButton(2, k + 96, l + 8 + (22*2), 18, 20, "-"));
|
|
|
|
this.buttonList.add(new GuiButton(3, k + 96, l + 8 + (22*3), 18, 20, "--"));
|
2015-06-10 14:52:54 +02:00
|
|
|
}
|
|
|
|
|
2015-05-09 21:19:40 +02:00
|
|
|
@Override
|
|
|
|
protected void drawGuiContainerBackgroundLayer(float p_146976_1_,
|
|
|
|
int p_146976_2_, int p_146976_3_)
|
|
|
|
{
|
|
|
|
this.mc.getTextureManager().bindTexture(texture);
|
|
|
|
int k = (this.width - this.xSize) / 2;
|
|
|
|
int l = (this.height - this.ySize) / 2;
|
|
|
|
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected void drawGuiContainerForegroundLayer(int p_146979_1_,
|
|
|
|
int p_146979_2_)
|
|
|
|
{
|
2015-06-14 12:58:56 +02:00
|
|
|
this.fontRendererObj.drawString(StatCollector.translateToLocal("tile.techreborn.aesu.name"), 40, 10, Color.WHITE.getRGB());
|
2015-06-10 17:12:16 +02:00
|
|
|
this.fontRendererObj.drawString(containerAesu.euOut + " eu/tick", 10, 20, Color.WHITE.getRGB());
|
|
|
|
this.fontRendererObj.drawString(containerAesu.storedEu + " eu", 10, 30, Color.WHITE.getRGB());
|
2015-06-14 12:58:56 +02:00
|
|
|
this.fontRendererObj.drawString(containerAesu.euChange + " eu change", 10, 40, Color.WHITE.getRGB());
|
2015-05-09 21:19:40 +02:00
|
|
|
}
|
2015-06-10 14:52:54 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void actionPerformed(GuiButton button) {
|
|
|
|
super.actionPerformed(button);
|
|
|
|
PacketHandler.sendPacketToServer(new PacketAesu(button.id, aesu));
|
|
|
|
}
|
2015-05-09 21:19:40 +02:00
|
|
|
}
|