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

// Defines //
#define WINDOW_X		16
#define WINDOW_Y		16
#define WINDOW_WIDTH	608
#define WINDOW_HEIGHT	448
#define GROUP_NAME		"grpOptionsControls"

// Subwindows //
#define SUBWINDOW_WIDTH		.5*(WINDOW_WIDTH-18)

// Controls Menu //
menuDef {
	name		"options_controls_advanced"
	visible		0
	fullscreen	0
	rect		WINDOW_X WINDOW_Y WINDOW_WIDTH WINDOW_HEIGHT
	style		WINDOW_STYLE_FILLED

	onESC {
		close options_controls_advanced ;
		open options
	}

// Window //
	WINDOW( _("CONTROLS: ADVANCED"), 90 )

// Selection //
#define SELECTION_Y 32
	SUBWINDOW( 6, SELECTION_Y, (SUBWINDOW_WIDTH), 52, _("SELECTION MENUS" ))
	BIND( 8, SELECTION_Y+16, (SUBWINDOW_WIDTH)-4, 10, _("Team selection:"), .2, 8, "teammenu", "" )
	BIND( 8, SELECTION_Y+28, (SUBWINDOW_WIDTH)-4, 10, _("Class selection:"), .2, 8, "classmenu", "" )
	BIND( 8, SELECTION_Y+40, (SUBWINDOW_WIDTH)-4, 10, _("Spawn selection:"), .2, 8, "spawnmenu", "" )

// Fire-Teams //
#define FIRETEAM_Y 90
	SUBWINDOW( 6, FIRETEAM_Y, (SUBWINDOW_WIDTH), 148, _("FIRE-TEAMS" ))
	BIND( 8, FIRETEAM_Y+16, (SUBWINDOW_WIDTH)-4, 10, _("Fire-Team Admin:"), .2, 8, "mp_fireteamadmin", "" )
	BIND( 8, FIRETEAM_Y+28, (SUBWINDOW_WIDTH)-4, 10, _("Select All Members:"), .2, 8, "selectbuddy -2", "" )
	BIND( 8, FIRETEAM_Y+40, (SUBWINDOW_WIDTH)-4, 10, _("Deselect All Members:"), .2, 8, "selectbuddy -1", "" )
	BIND( 8, FIRETEAM_Y+52, (SUBWINDOW_WIDTH)-4, 10, _("Select Member #1:"), .2, 8, "selectbuddy 0", "" )
	BIND( 8, FIRETEAM_Y+64, (SUBWINDOW_WIDTH)-4, 10, _("Select Member #2:"), .2, 8, "selectbuddy 1", "" )
	BIND( 8, FIRETEAM_Y+76, (SUBWINDOW_WIDTH)-4, 10, _("Select Member #3:"), .2, 8, "selectbuddy 2", "" )
	BIND( 8, FIRETEAM_Y+88, (SUBWINDOW_WIDTH)-4, 10, _("Select Member #4:"), .2, 8, "selectbuddy 3", "" )
	BIND( 8, FIRETEAM_Y+100, (SUBWINDOW_WIDTH)-4, 10, _("Select Member #5:"), .2, 8, "selectbuddy 4", "" )
	BIND( 8, FIRETEAM_Y+112, (SUBWINDOW_WIDTH)-4, 10, _("Select Member #6:"), .2, 8, "selectbuddy 5", "" )
	BIND( 8, FIRETEAM_Y+124, (SUBWINDOW_WIDTH)-4, 10, _("Select Member #7:"), .2, 8, "selectbuddy 6", "" )
	BIND( 8, FIRETEAM_Y+136, (SUBWINDOW_WIDTH)-4, 10, _("Select Member #8:"), .2, 8, "selectbuddy 7", "" )

// Joystick //
#define JOYSTICK_Y 244
	SUBWINDOW( 6, JOYSTICK_Y, (SUBWINDOW_WIDTH), 64, _("JOYSTICK") )
	MULTI( 8, JOYSTICK_Y+16, (SUBWINDOW_WIDTH)-4, 10, _("Enable Joysticks:"), .2, 8, "in_joystick", cvarFloatList { "No" 0 "Yes" 1 }, _("General joystick initialization. Requires vid_restart.") )
	EDITFIELD( 8, JOYSTICK_Y+28, (SUBWINDOW_WIDTH)-4, 10, _("Use Joystick#:"), .2, 8, "in_joystickNo", 64, 18, _("Specifies active joystick") )
	MULTI( 8, JOYSTICK_Y+40, (SUBWINDOW_WIDTH)-4, 10, _("Analog Joystick:"), .2, 8, "in_joystickUseAnalog", cvarFloatList { "No" 0 "Yes" 1 }, _("Use analog joystick?") )
	EDITFIELD( 8, JOYSTICK_Y+52, (SUBWINDOW_WIDTH)-4, 10, _("Joystick Threshold:"), .2, 8, "in_joystickThreshold", 64, 18, _("Sets joystick threshold sensitivity") )

// Buttons //
	BUTTON( 6, WINDOW_HEIGHT-24, WINDOW_WIDTH-12, 18, _("BACK"), .3, 14, close options_controls_advanced ; open options_controls )
}
