package advancedhud.client.ui;

import advancedhud.api.HUDRegistry;
import advancedhud.api.HudItem;
import advancedhud.client.huditems.HudItemHotbar;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;

public class GuiScreenHudItem extends GuiScreen {

    private HudItem hudItem;
    private GuiScreen parentScreen;

    public GuiScreenHudItem(GuiScreen parentScreen, HudItem hudItem) {
        this.hudItem = hudItem;
        this.parentScreen = parentScreen;
    }

    @SuppressWarnings("unchecked")
    @Override
    public void initGui() {
        buttonList.clear();
        buttonList.add(new GuiButton(-1, HUDRegistry.screenWidth - 30, 10, 20,
                20, "X"));
        if (hudItem instanceof HudItemHotbar) {
            buttonList.add(new GuiButton(100, HUDRegistry.screenWidth/2-100, 
                    HUDRegistry.screenHeight/2, 200, 20, "Rotate?"));
        }
    }

    @Override
    public void drawScreen(int par1, int par2, float par3) {
        this.drawDefaultBackground();

        if (!HUDRegistry.checkForResize()) {
            initGui();
        }

        this.drawCenteredString(mc.fontRenderer, hudItem.getButtonLabel(),
                HUDRegistry.screenWidth / 2, 10, 0xFFFFFF);
        super.drawScreen(par1, par2, par3);
    }

    @Override
    protected void keyTyped(char keyChar, int keyCode) {
        if (keyCode == 1) {
            mc.displayGuiScreen(parentScreen);
        }
    }

    @Override
    protected void actionPerformed(GuiButton par1GuiButton) {
        if (par1GuiButton.id == -1) {
            mc.displayGuiScreen(parentScreen);
        } else if (par1GuiButton.id == 100) {
            hudItem.rotate();
        }
        super.actionPerformed(par1GuiButton);
    }

}

@@ -25,16 +25,134 @@
 nt.ui;%0A%0A
+import net.minecraft.client.gui.GuiButton;%0Aimport net.minecraft.client.gui.GuiScreen;%0Aimport advancedhud.AdvancedHUD;%0A
 import a
@@ -257,100 +257,18 @@
 Item
-Hotbar;%0Aimport net.minecraft.client.gui.GuiButton;%0Aimport net.minecraft.client.gui.GuiScreen
+Crosshairs
 ;%0A%0Ap
@@ -718,32 +718,16 @@
  10, 20,
-%0A               
  20, %22X%22
@@ -753,33 +753,20 @@
 Item
- instanceof HudItemHotbar
+.canRotate()
 ) %7B%0A
@@ -838,16 +838,75 @@
 idth
-/2-100, 
+ / 2 - 50, HUDRegistry.screenHeight / 2 - 10, 100, 20, %22Rotate?%22));
 %0A   
@@ -906,32 +906,35 @@
 ));%0A        
+%7D %0A
         
     HUDRegis
@@ -913,35 +913,130 @@
      %7D %0A        
-   
+if (hudItem instanceof HudItemCrosshairs) %7B%0A            buttonList.add(new GuiButtonIconGrid(3320,
  HUDRegistry.scr
@@ -1042,35 +1042,47 @@
 reen
-Height/2, 200, 2
+Width / 2 - 64, 4
 0, %22
-Rotate?
+Crosshair Selector
 %22));
@@ -1370,24 +1370,8 @@
 l(),
-%0A               
  HUD
@@ -1868,24 +1868,92 @@
 ;%0A        %7D%0A
+        AdvancedHUD.log.info(%22Clicked button %22 + par1GuiButton.id);%0A
         supe

Add crosshair-specific icon selection