#define PLAYERSTATS_WIDTH 		270

#ifdef PC
	#define PLAYERSTATS_X			((-(PLAYERSTATS_WIDTH - RIGHTITEM_OFFSET))-80)
	#define PLAYERSTATS_Y			38
	#define FRAME_BG_COLOR			0.175 0.175 0.2 0.55
#else
	#define PLAYERSTATS_X			(-(PLAYERSTATS_WIDTH - RIGHTITEM_OFFSET))
	#define PLAYERSTATS_Y			38
	#define FRAME_BG_COLOR			1 1 1 0
#endif	

#define ORIGIN_PLAYERSTATS 		PLAYERSTATS_X PLAYERSTATS_Y
	
#define LABEL_ITEM_SPACING		18
#define SUB_LABEL_INDENT		16
	
#define LABEL_START_X			12
#define LABEL_START_Y			LABEL_ITEM_SPACING
#define ORIGIN_LABEL			LABEL_START_X LABEL_START_Y

#define LABEL_TEXTCOLOR			1 1 1 0.75
#define LABEL_TITLECOLOR		1 0.85 0.5 0.8

#define ORIGIN_LABEL_ITEM( itemNumber ) \
		LABEL_START_X (LABEL_START_Y+(LABEL_ITEM_SPACING*(itemNumber-1))) 

#define ORIGIN_SUB_LABEL_ITEM( itemNumber ) \
		(LABEL_START_X+SUB_LABEL_INDENT) (LABEL_START_Y+(LABEL_ITEM_SPACING*(itemNumber-1))) 
		
#define ORIGIN_DIVIDER( itemNumber ) \
		0 (LABEL_START_Y+(LABEL_ITEM_SPACING/2)+(LABEL_ITEM_SPACING*(itemNumber-1))) 

#define PREPROC_LABEL( ptext, itemNumber ) \
itemDef { \
	text			ptext \
	rect			ORIGIN_LABEL_ITEM( itemNumber ) (PLAYERSTATS_WIDTH) LABEL_ITEM_SPACING RIGHTITEM_ALIGN VERTICAL_ALIGN_TOP \
	origin			ORIGIN_PLAYERSTATS \
	textfont		UI_FONT_NORMAL \
	textstyle 		ITEM_TEXTSTYLE_SHADOWED \
	textscale		TEXTSIZE_SMALL \
	textalign		ITEM_ALIGN_MIDDLE_LEFT \
	forecolor		LABEL_TITLECOLOR \
	visible			1 \
	decoration }

#define PREPROC_LABEL_TIME( ptext, itemNumber ) \
itemDef { \
	text			ptext \
	rect			ORIGIN_LABEL_ITEM( itemNumber ) (PLAYERSTATS_WIDTH) LABEL_ITEM_SPACING RIGHTITEM_ALIGN VERTICAL_ALIGN_TOP \
	origin			ORIGIN_PLAYERSTATS \
	textfont		UI_FONT_NORMAL \
	textstyle 		ITEM_TEXTSTYLE_SHADOWED \
	textscale		0.25 \
	textalignx		-32 \
	textalign		ITEM_ALIGN_MIDDLE_RIGHT \
	forecolor		0.6 0.6 0.6 1 \
	visible			1 \
	decoration }
	
#define PREPROC_DIVIDER( itemNumber ) \
	PREPROC_SHADER_DRAW_ALIGNED( ORIGIN_DIVIDER( itemNumber ) (PLAYERSTATS_WIDTH) 1 RIGHTITEM_ALIGN VERTICAL_ALIGN_TOP, ORIGIN_PLAYERSTATS, "white", 1 1 1 0.1, 0, 0, 0 0 0 0 )

#define PREPROC_SUB_LABEL( ptext, itemNumber ) \
	PREPROC_SUB_LABEL_VIS( ptext, itemNumber, 1 )
	
#define PREPROC_SUB_LABEL_VIS( ptext, itemNumber, visArg ) \
itemDef { \
	text			ptext \
	rect			ORIGIN_SUB_LABEL_ITEM( itemNumber ) (PLAYERSTATS_WIDTH) LABEL_ITEM_SPACING RIGHTITEM_ALIGN VERTICAL_ALIGN_TOP \
	origin			ORIGIN_PLAYERSTATS \
	textfont		UI_FONT_NORMAL \ 
	textstyle 		ITEM_TEXTSTYLE_SHADOWED \
	textscale		TEXTSIZE_SMALL \
	textalign		ITEM_ALIGN_MIDDLE_LEFT \
	forecolor		LABEL_TEXTCOLOR \
	visible			visArg \
	decoration }
	
#define PREPROC_VALUE_TEXT( ptext, itemNumber, px_offset, pcolor ) \
		PREPROC_VALUE_TEXT_VIS( ptext, itemNumber, px_offset, pcolor, 1, ITEM_ALIGN_MIDDLE_RIGHT )

#define PREPROC_VALUE_TEXT_LEFT_ALIGNED( ptext, itemNumber, px_offset, pcolor ) \
		PREPROC_VALUE_TEXT_VIS( ptext, itemNumber, px_offset, pcolor, 1, ITEM_ALIGN_MIDDLE_LEFT )
		
#define PREPROC_VALUE_TEXT_VIS( ptext, itemNumber, px_offset, pcolor, visArg, alignment ) \
itemDef { \
	text			ptext; \
	type			ITEM_TYPE_TEXT \
	rect			ORIGIN_LABEL_ITEM( itemNumber ) (PLAYERSTATS_WIDTH) LABEL_ITEM_SPACING RIGHTITEM_ALIGN VERTICAL_ALIGN_TOP \
	textstyle 		ITEM_TEXTSTYLE_SHADOWED \
	origin			ORIGIN_PLAYERSTATS \
	textfont		UI_FONT_NORMAL \ 
	textalignx		px_offset \
	textscale		TEXTSIZE_SMALL \
	forecolor		pcolor \
	textalign		alignment \
	visible			visArg \
	decoration }

	itemDef
	{
		type			ITEM_TYPE_TEXT
		rect			0 352 0 0 RIGHTITEM_ALIGN VERTICAL_ALIGN_TOP
		origin			ORIGIN_PLAYERSTATS
		text			"@IW3SP_MOD_LOC_MENU_STATS_TITLE" //@MENU_PARTY PARTY_LABEL
		align			ITEM_ALIGN_LEFT
		textstyle		ITEM_TEXTSTYLE_SHADOWED
		textfont		UI_FONT_DEFAULT
		textscale		1.75 //PARTY_LABEL_SCALE
		forecolor		1 0.925 0.7 0.07 //PARTY_LABEL_COLOR
		visible 		1
		decoration
	}

	// UI art
	PREPROC_SHADER_DRAW_ALIGNED( -4 12 (PLAYERSTATS_WIDTH+8) 326 RIGHTITEM_ALIGN VERTICAL_ALIGN_TOP, ORIGIN_PLAYERSTATS, "white", FRAME_BG_COLOR, 0, 0, 0 0 0 0 )
	PREPROC_SHADER_DRAW_ALIGNED( -4 12 (PLAYERSTATS_WIDTH+8) 326 RIGHTITEM_ALIGN VERTICAL_ALIGN_TOP, ORIGIN_PLAYERSTATS, "gradient_center", 0.3 0.3 0.325 0.8, 0, 0, 0 0 0 0 )

#ifdef PC
	#define FRAME_HEIGHT	358
#else
	#define FRAME_HEIGHT	342
#endif

	PREPROC_SHADER_DRAW_ALIGNED( -24 -4 -20 FRAME_HEIGHT RIGHTITEM_ALIGN VERTICAL_ALIGN_TOP, ORIGIN_PLAYERSTATS, "gradient", 1 1 1 0.65, 0, 0, 0 0 0 0 )

	PREPROC_SHADER_DRAW_ALIGNED( (PLAYERSTATS_WIDTH+4) -4 20 358 RIGHTITEM_ALIGN VERTICAL_ALIGN_TOP, ORIGIN_PLAYERSTATS, "gradient", 1 1 1 0.65, 0, 0, 0 0 0 0 )
	
	PREPROC_SHADER_DRAW_ALIGNED( -4 -4 (PLAYERSTATS_WIDTH+8) 16 RIGHTITEM_ALIGN VERTICAL_ALIGN_TOP, ORIGIN_PLAYERSTATS, "white", 0.2 0.2 0.225 1, 0, 0, 0 0 0 0 )
	PREPROC_SHADER_DRAW_ALIGNED( -4 -4 (PLAYERSTATS_WIDTH+8) 16 RIGHTITEM_ALIGN VERTICAL_ALIGN_TOP, ORIGIN_PLAYERSTATS, "line_horizontal", 0.9 0.9 0.95 0.5, 0, 0, 0 0 0 0 )
	PREPROC_SHADER_DRAW_ALIGNED( -4 12 (PLAYERSTATS_WIDTH+8) 16 RIGHTITEM_ALIGN VERTICAL_ALIGN_TOP, ORIGIN_PLAYERSTATS, "gradient_top", 1 1 1 0.2, 0, 0, 0 0 0 0 )

	PREPROC_SHADER_DRAW_ALIGNED( -4 338 (PLAYERSTATS_WIDTH+8) 16 RIGHTITEM_ALIGN VERTICAL_ALIGN_TOP, ORIGIN_PLAYERSTATS, "white", 0.2 0.2 0.225 1, 0, 0, 0 0 0 0 )
	PREPROC_SHADER_DRAW_ALIGNED( -4 338 (PLAYERSTATS_WIDTH+8) 16 RIGHTITEM_ALIGN VERTICAL_ALIGN_TOP, ORIGIN_PLAYERSTATS, "line_horizontal", 0.9 0.9 0.95 0.5, 0, 0, 0 0 0 0 )
	PREPROC_SHADER_DRAW_ALIGNED( -4 322 (PLAYERSTATS_WIDTH+8) 16 RIGHTITEM_ALIGN VERTICAL_ALIGN_TOP, ORIGIN_PLAYERSTATS, "gradient_bottom", 1 1 1 0.2, 0, 0, 0 0 0 0 )

	itemDef 
	{
		rect			0 -7 270 20 RIGHTITEM_ALIGN VERTICAL_ALIGN_TOP
		origin			ORIGIN_PLAYERSTATS
		textfont		UI_FONT_NORMAL
		textstyle 		ITEM_TEXTSTYLE_SHADOWED
		textscale		TEXTSIZE_SMALL
		textalign		ITEM_ALIGN_MIDDLE_CENTER
		exp				text( dvarString( name ) );
		visible			1
		decoration 
	}

	//kills
	PREPROC_LABEL("@IW3SP_MOD_LOC_MENU_CAREER_KILLS", 1)
	PREPROC_VALUE_TEXT( 228, 1, -24, LABEL_TITLECOLOR )

	//headshots
	PREPROC_SUB_LABEL( "@IW3SP_MOD_LOC_MENU_CAREER_HEADSHOTS", 2 )
	PREPROC_VALUE_TEXT( 228, 2, -24, LABEL_TEXTCOLOR )

	//deaths
	PREPROC_LABEL("@IW3SP_MOD_LOC_MENU_CAREER_DEATHS", 3)
	PREPROC_VALUE_TEXT( 228, 3, -24, LABEL_TITLECOLOR )

	PREPROC_DIVIDER( 4 )	

	//play time (add as the last element in player info)
	PREPROC_LABEL("@IW3SP_MOD_LOC_MENU_CAREER_PLAYTIMESP", 5)
	PREPROC_VALUE_TEXT( "0:00:00:00", 5, -24, LABEL_TITLECOLOR )
	PREPROC_LABEL_TIME("@IW3SP_MOD_LOC_MENU_SP_STAT_TIME_FORMAT", 4.4)

	PREPROC_DIVIDER( 6 )

	//for sliders
	//145(18) - 185 (40) - 8
	//163(18) - 203 (40) - 9
	//181(18) - 221 (40) - 10
	//199(18) - 239 (40) - 11
	//217(18) - 279 (40) - 12
	//235(18) - 319 (40) - 13
	//253(18) - 359 (40) - 14
	//271(18) - 399 (40) - 15
	//289(18) - 439 (40) - 16
	//307(18) - 479 (40) - 17

	PREPROC_LABEL("Campaign Progress", 7)

	PREPROC_SUB_LABEL( "Recruit Progress:", 8 )
	PREPROC_SHADER_DRAW_ALIGNED_VIS( 200 145 60 14 RIGHTITEM_ALIGN VERTICAL_ALIGN_TOP, ORIGIN_PLAYERSTATS, "white", 0.1 0.1 0.1 0.35, 1, 1, 1 1 1 0.2,  1 )
	PREPROC_SHADER_DRAW_ADV_VIS( (PLAYERSTATS_X+202), /*167*/(PLAYERSTATS_Y+147), 50, 12, "gradient_fadein", 1 0.9 0.5 0.6, 0, 1, 1 1 1 1 rect 0 0 0 0  RIGHTITEM_ALIGN VERTICAL_ALIGN_TOP, 1 )

	PREPROC_SUB_LABEL( "Regular Progress:", 9 )
	PREPROC_SHADER_DRAW_ALIGNED_VIS( 200 163 60 14 RIGHTITEM_ALIGN VERTICAL_ALIGN_TOP, ORIGIN_PLAYERSTATS, "white", 0.1 0.1 0.1 0.35, 1, 1, 1 1 1 0.2,  1 )
	PREPROC_SHADER_DRAW_ADV_VIS( (PLAYERSTATS_X+202), /*167*/(PLAYERSTATS_Y+165), 50, 12, "gradient_fadein", 1 0.9 0.5 0.6, 0, 1, 1 1 1 1 rect 0 0 0 0  RIGHTITEM_ALIGN VERTICAL_ALIGN_TOP, 1 )

	PREPROC_SUB_LABEL( "Hardened Progress:", 10 )
	PREPROC_SHADER_DRAW_ALIGNED_VIS( 200 181 60 14 RIGHTITEM_ALIGN VERTICAL_ALIGN_TOP, ORIGIN_PLAYERSTATS, "white", 0.1 0.1 0.1 0.35, 1, 1, 1 1 1 0.2,  1 )
	PREPROC_SHADER_DRAW_ADV_VIS( (PLAYERSTATS_X+202), /*167*/(PLAYERSTATS_Y+183), 50, 12, "gradient_fadein", 1 0.9 0.5 0.6, 0, 1, 1 1 1 1 rect 0 0 0 0  RIGHTITEM_ALIGN VERTICAL_ALIGN_TOP, 1 )

	PREPROC_SUB_LABEL( "Veteran Progress:", 11 )
	PREPROC_SHADER_DRAW_ALIGNED_VIS( 200 199 60 14 RIGHTITEM_ALIGN VERTICAL_ALIGN_TOP, ORIGIN_PLAYERSTATS, "white", 0.1 0.1 0.1 0.35, 1, 1, 1 1 1 0.2,  1 )
	PREPROC_SHADER_DRAW_ADV_VIS( (PLAYERSTATS_X+202), /*167*/(PLAYERSTATS_Y+201), 50, 12, "gradient_fadein", 1 0.9 0.5 0.6, 0, 1, 1 1 1 1 rect 0 0 0 0  RIGHTITEM_ALIGN VERTICAL_ALIGN_TOP, 1 )

	PREPROC_DIVIDER( 12 )

	PREPROC_LABEL("Intel Items", 13)
	PREPROC_VALUE_TEXT( 17, 13, -24, LABEL_TITLECOLOR )
	PREPROC_LABEL("Achievement Unlocked", 14)
	PREPROC_VALUE_TEXT( 35, 14, -24, LABEL_TITLECOLOR )

	PREPROC_DIVIDER( 15 )

	PREPROC_SUB_LABEL( "Campaign Progress:", 16 )
	PREPROC_SHADER_DRAW_ALIGNED_VIS( 200 289 60 14 RIGHTITEM_ALIGN VERTICAL_ALIGN_TOP, ORIGIN_PLAYERSTATS, "white", 0.1 0.1 0.1 0.35, 1, 1, 1 1 1 0.2,  1 )
	PREPROC_SHADER_DRAW_ADV_VIS( (PLAYERSTATS_X+202), /*167*/(PLAYERSTATS_Y+291), 50, 12, "gradient_fadein", 1 0.9 0.5 0.6, 0, 1, 1 1 1 1 rect 0 0 0 0  RIGHTITEM_ALIGN VERTICAL_ALIGN_TOP, 1 )	
