#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_SEP_OFFSET_Y		-2

//#define CHOICE_SEP_1			4
//#define CHOICE_SEP_2			5

#include "ui_mp/menustyle.inc"
#include "ui_mp/choices_setup_teams.menu"

{
	menuDef
	{
		name			"team_select"
		rect			0 0 640 480
		focuscolor		COLOR_FOCUSED
		style			WINDOW_STYLE_EMPTY
		blurWorld		7.0
		legacySplitScreenScale
		onEsc
		{
			scriptMenuResponse "back";
			//close "team_select";
		}
		onOpen
		{
			//focusFirst;
			//setfocus "auto_assign";
		}
		
		#ifndef PC
		execkeyint BUTTON_START
		{
			close self;
		}
		#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
		}
		
		// ------------------ TREE TITLE ------------------
		
		CHOICE_MENU_TITLE( "@MPUI_CHOOSE_TEAM" )
		
		// map display ================================================
		#include "ui_mp/tactical_map.inc";		
		
		// ------------------ buttons ---------------------
		#define BACK_OPEN;
		#include "ui_mp/navcontrols.inc"
		
		//=========================================================
		//===================== MENU SELECTION ====================
		//=========================================================
		#include "ui_mp/teamicon.inc"

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

		CHOICE_BUTTON_VIS( 1, "Auto Assign", play "mouse_click"; scriptMenuResponse "autoassign";, 1 )
		CHOICE_BUTTON_VIS( 2, "Spectator", play "mouse_click"; scriptMenuResponse "spectator";, 1 )
		CHOICE_BUTTON_VIS( 3, "Character setup", play "mouse_click"; scriptMenuResponse "character_menu";, 1 )
		CHOICE_SEPARATOR_VIS( 3, 1 )
		CHOICE_BUTTON_VIS( 4, "@MENU_CONTROLS", close self; open main_controls;, 1 )
		CHOICE_BUTTON_VIS( 5, "@MENU_OPTIONS", close self; open main_options; execnow "set ui_allow_graphic_change 0";, 1 )
		CHOICE_BUTTON_VIS( 6, "@MPUI_LEAVE_GAME", open popup_endgame, 1 )

	}
}