#include "ui/menudef.h"

#define CHOICE_SIZE_X			150
#define CHOICE_SIZE_Y			22

#define CHOICE_X_START			0
#define CHOICE_Y_START			34

#define CHOICE_SEP_OFFSET_Y		-2

#define CHOICE_GROUP			"xboxlive_lobby"


#include "ui_mp/menustyle.inc"
#include "ui/choices_setup_common.menu"
#include "ui_mp/stats_info.inc"

#define PLAYERLIST_WIDTH 		270
#define ORIGIN_PLAYERLIST 		(- (PLAYERLIST_WIDTH - RIGHTITEM_OFFSET)) 38
#define ORIGIN_STATUS			(- (PLAYERLIST_WIDTH - RIGHTITEM_OFFSET)) 0

#define ORIGIN_DESCRIPTION		(CHOICE_X_START + 15) 158
#define COLOR_DESC_TEXT			1 1 1 0.7

#define MENU_FONT_SIZE			TEXTSIZE_DEFAULT
#define HIGHLIGHT_SIZE			142 22
#define MENU_FONT_COLOR			1 1 1 0.5
#define MENU_FONT_COLOR2		1 1 1 0.5
#define MENU_LOCKED_COLOR		0.25 0.25 0.25 1

#define PC
//-------------------------------------

#define ORIGIN_BUTTON_BACK		52 438


#include "ui_mp/common_macro.inc"

{
	menuDef
	{
		name			"team_select"
		rect			0 0 640 480
		focuscolor		COLOR_FOCUSED
		style			WINDOW_STYLE_EMPTY
		blurWorld		7.0
		legacySplitScreenScale
		//soundloop 		"music_mainmenu_mp"
		onOpen
		{
			//STAT_UPDATE;
			//focusFirst;
			//exec "selectStringTableEntryInDvar mp/didyouknow.csv 0 didyouknow";
		}
		onClose
		{
		}
		onEsc
		{
			close self;
		}
		
		// ------------------  statics ------------------------
		#include "ui/blurredbg.inc"
		#include "ui_mp/sidepanels.inc"

		CHOICE_MENU_TITLE( "Settings" )
		// --------------------- lobby players count -----------------------
		itemDef	{
			type			ITEM_TYPE_TEXT
			rect			0 30 PLAYERLIST_WIDTH 0 RIGHTITEM_ALIGN VERTICAL_ALIGN_TOP
			origin			ORIGIN_PLAYERLIST
			forecolor		CHOICE_TEXTCOLOR
			dvar			"party_playerCount"
			textfont		UI_FONT_DEFAULT
			textscale		TEXTSIZE_SMALL
			textaligny		-6
			textalign		ITEM_ALIGN_RIGHT
			visible			1
			decoration
		}

		// --------- button ----------
		itemDef
		{
			rect			-140 -4 0 0 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_BOTTOM
			origin			0 0
			text			"Visit ^2www.brax.xaa.pl ^7- the official Death Run Mod website."
			textfont		UI_FONT_NORMAL
			textscale		TEXTSIZE_SMALL
			textalign		ITEM_ALIGN_BOTTOM_LEFT
			visible			1
			decoration
		}		
		#include "ui_mp/navcontrols.inc"

		// ----------------------------map images------------------------------------
		#include "ui_mp/game_info.inc"
		GAME_INFO( "loadscreen_" + dvarString (ui_map_name), dvarString( ui_map_name ), gametypename(), 1 )
		//GAME_INFO( dvarString(si_mapname) + , dvarString( si_mapname ), gametypename(), 1 )
		
		//=========================================================
		//===================== MENU SELECTION ====================
		//=========================================================

		#define CLEARUIHINT	exec "set ui_hint_text @NULL_EMPTY"

		#define SETUP_ACTION_AUTOASSIGN \				
				scriptMenuResponse "autoassign";
		#define SETUP_ACTION_SPECTATE \				
				scriptMenuResponse "spectator";


		CHOICE_BUTTON_FOCUS_VIS( 1, "@MENU_CONTROLS", close self; open main_controls;, exec "set ui_hint_text Change your controls.", CLEARUIHINT, when(1) )
		CHOICE_BUTTON_FOCUS_VIS( 2, "@MENU_OPTIONS", open popup_endgame, exec "set ui_hint_text Change your graphics and other settings.", CLEARUIHINT, when(1) )
		CHOICE_BUTTON_FOCUS_VIS( 3, "Go back", open popup_endgame, exec "set ui_hint_text Return to previous menu.", CLEARUIHINT, when(1) )
		
		// ---------------------- menu selection description -------------------------
		itemDef	{
			name			desc_arrow
			style			WINDOW_STYLE_SHADER
			rect			0 3 10 10 CHOICE_HORIZONTAL_ALIGN VERTICAL_ALIGN_TOP
			origin			ORIGIN_DESCRIPTION
			background		"ui_arrow_right"
			forecolor		1 1 1 0.25
			visible			1
			decoration
		}
		itemDef	{
			name			description_choice
			type			ITEM_TYPE_TEXT
			rect			12 0 210 36 CHOICE_HORIZONTAL_ALIGN VERTICAL_ALIGN_TOP
			origin			ORIGIN_DESCRIPTION
			exp				text( dvarString( ui_hint_text ) )
			textfont		UI_FONT_DEFAULT
			textscale		TEXTSIZE_SMALL
			textaligny		16
			forecolor		COLOR_DESC_TEXT
			visible			1
			autowrapped
			decoration
		}

		#include "ui/safearea.menu"
		#include "ui/popup_background.inc"
	}
}


	
