2013-08-27 00:49:32 +02:00
|
|
|
package mekanism.client.gui;
|
2012-08-15 22:41:41 +02:00
|
|
|
|
2012-11-05 20:29:04 +01:00
|
|
|
import mekanism.common.PacketHandler;
|
2013-06-07 17:16:47 +02:00
|
|
|
import mekanism.common.PacketHandler.Transmission;
|
2013-06-13 23:37:30 +02:00
|
|
|
import mekanism.common.network.PacketTime;
|
2013-08-27 00:57:08 +02:00
|
|
|
import mekanism.common.util.MekanismUtils;
|
|
|
|
import mekanism.common.util.MekanismUtils.ResourceType;
|
2012-12-20 22:53:39 +01:00
|
|
|
import net.minecraft.client.gui.GuiButton;
|
|
|
|
import net.minecraft.client.gui.GuiScreen;
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
2013-08-27 00:57:08 +02:00
|
|
|
|
2012-12-20 22:53:39 +01:00
|
|
|
import org.lwjgl.opengl.GL11;
|
2012-08-15 22:41:41 +02:00
|
|
|
|
2013-04-13 16:33:37 +02:00
|
|
|
import cpw.mods.fml.relauncher.Side;
|
|
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
|
|
|
|
|
|
|
@SideOnly(Side.CLIENT)
|
2013-02-27 02:21:30 +01:00
|
|
|
public class GuiStopwatch extends GuiScreen
|
|
|
|
{
|
2012-08-15 22:41:41 +02:00
|
|
|
private static EntityPlayer player;
|
|
|
|
|
|
|
|
public GuiStopwatch(EntityPlayer entityplayer)
|
|
|
|
{
|
|
|
|
player = entityplayer;
|
|
|
|
}
|
|
|
|
|
2012-11-06 16:44:14 +01:00
|
|
|
@Override
|
2012-08-15 22:41:41 +02:00
|
|
|
public void initGui()
|
|
|
|
{
|
2013-03-18 17:23:57 +01:00
|
|
|
buttonList.clear();
|
|
|
|
buttonList.add(new GuiButton(0, width / 2 - 80, height / 2 - 65, 50, 20, "Sunrise"));
|
|
|
|
buttonList.add(new GuiButton(1, width / 2 - 80, height / 2 - 35, 50, 20, "Noon"));
|
|
|
|
buttonList.add(new GuiButton(2, width / 2 + 5, height / 2 - 65, 50, 20, "Sunset"));
|
|
|
|
buttonList.add(new GuiButton(3, width / 2 + 5, height / 2 - 35, 50, 20, "Midnight"));
|
|
|
|
buttonList.add(new GuiButton(4, width / 2 - 94, height / 2 + 30, 80, 20, "Credits"));
|
|
|
|
buttonList.add(new GuiButton(5, width / 2 - 10, height / 2 + 30, 80, 20, "Close"));
|
2012-08-15 22:41:41 +02:00
|
|
|
}
|
|
|
|
|
2012-11-06 16:44:14 +01:00
|
|
|
@Override
|
2012-08-15 22:41:41 +02:00
|
|
|
public void drawScreen(int i, int j, float f)
|
|
|
|
{
|
|
|
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
2013-09-28 03:59:47 +02:00
|
|
|
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.GUI, "GuiStopwatch.png"));
|
2012-08-15 22:41:41 +02:00
|
|
|
drawTexturedModalRect(width / 2 - 100, height / 2 - 100, 0, 0, 176, 166);
|
|
|
|
drawString(fontRenderer, "Steve's Stopwatch", width / 2 - 60, height / 2 - 95, 0xffffff);
|
|
|
|
super.drawScreen(i, j, f);
|
|
|
|
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
|
|
|
GL11.glEnable(GL11.GL_CULL_FACE);
|
|
|
|
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
|
|
|
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
|
|
|
}
|
|
|
|
|
2012-11-06 16:44:14 +01:00
|
|
|
@Override
|
2012-08-15 22:41:41 +02:00
|
|
|
public void keyTyped(char c, int i)
|
|
|
|
{
|
2013-06-13 23:37:30 +02:00
|
|
|
if(i == 1)
|
2012-08-15 22:41:41 +02:00
|
|
|
{
|
|
|
|
mc.displayGuiScreen(null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-11-06 16:44:14 +01:00
|
|
|
@Override
|
2012-08-15 22:41:41 +02:00
|
|
|
public boolean doesGuiPauseGame()
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2012-11-06 16:44:14 +01:00
|
|
|
@Override
|
2012-08-15 22:41:41 +02:00
|
|
|
public void actionPerformed(GuiButton guibutton)
|
|
|
|
{
|
2012-09-20 15:59:30 +02:00
|
|
|
if(guibutton.id == 0)
|
2012-08-15 22:41:41 +02:00
|
|
|
{
|
2012-11-05 20:29:04 +01:00
|
|
|
MekanismUtils.doFakeEntityExplosion(player);
|
2013-06-15 00:25:09 +02:00
|
|
|
PacketHandler.sendPacket(Transmission.SERVER, new PacketTime().setParams(0));
|
2012-08-18 19:40:59 +02:00
|
|
|
mc.displayGuiScreen(null);
|
2012-08-15 22:41:41 +02:00
|
|
|
}
|
2012-09-20 15:59:30 +02:00
|
|
|
if(guibutton.id == 1)
|
2012-08-15 22:41:41 +02:00
|
|
|
{
|
2012-11-05 20:29:04 +01:00
|
|
|
MekanismUtils.doFakeEntityExplosion(player);
|
2013-06-15 00:25:09 +02:00
|
|
|
PacketHandler.sendPacket(Transmission.SERVER, new PacketTime().setParams(6));
|
2012-08-18 19:40:59 +02:00
|
|
|
mc.displayGuiScreen(null);
|
2012-08-15 22:41:41 +02:00
|
|
|
}
|
2012-09-20 15:59:30 +02:00
|
|
|
if(guibutton.id == 2)
|
2012-08-15 22:41:41 +02:00
|
|
|
{
|
2012-11-05 20:29:04 +01:00
|
|
|
MekanismUtils.doFakeEntityExplosion(player);
|
2013-06-15 00:25:09 +02:00
|
|
|
PacketHandler.sendPacket(Transmission.SERVER, new PacketTime().setParams(12));
|
2012-08-18 19:40:59 +02:00
|
|
|
mc.displayGuiScreen(null);
|
2012-08-15 22:41:41 +02:00
|
|
|
}
|
2012-09-20 15:59:30 +02:00
|
|
|
if(guibutton.id == 3)
|
2012-08-15 22:41:41 +02:00
|
|
|
{
|
2012-11-05 20:29:04 +01:00
|
|
|
MekanismUtils.doFakeEntityExplosion(player);
|
2013-06-15 00:25:09 +02:00
|
|
|
PacketHandler.sendPacket(Transmission.SERVER, new PacketTime().setParams(18));
|
2012-08-18 19:40:59 +02:00
|
|
|
mc.displayGuiScreen(null);
|
2012-08-15 22:41:41 +02:00
|
|
|
}
|
2012-09-20 15:59:30 +02:00
|
|
|
if(guibutton.id == 4)
|
2012-08-15 22:41:41 +02:00
|
|
|
{
|
|
|
|
mc.displayGuiScreen(new GuiCredits());
|
|
|
|
}
|
2012-09-20 15:59:30 +02:00
|
|
|
if(guibutton.id == 5)
|
2012-08-15 22:41:41 +02:00
|
|
|
{
|
|
|
|
mc.displayGuiScreen(null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|