#include "ui/menudef.h"
#include "ui/menumacros.h"

#define DEFAULT_TEXT_SCALE	0.25
#define ORIGIN_QUICKMESSAGE	10 10
#define QM_MENU_GRADIENT_START_OFFSET
#define QM_MENU_START( WINDOWNAME )																				\
																												\
menuDef {																										\
	name		WINDOWNAME																						\
	visible		0																								\
	fullscreen	0																								\
	rect		0 100 __WINDOW_WIDTH 380																		\
	onOpen		{ setCvar cl_bypassMouseInput "1" }																\
	onClose		{ setCvar cl_bypassMouseInput "0" }																\
	onEsc		{ closeAll }																					\
																												\
	itemDef {																									\
		name		"window"																					\
		rect		0 19 204 136																				\
		origin		ORIGIN_QUICKMESSAGE																			\
		style		WINDOW_STYLE_FILLED																			\
		backcolor	0 0 0 .75																					\
		border		WINDOW_BORDER_FULL																			\
		bordercolor	.5 .5 .5 .5																					\
		visible		1																							\
		decoration																								\
	}																											\
																												\
	itemDef {																									\
		name		"windowtitle"																				\
		rect		$evalfloat((0)+2) $evalfloat((19)+2) $evalfloat((204)-4) 12									\
		origin		ORIGIN_QUICKMESSAGE																			\
		text		_("MESSAGE")																				\
		textfont	UI_FONT_ARIBLK_16																			\
		textscale	.19																							\
		textalignx	3																							\
		textaligny	10																							\
		style		WINDOW_STYLE_FILLED																			\
		backcolor	.16 .2 .17 .8																				\
		forecolor	.6 .6 .6 1																					\
		visible		1																							\
		decoration																								\
	}

	#define QM_MENU_END }

	#define QM_MENU_ITEM( WINDOWTEXT, ACTION, KEY, POS )				\
    itemDef {															\
		name			"menuitem"##WINDOWTEXT							\
		rect			6 $evalfloat( 35 + ( 12 * POS )) 128 10			\
		origin			ORIGIN_QUICKMESSAGE								\
		type			ITEM_TYPE_TEXT									\
		text			WINDOWTEXT										\
		textfont		UI_FONT_COURBD_21								\
		textstyle		ITEM_TEXTSTYLE_SHADOWED							\
		textscale		.2												\
		textaligny		8												\
		forecolor		.6 .6 .6 1										\
		visible			1												\
		decoration														\
    }																	\
    execKey KEY { ACTION }

	#define QM_MENU_ITEM_TEAM( WINDOWTEXT, ACTION, KEY, POS )			\
    itemDef {															\
		name			"menuitem"##WINDOWTEXT							\
		rect			6 $evalfloat( 35 + ( 12 * POS )) 128 10			\
		origin			ORIGIN_QUICKMESSAGE								\
		type			ITEM_TYPE_TEXT									\
		text			WINDOWTEXT										\
		textfont		UI_FONT_COURBD_21								\
		textstyle		ITEM_TEXTSTYLE_SHADOWED							\
		textscale		.2												\
		textaligny		8												\
		forecolor		.6 .6 .6 1										\
		visible			1												\
		decoration														\
    }																	\
	execKey KEY { ACTION }

QM_MENU_START( "wm_quickmessage" )

	QM_MENU_ITEM_TEAM( 	_("S. Statements"), 	close wm_quickmessage; 		open wm_quickstatements, 	"s", 0 )
	QM_MENU_ITEM_TEAM( 	_("R. Requests"), 		close wm_quickmessage; 		open wm_quickrequests, 		"r", 1 )
	QM_MENU_ITEM_TEAM( 	_("C. Commands"), 		close wm_quickmessage; 		open wm_quickcommand, 		"c", 2 )
	QM_MENU_ITEM_TEAM( 	_("T. Talk"),		 	close wm_quickmessage;	 	open wm_quickmisc, 			"t", 3 )
	QM_MENU_ITEM( 		_("G. Global"),	 		close wm_quickmessage; 		open wm_quickglobal, 		"g", 4 )
	QM_MENU_ITEM_TEAM( 	_("F. Function"), 		exec "wm_sayPlayerClass"; 	close wm_quickmessage,		"f", 5 )
	QM_MENU_ITEM_TEAM( 	_("O. Objectives"), 	close wm_quickmessage; 		open wm_quickobjectives, 	"o", 6 )

QM_MENU_END

QM_MENU_START( "wm_quickstatements" )

	QM_MENU_ITEM_TEAM( _("P. Path Cleared."), 		exec "VoiceTeamChat PathCleared"; 		close wm_quickstatements,	"p", 0 )
	QM_MENU_ITEM_TEAM( _("W. Enemy Weak!"), 		exec "VoiceTeamChat EnemyWeak"; 		close wm_quickstatements, 	"w", 1 )
	QM_MENU_ITEM_TEAM( _("C. All Clear"), 			exec "VoiceTeamChat AllClear"; 			close wm_quickstatements,	"c", 2 )
	QM_MENU_ITEM_TEAM( _("I. Incoming"), 			exec "VoiceTeamChat Incoming"; 			close wm_quickstatements,	"i", 3 )
	QM_MENU_ITEM_TEAM( _("F. Fire In The Hole!"), 	exec "VoiceTeamChat FireInTheHole";		 close wm_quickstatements,	"f", 4 )
	QM_MENU_ITEM_TEAM( _("D. I'm Defending."), 		exec "VoiceTeamChat OnDefense"; 		close wm_quickstatements,	"d", 5 )
	QM_MENU_ITEM_TEAM( _("A. I'm Attacking."), 		exec "VoiceTeamChat OnOffense"; 		close wm_quickstatements,	"a", 6 )
	QM_MENU_ITEM_TEAM( _("M. Mines Cleared"), 		exec "VoiceTeamChat MinesCleared"; 		close wm_quickstatements,	"m", 8 )
	QM_MENU_ITEM_TEAM( _("E. Enemy Disguised"), 	exec "VoiceTeamChat EnemyDisguised";	close wm_quickstatements,	"e", 9 )

QM_MENU_END

QM_MENU_START( "wm_quickrequests" )

	QM_MENU_ITEM_TEAM( _("M. Need Medic!"), 		exec "VoiceTeamChat Medic"; 		close wm_quickrequests,	"m", 0 )
	QM_MENU_ITEM_TEAM( _("A. Need Ammo!"), 			exec "VoiceTeamChat NeedAmmo"; 		close wm_quickrequests,	"a", 1 )
	QM_MENU_ITEM_TEAM( _("B. Need Backup!"), 		exec "VoiceTeamChat NeedBackup"; 	close wm_quickrequests,	"b", 2 )
	QM_MENU_ITEM_TEAM( _("E. Need Engineer!"), 		exec "VoiceTeamChat NeedEngineer"; 	close wm_quickrequests,	"e", 3 )
	QM_MENU_ITEM_TEAM( _("C. Cover Me!"), 			exec "VoiceTeamChat CoverMe"; 		close wm_quickrequests,	"c", 4 )
	QM_MENU_ITEM_TEAM( _("H. Hold Fire!"),			exec "VoiceTeamChat HoldFire";	 	close wm_quickrequests, "h", 5 )
	QM_MENU_ITEM_TEAM( _("W. Where To?"), 			exec "VoiceTeamChat WhereTo"; 		close wm_quickrequests,	"w", 6 )
	QM_MENU_ITEM_TEAM( _("O. Need Covert Ops!"), 	exec "VoiceTeamChat NeedOps"; 		close wm_quickrequests,	"o", 7 )

QM_MENU_END

QM_MENU_START( "wm_quickcommand" )

	QM_MENU_ITEM_TEAM( _("F. Follow Me!"), 			exec "VoiceTeamChat FollowMe"; 			close wm_quickcommand, 	"f", 0 )
	QM_MENU_ITEM_TEAM( _("G. Let's Go!"), 			exec "VoiceTeamChat LetsGo"; 			close wm_quickcommand, 	"g", 1 )
	QM_MENU_ITEM_TEAM( _("M. Move!"), 				exec "VoiceTeamChat Move"; 				close wm_quickcommand, 	"m", 2 )
	QM_MENU_ITEM_TEAM( _("C. Clear The Path!"), 	exec "VoiceTeamChat ClearPath"; 		close wm_quickcommand, 	"c", 3 )
	QM_MENU_ITEM_TEAM( _("O. Defend Objective!"), 	exec "VoiceTeamChat DefendObjective"; 	close wm_quickcommand, 	"o", 4 )
	QM_MENU_ITEM_TEAM( _("D. Disarm Dynamite!"), 	exec "VoiceTeamChat DisarmDynamite"; 	close wm_quickcommand, 	"d", 5 )
	QM_MENU_ITEM_TEAM( _("N. Clear Mines!"), 		exec "VoiceTeamChat ClearMines"; 		close wm_quickcommand, 	"n", 6 )
	QM_MENU_ITEM_TEAM( _("R. Reinforce Offense"), 	exec "VoiceTeamChat ReinforceOffense"; 	close wm_quickcommand,	"r", 7 )
	QM_MENU_ITEM_TEAM( _("E. Reinforce Defense"), 	exec "VoiceTeamChat ReinforceDefense"; 	close wm_quickcommand,	"e", 8 )

QM_MENU_END

QM_MENU_START( "wm_quickmisc" )

	QM_MENU_ITEM_TEAM( _("Y. Yes"),				exec "VoiceTeamChat Affirmative"; 	close wm_quickmisc, "y", 0 )
	QM_MENU_ITEM_TEAM( _("N. No"),				exec "VoiceTeamChat Negative"; 		close wm_quickmisc, "n", 1 )
	QM_MENU_ITEM_TEAM( _("T. Thanks"),			exec "VoiceTeamChat Thanks"; 		close wm_quickmisc, "t", 2 )
	QM_MENU_ITEM_TEAM( _("W. Welcome"),			exec "VoiceTeamChat Welcome"; 		close wm_quickmisc, "w", 3 )
	QM_MENU_ITEM_TEAM( _("S. Sorry"),			exec "VoiceTeamChat Sorry"; 		close wm_quickmisc, "s", 4 )
	QM_MENU_ITEM_TEAM( _("O. Oops"), 			exec "VoiceTeamChat Oops"; 			close wm_quickmisc, "o", 5 )

QM_MENU_END

QM_MENU_START( "wm_quickglobal" )

	QM_MENU_ITEM( _("Y. Yes"),				exec "VoiceChat Affirmative"; 	close wm_quickglobal, 	"y", 0 )
	QM_MENU_ITEM( _("N. No"),				exec "VoiceChat Negative"; 		close wm_quickglobal, 	"n", 1 )
	QM_MENU_ITEM( _("W. Enemy Weak"),		exec "VoiceChat EnemyWeak";		close wm_quickglobal, 	"w", 2 )
	QM_MENU_ITEM( _("H. Hi"),				exec "VoiceChat Hi"; 			close wm_quickglobal, 	"h", 3 )
	QM_MENU_ITEM( _("B. Bye"),				exec "VoiceChat Bye"; 			close wm_quickglobal, 	"b", 4 )
	QM_MENU_ITEM( _("S. Great Shot"),		exec "VoiceChat GreatShot"; 	close wm_quickglobal, 	"s", 5 )
	QM_MENU_ITEM( _("C. Cheer"),			exec "VoiceChat Cheer"; 		close wm_quickglobal, 	"c", 6 )
	QM_MENU_ITEM( _("G. More Globals"),		close wm_quickglobal;			open wm_quickglobal2, 	"g", 7 )

QM_MENU_END

QM_MENU_START( "wm_quickglobal2" )

	QM_MENU_ITEM( _("T. Thanks"),		exec "VoiceChat Thanks";	close wm_quickglobal2, 	"t", 0 )
	QM_MENU_ITEM( _("W. Welcome"),		exec "VoiceChat Welcome"; 	close wm_quickglobal2, 	"w", 1 )
	QM_MENU_ITEM( _("O. Oops"),			exec "VoiceChat Oops"; 		close wm_quickglobal2, 	"o", 2 )
	QM_MENU_ITEM( _("S. Sorry"),		exec "VoiceChat Sorry"; 	close wm_quickglobal2, 	"s", 3 )
	QM_MENU_ITEM( _("H. Hold Fire!"),	exec "VoiceChat HoldFire";	close wm_quickglobal2, 	"h", 4 )
	QM_MENU_ITEM( _("G. Good Game"),	exec "VoiceChat GoodGame";	close wm_quickglobal2, 	"g", 5 )

QM_MENU_END

QM_MENU_START( "wm_quickobjectives" )

	QM_MENU_ITEM_TEAM( _("A. Command Acknowledged"),		exec "VoiceTeamChat CommandAcknowledged"; 		close wm_quickobjectives,	"a", 0 )
	QM_MENU_ITEM_TEAM( _("D. Command Declined"),			exec "VoiceTeamChat CommandDeclined";			close wm_quickobjectives,	"d", 1 )
	QM_MENU_ITEM_TEAM( _("C. Command Completed"),			exec "VoiceTeamChat CommandCompleted";			close wm_quickobjectives,	"c", 2 )
	QM_MENU_ITEM_TEAM( _("P. Destroy Primary Objective"),	exec "VoiceTeamChat DestroyPrimary"; 			close wm_quickobjectives,	"p", 3 )
	QM_MENU_ITEM_TEAM( _("S. Destroy Secondary Objective"),	exec "VoiceTeamChat DestroySecondary";			close wm_quickobjectives,	"s", 4 )
	QM_MENU_ITEM_TEAM( _("X. Destroy Construction"),		exec "VoiceTeamChat DestroyConstruction";		close wm_quickobjectives,	"x", 5 )
	QM_MENU_ITEM_TEAM( _("M. Commencing Construction"),		exec "VoiceTeamChat ConstructionCommencing";	close wm_quickobjectives, 	"m", 6 )
	QM_MENU_ITEM_TEAM( _("R. Repair Vehicle"),				exec "VoiceTeamChat RepairVehicle";				close wm_quickobjectives,	"r", 7 )
	QM_MENU_ITEM_TEAM( _("V. Disable Vehicle"),				exec "VoiceTeamChat DestroyVehicle";			close wm_quickobjectives,	"v", 8 )
	QM_MENU_ITEM_TEAM( _("E. Escort Vehicle"),				exec "VoiceTeamChat EscortVehicle";				close wm_quickobjectives,	"e", 9 )

QM_MENU_END
