package pvphud.main;
import java.io.IOException;
import org.lwjgl.input.Mouse;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import pvphud.main.KeyStrokes.ColorChoice;
public class PVPHudOptions extends GuiScreen
{
private GuiButton colorButton;
private GuiButton cornerButton;
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks)
{
this.drawDefaultBackground();
super.drawScreen(mouseX, mouseY, partialTicks);
}
@Override
public boolean doesGuiPauseGame()
{
return false;
}
@Override
public void initGui()
{
this.buttonList.add(this.colorButton = new GuiButton(0, this.width / 2 - 100, this.height / 2 - 24, "Color Choice: " + KeyStrokes.chosenColor));
this.buttonList.add(this.cornerButton = new GuiButton(1, this.width / 2 - 100, this.height / 2 + 4, "Corner Choice: " + KeyStrokes.chosenCorner));
}
@Override
protected void actionPerformed(GuiButton button) throws IOException
{
if (button == this.colorButton)
{
int colorInt = KeyStrokes.chosenColor.ordinal();
colorInt ++;
if(colorInt >= KeyStrokes.ColorChoice.values().length)
{
colorInt = 0;
}
KeyStrokes.setColorChoice(KeyStrokes.ColorChoice.values()[colorInt]);
this.buttonList.set(0, this.colorButton = new GuiButton(0, this.width / 2 - 100, this.height / 2 - 24, "Color Choice: " + KeyStrokes.chosenColor));
}
if (button == this.cornerButton){
int cornerInt = KeyStrokes.chosenCorner.ordinal();
cornerInt ++;
if(cornerInt >= KeyStrokes.Corner.values().length)
{
cornerInt = 0;
}
KeyStrokes.setCornerChoice(KeyStrokes.Corner.values()[cornerInt]);
this.buttonList.set(1, this.cornerButton = new GuiButton(1, this.width / 2 - 100, this.height / 2 + 4, "Corner Choice: " + KeyStrokes.chosenCorner));
}
}
}