#include "ui/menudef.h"
#include "ui_mp/common_macro.inc"

#define CHOICE_SIZE_X           150
#define CHOICE_SIZE_Y           22

#define CHOICE_X_START          0
#define CHOICE_Y_START          105

#define CHOICE_GROUP            "shoutcast"
#define CHOICE_SEP_1            4

#include "ui_mp/menustyle.inc"
#include "ui_mp/choices_setup_teams.menu"

#define ORIGIN_DESCRIPTION      (CHOICE_X_START + 15) 190

{
    menuDef
    {
        name            "shoutcast"
        rect            0 0 640 480
        focuscolor      COLOR_FOCUSED
        style           WINDOW_STYLE_EMPTY
        blurWorld       7.0
        onOpen
        {
            focusFirst;
			scriptMenuResponse "getdetails";
        }
        onEsc
        {
            scriptMenuResponse "back";
        }

		PREPROC_SHADER_DRAW( -120 0 880 480, 0 0, "white", 0 0 0 0.75, 0, 1, 0 0 0 0 )

        itemDef
        {
            style           WINDOW_STYLE_SHADER
            rect            0 0 854 75 HORIZONTAL_ALIGN_FULLSCREEN 0
            background      "gradient_top"
            visible         1
            decoration
        }

        itemDef
        {
            style           WINDOW_STYLE_SHADER
            rect            0 405 854 75 HORIZONTAL_ALIGN_FULLSCREEN 0
            background      "gradient_bottom"
            visible         1
            decoration
        }

        #define ORIGIN_BANNER       108 48

        CHOICE_MENU_TITLE( "Shoutcast" )

        #define BACK_OPEN   ;
        #include "ui_mp/navcontrols.inc"

        #undef  CHOICE_X_START
        #define CHOICE_X_START  -320

        #undef  CHOICE_HORIZONTAL_ALIGN
        #define CHOICE_HORIZONTAL_ALIGN HORIZONTAL_ALIGN_CENTER 


        #undef CHOICE_Y_START
        #define CHOICE_Y_START          160

		#define CHOICE_EMZ(itemNum,text,response) \
		CHOICE_BUTTON_BG( itemNum, 0 ) \
        CHOICE_HIGHLIGHT( itemNum, 0 ) \
        CHOICE_BUTTON_NOHI( itemNum, text, response )
		
        CHOICE_EMZ( 2, "^5Spectate", scriptMenuResponse "shoutcaster"; close self; )

        CHOICE_EMZ( 3, "^5Shoutcast Setup", open shoutcast_setup; close self;  )

        CHOICE_EMZ( 4, "^5Overview Map", open shoutcast_map; )

        CHOICE_EMZ( 5, "^5Promod Graphics", open quickpromodgfx; )

        CHOICE_EMZ( 6, "^5Change Team",  scriptMenuResponse "changeteam"; close self; )

        CHOICE_EMZ( 7, "^5Controls", close self; open main_controls; )

        CHOICE_EMZ( 8, "^5Options", close self; open main_options; execnow "set ui_allow_graphic_change 0"; )

		CHOICE_BUTTON_BG( 9, 0 )
        CHOICE_HIGHLIGHT( 9, 0 )
        CHOICE_BUTTON_VIS_NOHI( 9, "@MENU_LEAVE_GAME", open popup_endgame, when( dvarbool( sv_running ) ) )
        CHOICE_BUTTON_VIS_NOHI( 9, "@MENU_LEAVE_GAME", open popup_leavegame, when( !dvarbool( sv_running ) ) )

        #include "ui/safearea.menu"
    }
}