#include "ui/menudef.h"
#include "ui_mp/common_macro.inc"

#define CHOICE_X_START			0
#define CHOICE_Y_START			150

#define CHOICE_GROUP			"quit_game"
#define CHOICE_SEP_1			3
#define CHOICE_SEP_2			5

#define STYLE_PC	1
#include "ui_mp/menustyle.inc"
#include "ui/choices_setup_common.menu"

#include "ui_mp/popupstyle.inc"	
#include "ui/choices_setup_popmenu.menu"
	
#undef CHOICE_SIZE_X
#define CHOICE_SIZE_X	325

#undef CHOICE_HORIZONTAL_ALIGN
#define CHOICE_HORIZONTAL_ALIGN	HORIZONTAL_ALIGN_CENTER
#undef CHOICE_VERTICAL_ALIGN
#define CHOICE_VERTICAL_ALIGN	VERTICAL_ALIGN_CENTER
#undef CHOICE_TEXTSIZE
#define CHOICE_TEXTSIZE			TEXTSIZE_SMALL

#define CHOC_DV( itemIndex, dvarArg, actionArg, visArg ) \
itemDef \
{ \
	style			WINDOW_STYLE_FILLED \
	rect			1 (CHOICE_Y( itemIndex )+10) (CHOICE_SIZE_X+2) CHOICE_SIZE_Y CHOICE_HORIZONTAL_ALIGN CHOICE_VERTICAL_ALIGN \
	forecolor		1 1 1 1 \
	backcolor		0.1 0.1 0.1 0.5 \
	text			"Demo Name:" \
	textscale		CHOICE_TEXTSIZE \
	textalign		ITEM_ALIGN_MIDDLE_LEFT \
	textstyle		ITEM_TEXTSTYLE_SHADOWED \
	visible			visArg \
	decoration \
} \
itemDef \
{ \
	name 			"demo" \
	type			ITEM_TYPE_EDITFIELD \
	text			" " \
	dvar			dvarArg \
	rect			-265 (CHOICE_Y( itemIndex )+10) (CHOICE_SIZE_X+120) CHOICE_SIZE_Y CHOICE_HORIZONTAL_ALIGN CHOICE_VERTICAL_ALIGN \
	textalign		ITEM_ALIGN_MIDDLE_LEFT \
	textalignx		(CHOICE_SIZE_X+8) /*(-(CHOICE_TEXT_OFFSET_X))*/ \
	textscale		CHOICE_TEXTSIZE \
	textstyle		ITEM_TEXTSTYLE_SHADOWED \
	style			WINDOW_STYLE_FILLED \
	forecolor		1 1 1 1 \
	visible			visArg \
	CHOICE_SCRIPTS_ACTION( itemIndex, actionArg ) \
} 

{
	menuDef 
	{
		#undef CENTER_POPUP_ON_CLOSE
		#define CENTER_POPUP_ON_CLOSE play "mouse_click"; scriptMenuResponse "demo";

		CENTER_POPUP_SETUP_ONOPEN( demo, 6, ;, setLocalVarBool ui_centerPopup 1;setDvar ui_demo "record ";setfocus "demo";, 1 )
		CHOICE_POPMENU_TITLE( "Record Demo" )
		CHOICE_CAPTION_VIS( 2,"Note: Don't remove 'record' in front of the demo name", 1)
		CHOC_DV(3, ui_demo, ;, 1)
		CHOICE_BUTTON( 5, "Start Recording", play "mouse_click" ; exec "stoprecord" ; exec "vstr ui_demo" ; close "self"  )
		CHOICE_BUTTON( 6, "Cancel", close self )
	}
}
