#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			204 //180

#define CHOICE_GROUP			"class"
#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			"class"
		rect			0 0 640 480
		focuscolor		COLOR_FOCUSED
		style			WINDOW_STYLE_EMPTY
		blurWorld		7.0
		onOpen
		{
			focusFirst;
		}
		onEsc 
		{
			scriptMenuResponse "back";
		}
		
		#ifndef PC
		execkeyint BUTTON_START
		{
			scriptMenuResponse "back";
		}
		#endif
		
		// background overlay
		itemDef
		{
			style			WINDOW_STYLE_FILLED
			rect			0 0 640 480 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN
			backcolor		0 0 0 0.75 //0 0.05 0.15 0.5
			visible			1
			decoration
		}

		// gradient_top
		itemDef
		{
			style			WINDOW_STYLE_SHADER
			rect			0 0 854 75 HORIZONTAL_ALIGN_FULLSCREEN 0
			background		"gradient_top"
			visible			1
			decoration
		}

		// gradient_bottom
		itemDef
		{
			style			WINDOW_STYLE_SHADER
			rect			0 405 854 75 HORIZONTAL_ALIGN_FULLSCREEN 0
			background		"gradient_bottom"
			visible			1
			decoration
		}
		
		// map display ================================================
		#include "ui_mp/tactical_map.inc";
		#define ORIGIN_BANNER		108 48

		itemDef	{
			style			WINDOW_STYLE_SHADER
			rect			ORIGIN_BANNER 400 0.5
			background		"line_horizontal"
			forecolor		1 1 1 0.85
			visible			1	decoration	}
		itemDef	{
			style			WINDOW_STYLE_SHADER
			rect			ORIGIN_BANNER 340 10
			origin			30 1
			background		"line_horizontal"
			forecolor		OBJECTIVE_COLOR_MARINES
			visible			1
			decoration	}
		itemDef	{
			style			WINDOW_STYLE_SHADER
			rect			ORIGIN_BANNER 400 0.5
			origin			0 12
			background		"line_horizontal"
			forecolor		1 1 1 0.85
			visible			1	decoration	}
			
		itemDef	{
			rect			-400 64 800 0 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_TOP
			textstyle		ITEM_TEXTSTYLE_SHADOWED
			textscale		TEXTSIZE_TITLE
			textalign		ITEM_ALIGN_CENTER
			forecolor		1 1 1 0.85
			exp text ( gametypename() );
			visible			1	decoration	}
		itemDef	{
			rect			-250 84 500 60 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_TOP
			textstyle		ITEM_TEXTSTYLE_SHADOWED
			textscale		TEXTSIZE_SMALL
			textalign		ITEM_ALIGN_CENTER
			forecolor		1 1 1 0.75
			exp text( gametypedescription() );
			autowrapped
			visible			1	decoration	}
		
		// ------------------ TREE TITLE ------------------
		
		CHOICE_MENU_TITLE( "^1.|BLOODY KILLERS|." )
		
		// ------------------ buttons ---------------------
		#define BACK_OPEN	;
		#include "ui_mp/navcontrols.inc"

		//=========================================================
		//===================== MENU SELECTION ====================
		//=========================================================
		#include "ui_mp/teamicon.inc"

		// PC widescreen fix
		#undef  CHOICE_X_START
		#define CHOICE_X_START	-320
		
		#undef	CHOICE_HORIZONTAL_ALIGN
		#define CHOICE_HORIZONTAL_ALIGN HORIZONTAL_ALIGN_CENTER

		CHOICE_HIGHLIGHT( 1, 1 )
		CHOICE_BUTTON_VIS_NOHI( 1, "Choose Class", close self; open changeclass_opfor_mw; , when( TEAM_IS_OPFOR ) )
		CHOICE_BUTTON_VIS_NOHI( 1, "Choose Class", close self; open changeclass_marines_mw; , when( TEAM_IS_MARINES ) )

		CHOICE_HIGHLIGHT( 2, 1 )
		CHOICE_BUTTON_VIS_NOHI( 2, "Change Team", scriptmenuresponse "changeteam";, 1 )

		CHOICE_HIGHLIGHT( 3, 1 )
		CHOICE_BUTTON_VIS_NOHI( 3, "Controls", close self; open main_controls,1  )

		CHOICE_HIGHLIGHT( 4, 1 )
		CHOICE_BUTTON_VIS_NOHI( 4, "Options", close self; open main_options;,1  )

		CHOICE_HIGHLIGHT( 5, when( dvarbool( ui_allowvote ) ); )
		CHOICE_BUTTON_VIS_NOHI( 5, "Call Vote", open callvote; close self;, when( dvarbool( ui_allowvote ) ); )
		CHOICE_DBUTTON_VIS_NOHI( 5, "Call Vote", when( !dvarbool( ui_allowvote ) ); )

		CHOICE_HIGHLIGHT( 6, 1 )
		CHOICE_BUTTON_VIS_NOHI( 6, "Mute Players", open muteplayer; close self;,1  )

		CHOICE_HIGHLIGHT( 7, 1 )
		CHOICE_BUTTON_VIS_NOHI( 7, "Leave Game", open popup_endgame, when( dvarbool( sv_running ) ) )
		CHOICE_BUTTON_VIS_NOHI( 7, "Leave Game", open popup_leavegame, when( !dvarbool( sv_running ) ) )

		#include "ui/safearea.menu"
	}
}


