#include "ui/menudef.h"

{
	menuDef
	{
		name main_text
		fullscreen 1
		rect 0 0 640 480
		style 0
		border 0
		ownerdraw 0
		ownerdrawFlag 0
		borderSize 0
		foreColor 1 1 1 1
		backColor 0 0 0 0
		borderColor 0 0 0 0
		outlineColor 0 0 0 0
		soundLoop music_mainmenu_mp
		fadeCycle 1
		fadeClamp 1
		fadeAmount 0.1
		fadeInAmount 0
		blurWorld 0
		onOpen
		{
			exec "selectStringTableEntryInDvar mp/didyouknow.csv 0 didyouknow";
		}
		focusColor 1 1 1 1
		#define DO_THE_CHICKEN_WING
		#include "ui_mp/bg.inc"
		itemDef
		{
			rect 304 270 288 72
			style 3
			border 0
			ownerdraw 0
			ownerdrawFlag 0
			borderSize 0
			foreColor 1 1 1 1
			backColor 0 0 0 0
			borderColor 0 0 0 0
			outlineColor 0 0 0 0
			origin 0 0
			background logo_cod2
			decoration 
			type 0
			align 0
			textAlign 0
			textAlignX 0
			textAlignY 0
			textScale 0.55
			textStyle 0
			textFont 0
			feeder 0
			visible 0
		}

#define CHOICE_Y(i) ( 28 + ( i * 20 ) )
//half pixels are GREAT - well, they seem to work here
#define HR_ORIGIN(i) 0 ( CHOICE_Y(i) - 0.5 )
#define CHOICE_ORIGIN(i) -64 CHOICE_Y(i)
#define CHOICE_RECT(i) CHOICE_ORIGIN(i) 336 20 1 1
#define HR_RECT(i) HR_ORIGIN(i) 216 1 1 1

#define MENU_CHOICE_BUTTON_VIS( itemIndex, buttonName, textArg, actionArg, visArg) \
		itemDef \
		{ \
			name buttonName \
			rect CHOICE_RECT(itemIndex) \
			foreColor 1 1 1 1 \
			backColor 0 0 0 0 \
			style 1 \
			origin 0 0 \
			background menu_button_selection_bar \
			group mw2_button \
			type 1 \
			textAlign 6 \
			textAlignX -60 \
			textScale 0.375 \
			textFont 3 \
			text textArg \
			onFocus \
			{ \
				play mouse_over; \
				setItemColor self backcolor 0 0 0 1; \
				setLocalVarBool ui_menuAButton 1; \
				setLocalVarFloat ui_popupYPos 0.000000; \
			} \
			leaveFocus \
			{ \
				setItemColor self backcolor 0 0 0 0.0; \
				setLocalVarBool ui_menuAButton 1; \
			} \
			action \
			{ \
				play mouse_click; \
				actionArg \
			} \
			visible visArg \
		}
#define HORIZONTAL_LINE(itemIndex) \
	itemDef \
		{ \
			rect HR_RECT(itemIndex) \
			style 3 \
			border 0 \
			ownerdraw 0 \
			ownerdrawFlag 0 \
			borderSize 0 \
			foreColor 1 1 1 0.65 \
			backColor 0 0 0 0 \
			borderColor 0 0 0 0 \
			outlineColor 0 0 0 0 \
			background gradient_fadein \
			decoration \
			type 0 \
			align 0 \
			textAlign 0 \
			textAlignX 0 \
			textAlignY 0 \
			textScale 0.55 \
			textStyle 0 \
			textFont 0 \
			feeder 0 \
			visible 1 \
		} \

		MENU_CHOICE_BUTTON_VIS(0, button_1, "SERVER BROWSER", open pc_join_unranked;, 1)
		MENU_CHOICE_BUTTON_VIS(1, button_2, "@MENU_PRIVATE_MATCH_CAPS",
                    
					exec "xrequirelivesignin";
					setdvar "systemlink" 0;
					setdvar "splitscreen" 0;
					setdvar "onlinegame" 1;
					exec "exec default_xboxlive.cfg";
					exec "party_maxplayers 18";
					exec "xblive_privatematch 0";
					exec "xblive_rankedmatch 0";
					exec "xstartprivateparty";
					setdvar ui_mptype 0;
                    exec "xcheckezpatch";
                    exec "exec default_xboxlive.cfg"
                    exec "exec xblive_rankedmatch 0";
                    exec "ui_enumeratesaved";
                    exec "xblive_privatematch 1";
                    exec "xstartprivatematch";
                    open menu_xboxlive_privatelobby;
                     , 1)
		HORIZONTAL_LINE(2)
		MENU_CHOICE_BUTTON_VIS(2, button_3, "@MENU_CREATE_A_CLASS_CAPS", open cac_popup;, 1)
		MENU_CHOICE_BUTTON_VIS(3, button_4, "@MENU_PLAYERCARD_CAPS", open popup_callsign;, 1)
		HORIZONTAL_LINE(4)
		MENU_CHOICE_BUTTON_VIS(4, button_5, "MODS", open mods_menu;, 1)
		MENU_CHOICE_BUTTON_VIS(5, button_6, "OPTIONS", open pc_options_video;, 1)
		HORIZONTAL_LINE(6)
		MENU_CHOICE_BUTTON_VIS(6, button_7, "DLC STORE", exec "openStore";, 1)
		MENU_CHOICE_BUTTON_VIS(7, button_8, "QUIT", open quit_popmenu;, 1)

		itemDef
		{
			name		"ticker_bg"
			style		WINDOW_STYLE_FILLED
			visible		1
			rect		-107 0 900 16 1 3
			backcolor	0 0 0 0.5
			decoration
		}

		itemDef
		{
			name		"ticker"
			type		ITEM_TYPE_NEWSTICKER
			style		WINDOW_STYLE_FILLED
			visible		1
			rect		-107 0 900 16 1 3
			forecolor	1 1 1 1
			backcolor	0 0 0 0.7
			textfont	3
			textscale	.26
			textaligny	16.5
			text		"mimimimimimimimi"
			background	shadow_inset
			speed		20
			decoration
		}
		itemDef
		{
			rect 0 0 208 70 3 1
			style 3
			border 0
			ownerdraw 0
			ownerdrawFlag 0
			borderSize 0
			foreColor 0 0 0 0.25
			backColor 0 0 0 0
			borderColor 0 0 0 0
			outlineColor 0 0 0 0
			background white
			decoration 
			type 0
			align 0
			textAlign 0
			textAlignX 0
			textAlignY 0
			textScale 0.55
			textStyle 0
			textFont 0
			feeder 0
			visible 1
			visible when ( 1 && ( getplayercardinfo( 0 , 1 , 0 ) != 0 )  )
			exp rect x ( ( -208 )  )
			exp rect y ( ( 18 )  )
		}
		itemDef
		{
			rect 0 0 208 70 3 1
			style 1
			border 0
			ownerdraw 0
			ownerdrawFlag 0
			borderSize 0
			foreColor 1 1 1 1
			backColor 1 1 1 1
			borderColor 0 0 0 0
			outlineColor 0 0 0 0
			background cardtitle_248x48
			decoration 
			type 0
			align 0
			textAlign 4
			textAlignX 0
			textAlignY -20
			textScale 0.375
			textStyle 7
			textFont 6
			feeder 0
			visible 1
			visible when ( 1 && ( getplayercardinfo( 0 , 1 , 0 ) != 0 )  )
			exp rect x ( ( - 208 )  )
			exp rect y ( ( 18 )  )
		}
		itemDef
		{
			rect 0 0 160 32 3 1
			style 1
			border 0
			ownerdraw 0
			ownerdrawFlag 0
			borderSize 0
			foreColor 1 1 1 1
			backColor 1 1 1 1
			borderColor 0 0 0 0
			outlineColor 0 0 0 0
			decoration 
			type 0
			align 0
			textAlign 9
			textAlignX 0
			textAlignY 0
			textScale 0.375
			textStyle 8
			textFont 3
			feeder 0
			visible 1
			exp text ( "@" + tablelookupbyrow( "mp/cardTitleTable.csv" , getplayercardinfo( 1 , 1 , 0 ) , 1 )  )
			exp material ( tablelookupbyrow( "mp/cardTitleTable.csv" , getplayercardinfo( 1 , 1 , 0 ) , 2 )  )
			visible when ( 1 && ( getplayercardinfo( 0 , 1 , 0 ) != 0 )  )
			exp rect x ( - 208  )
			exp rect y ( 18 - 2  )
			exp forecolor r ( tablelookupbyrow( "mp/cardTitleTable.csv" , getplayercardinfo( 1 , 1 , 0 ) , 3 )  )
			exp forecolor g ( tablelookupbyrow( "mp/cardTitleTable.csv" , getplayercardinfo( 1 , 1 , 0 ) , 4 )  )
			exp forecolor b ( tablelookupbyrow( "mp/cardTitleTable.csv" , getplayercardinfo( 1 , 1 , 0 ) , 5 )  )
		}
		itemDef
		{
			rect 0 0 160 18 3 1
			style 0
			border 0
			ownerdraw 0
			ownerdrawFlag 0
			borderSize 0
			foreColor 1 1 1 1
			backColor 0 0 0 0
			borderColor 0 0 0 0
			outlineColor 0 0 0 0
			decoration 
			type 0
			align 0
			textAlign 4
			textAlignX 8
			textAlignY 0
			textScale 0.3333
			textStyle 8
			textFont 10
			feeder 0
			visible 1
			exp text ( getplayercardinfo( 8 , 1 , 0 )  )
			visible when ( 1 && ( getplayercardinfo( 0 , 1 , 0 ) != 0 )  )
			exp rect x ( - 208  )
			exp rect y ( ( 18 ) + 28  )
		}
		itemDef
		{
			rect 0 0 48 48 3 1
			style 3
			border 0
			ownerdraw 0
			ownerdrawFlag 0
			borderSize 0
			foreColor 1 1 1 1
			backColor 0 0 0 0
			borderColor 0 0 0 0
			outlineColor 0 0 0 0
			decoration 
			type 0
			align 0
			textAlign 0
			textAlignX 0
			textAlignY 0
			textScale 0.55
			textStyle 0
			textFont 0
			feeder 0
			visible 1
			exp material ( tablelookupbyrow( "mp/cardIconTable.csv" , getplayercardinfo( 2 , 1 , 0 ) , 1 )  )
			visible when ( 1 && ( getplayercardinfo( 0 , 1 , 0 ) != 0 )  )
			exp rect x ( ( - 208 ) + 160  )
			exp rect y ( ( 18 )  )
		}
		itemDef
		{
			rect 0 0 208 20 3 1
			style 1
			border 0
			ownerdraw 0
			ownerdrawFlag 0
			borderSize 0
			foreColor 1 1 1 1
			backColor 0 0 0 0
			borderColor 0 0 0 0
			outlineColor 0 0 0 0
			decoration 
			type 0
			align 0
			textAlign 8
			textAlignX 8
			textAlignY 0
			textScale 0.375
			textStyle 7
			textFont 3
			feeder 0
			visible 1
			exp text ( "[" + getplayercardinfo( 9 , 1 , 0 ) + "]"  )
			visible when ( 1 && ( getplayercardinfo( 0 , 1 , 0 ) != 0 ) && getplayercardinfo( 9 , 1 , 0 ) != ""  )
			exp rect x ( ( - 208 )  )
			exp rect y ( ( 18 ) + 48  )
		}
		itemDef
		{
			rect 0 20 272 28 1 1
			style 0
			border 0
			ownerdraw 0
			ownerdrawFlag 0
			borderSize 0
			foreColor 1 1 1 1
			backColor 0 0 0 0
			borderColor 0 0 0 0
			outlineColor 0 0 0 0
			decoration 
			type 0
			align 0
			textAlign 6
			textAlignX -59
			textAlignY -20
			textScale 0.5
			textStyle 0
			textFont 9
			feeder 0
			text "MULTIPLAYER"
			visible 1
		}
		itemDef
		{
			rect 0 0 20 20 3 1
			style 1
			border 0
			ownerdraw 0
			ownerdrawFlag 0
			borderSize 0
			foreColor 1 1 1 1
			backColor 1 1 1 1
			borderColor 0 0 0 0
			outlineColor 0 0 0 0
			decoration 
			type 0
			align 0
			textAlign 0
			textAlignX 0
			textAlignY 0
			textScale 0.55
			textStyle 0
			textFont 0
			feeder 0
			visible 1
			exp material ( tablelookup( "mp/rankIconTable.csv" , 0 , getplayercardinfo( 4 , 1 , 0 ) , ( getplayercardinfo( 5 , 1 , 0 ) + 1 ) )  )
			visible when ( 1 && ( getplayercardinfo( 0 , 1 , 0 ) != 0 ) && ( getplayercardinfo( 4 , 1 , 0 ) >= 0 )  )
			exp rect x ( ( - 208 ) + 164  )
			exp rect y ( ( 18 ) + 48  )
		}
		itemDef
		{
			rect 0 0 20 20 3 1
			style 0
			border 0
			ownerdraw 0
			ownerdrawFlag 0
			borderSize 0
			foreColor 1 1 1 1
			backColor 0 0 0 0
			borderColor 0 0 0 0
			outlineColor 0 0 0 0
			decoration 
			type 0
			align 0
			textAlign 9
			textAlignX 20
			textAlignY 0
			textScale 0.375
			textStyle 7
			textFont 3
			feeder 0
			visible 1
			exp text ( tablelookup( "mp/rankTable.csv" , 0 , getplayercardinfo( 4 , 1 , 0 ) , 14 )  )
			visible when ( 1 && ( getplayercardinfo( 0 , 1 , 0 ) != 0 ) && ( getplayercardinfo( 4 , 1 , 0 ) >= 0 )  )
			exp rect x ( ( - 208 ) + 164  )
			exp rect y ( ( 18 ) + 48  )
		}
	}
}
