#include "ui/menudef.h"

// Defines //

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

// Macros //

#include "ui/menumacros.h"
		
// System Menu //
	
menuDef {
	name		"options_controls"
	visible		0
	fullscreen	0
	rect		WINDOW_X WINDOW_Y WINDOW_WIDTH WINDOW_HEIGHT
	style		WINDOW_STYLE_FILLED
	
	onESC {
		close options_controls ;
		open options
	}

// Window //

	WINDOW( "CONTROLS", 90 )
	
// Subwindows //

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

	SUBWINDOW( 6, 32, (SUBWINDOW_WIDTH), 160, "MOVE" )
	BIND( 8, 48, (SUBWINDOW_WIDTH)-4, 10, "Forward:", .2, 8, "+forward", "" )
	BIND( 8, 60, (SUBWINDOW_WIDTH)-4, 10, "Back:", .2, 8, "+back", "" )
	BIND( 8, 72, (SUBWINDOW_WIDTH)-4, 10, "Move Left:", .2, 8, "+moveleft", "" )
	BIND( 8, 84, (SUBWINDOW_WIDTH)-4, 10, "Move Right:", .2, 8, "+moveright", "" )
	BIND( 8, 96, (SUBWINDOW_WIDTH)-4, 10, "Lean Left:", .2, 8, "+leanleft", "" )
	BIND( 8, 108, (SUBWINDOW_WIDTH)-4, 10, "Lean Right:", .2, 8, "+leanright", "" )
	BIND( 8, 120, (SUBWINDOW_WIDTH)-4, 10, "Jump:", .2, 8, "+moveup", "" )
	BIND( 8, 132, (SUBWINDOW_WIDTH)-4, 10, "Crouch:", .2, 8, "+movedown", "" )
	BIND( 8, 144, (SUBWINDOW_WIDTH)-4, 10, "Prone:", .2, 8, "+prone", "" )
	BIND( 8, 156, (SUBWINDOW_WIDTH)-4, 10, "Walk:", .2, 8, "+speed", "" )
	BIND( 8, 168, (SUBWINDOW_WIDTH)-4, 10, "Sprint:", .2, 8, "+sprint", "" )
	BIND( 8, 180, (SUBWINDOW_WIDTH)-4, 10, "Use (Activate):", .2, 8, "+activate", "" )
	
// Input //

	SUBWINDOW( 6, 198, (SUBWINDOW_WIDTH), 40, "INPUT" )
//	YESNOACTION( 8, 214, (SUBWINDOW_WIDTH)-4, 10, "Invert Mouse:", .2, 8, "ui_mousePitch", uiScript update ui_mousePitch )
//	YESNO( 8, 226, (SUBWINDOW_WIDTH)-4, 10, "Smooth Mouse:", .2, 8, "m_filter" )
	CHECKBOXALIGNXACTION( 8, 214, .5*((SUBWINDOW_WIDTH)-6), 10, "Invert Mouse:", .2, 24, 8, "ui_mousePitch", uiScript update ui_mousePitch, "Inverts mouse pitch" )
	CHECKBOXALIGNX( 8+(.5*((SUBWINDOW_WIDTH)-6))+2, 214, .5*((SUBWINDOW_WIDTH)-6), 10, "Smooth Mouse:", .2, 24, 8, "m_filter", "Smooths out the mouse using interpolation" )
	SLIDER( 8, 226, (SUBWINDOW_WIDTH)-4, 10, "Mouse Sensitivity:", .2, 8, "sensitivity" 5 1 30, "Use the slider to increase or decrease mouse sensitivity" )
	CVARFLOATLABEL( 8, 226, (SUBWINDOW_WIDTH)-4, 10, "sensitivity", .2, ITEM_ALIGN_RIGHT, $evalfloat((SUBWINDOW_WIDTH)-4), 8 )

// Chat //

	SUBWINDOW( 6, 244, (SUBWINDOW_WIDTH), 64, "CHAT" )
	BIND( 8, 260, .5*((SUBWINDOW_WIDTH)-6), 10, "Chat:", .2, 8, "messagemode", "" )
	BIND( 8+(.5*((SUBWINDOW_WIDTH)-6))+2, 260, .5*((SUBWINDOW_WIDTH)-6), 10, "Team Chat:", .2, 8, "messagemode2", "" )
	BIND( 8, 272, (SUBWINDOW_WIDTH)-4, 10, "Fire-Team Chat:", .2, 8, "messagemode3", "" )
	BIND( 8, 284, (SUBWINDOW_WIDTH)-4, 10, "Quick Chat:", .2, 8, "mp_QuickMessage", "" )
	BIND( 8, 296, (SUBWINDOW_WIDTH)-4, 10, "Fire-Team Quick Chat:", .2, 8, "mp_fireteammsg", "" )

// Pop-Ups //

	SUBWINDOW( 6, 314, (SUBWINDOW_WIDTH), 100, "POP-UPS" )
	BIND( 8, 330, (SUBWINDOW_WIDTH)-4, 10, "Show Scores:", .2, 8, "+scores", "" )
	BIND( 8, 342, (SUBWINDOW_WIDTH)-4, 10, "Show Limbo Menu:", .2, 8, "OpenLimboMenu", "" )
	BIND( 8, 354, (SUBWINDOW_WIDTH)-4, 10, "Show Command Map:", .2, 8, "+mapexpand", "" )
	BIND( 8, 366, (SUBWINDOW_WIDTH)-4, 10, "Compass Map Zoom In:", .2, 8, "MapZoomIn", "" )
	BIND( 8, 378, (SUBWINDOW_WIDTH)-4, 10, "Compass Map Zoom Out:", .2, 8, "MapZoomOut", "" )
	BIND( 8, 390, (SUBWINDOW_WIDTH)-4, 10, "Player Stats:", .2, 8, "+stats", "" )
	BIND( 8, 402, (SUBWINDOW_WIDTH)-4, 10, "Top Shots:", .2, 8, "+topshots", "" )
//	BIND( 8, 402, (SUBWINDOW_WIDTH)-4, 10, "Multiview:", .2, 8, "mvactivate", "" )
	
// Use Weapons //

	SUBWINDOW( 6+(SUBWINDOW_WIDTH)+6, 32, (SUBWINDOW_WIDTH), 64, "USE WEAPONS" )
	BIND( 6+(SUBWINDOW_WIDTH)+6+2, 48, (SUBWINDOW_WIDTH)-4, 10, "Attack:", .2, 8, "+attack", "" )
	BIND( 6+(SUBWINDOW_WIDTH)+6+2, 60, (SUBWINDOW_WIDTH)-4, 10, "Switch to Alternate:", .2, 8, "weapalt", "" )
	BIND( 6+(SUBWINDOW_WIDTH)+6+2, 72, (SUBWINDOW_WIDTH)-4, 10, "Reload Weapon:", .2, 8, "+reload", "" )
	BIND( 6+(SUBWINDOW_WIDTH)+6+2, 84, (SUBWINDOW_WIDTH)-4, 10, "Binocular Zoom:", .2, 8, "+zoom", "" )
	
// Select Weapons //

	SUBWINDOW( 6+(SUBWINDOW_WIDTH)+6, 102, (SUBWINDOW_WIDTH), 124, "SELECT WEAPONS" )
	BIND( 6+(SUBWINDOW_WIDTH)+6+2, 118, (SUBWINDOW_WIDTH)-4, 10, "Next Weapon:", .2, 8, "weapnext", "Choose next weapons" )
	BIND( 6+(SUBWINDOW_WIDTH)+6+2, 130, (SUBWINDOW_WIDTH)-4, 10, "Previous Weapon:", .2, 8, "weapprev", "Choose previous weapon" )
	BIND( 6+(SUBWINDOW_WIDTH)+6+2, 142, (SUBWINDOW_WIDTH)-4, 10, "Slot 1 - Melee:", .2, 8, "weaponbank 1", "" )
	BIND( 6+(SUBWINDOW_WIDTH)+6+2, 154, (SUBWINDOW_WIDTH)-4, 10, "Slot 2 - One Handed:", .2, 8, "weaponbank 2", "Secondary (Pistol)" )
	BIND( 6+(SUBWINDOW_WIDTH)+6+2, 166, (SUBWINDOW_WIDTH)-4, 10, "Slot 3 - Two Handed:", .2, 8, "weaponbank 3", "Primary (SMG)" )
	BIND( 6+(SUBWINDOW_WIDTH)+6+2, 178, (SUBWINDOW_WIDTH)-4, 10, "Slot 4 - Grenade:", .2, 8, "weaponbank 4", "" )
	BIND( 6+(SUBWINDOW_WIDTH)+6+2, 190, (SUBWINDOW_WIDTH)-4, 10, "Slot 5 - Special 1:", .2, 8, "weaponbank 5", "Syringe, Pliers, Smoke" )
	BIND( 6+(SUBWINDOW_WIDTH)+6+2, 202, (SUBWINDOW_WIDTH)-4, 10, "Slot 6 - Special 2:", .2, 8, "weaponbank 6", "Healthpack, Dynamite, Satchel" )
	BIND( 6+(SUBWINDOW_WIDTH)+6+2, 214, (SUBWINDOW_WIDTH)-4, 10, "Slot 7 - Special 3:", .2, 8, "weaponbank 7", "Adrenaline, Mines, etc" )
// Miscellaneous //

	SUBWINDOW( 6+(SUBWINDOW_WIDTH)+6, 232, (SUBWINDOW_WIDTH), 52, "MISCELLANEOUS" )
	BIND( 6+(SUBWINDOW_WIDTH)+6+2, 248, .5*((SUBWINDOW_WIDTH)-6), 10, "Vote Yes:", .2, 8, "vote yes", "" )
	BIND( 6+(SUBWINDOW_WIDTH)+6+2+(.5*((SUBWINDOW_WIDTH)-6))+2, 248, .5*((SUBWINDOW_WIDTH)-6), 10, "Vote No:", .2, 8, "vote no", "" )
	BIND( 6+(SUBWINDOW_WIDTH)+6+2, 260, (SUBWINDOW_WIDTH)-4, 10, "Take Screenshot:", .2, 8, "autoScreenshot", "" )
	BIND( 6+(SUBWINDOW_WIDTH)+6+2, 272, (SUBWINDOW_WIDTH)-4, 10, "Record Replay:", .2, 8, "autoRecord", "" )

// Fire-Teams //

	SUBWINDOW( 6+(SUBWINDOW_WIDTH)+6, 290, (SUBWINDOW_WIDTH), 124, "FIRE-TEAMS" )
	BIND( 6+(SUBWINDOW_WIDTH)+6+2, 306, (SUBWINDOW_WIDTH)-4, 10, "Select All Members:", .2, 8, "selectbuddy -2", "" )
	BIND( 6+(SUBWINDOW_WIDTH)+6+2, 318, (SUBWINDOW_WIDTH)-4, 10, "Select Member #1:", .2, 8, "selectbuddy 0", "" )
	BIND( 6+(SUBWINDOW_WIDTH)+6+2, 330, (SUBWINDOW_WIDTH)-4, 10, "Select Member #2:", .2, 8, "selectbuddy 1", "" )
	BIND( 6+(SUBWINDOW_WIDTH)+6+2, 342, (SUBWINDOW_WIDTH)-4, 10, "Select Member #3:", .2, 8, "selectbuddy 2", "" )
	BIND( 6+(SUBWINDOW_WIDTH)+6+2, 354, (SUBWINDOW_WIDTH)-4, 10, "Select Member #4:", .2, 8, "selectbuddy 3", "" )
	BIND( 6+(SUBWINDOW_WIDTH)+6+2, 366, (SUBWINDOW_WIDTH)-4, 10, "Select Member #5:", .2, 8, "selectbuddy 4", "" )
	BIND( 6+(SUBWINDOW_WIDTH)+6+2, 378, (SUBWINDOW_WIDTH)-4, 10, "Select Member #6:", .2, 8, "selectbuddy 5", "" )
	BIND( 6+(SUBWINDOW_WIDTH)+6+2, 390, (SUBWINDOW_WIDTH)-4, 10, "Deselect All:", .2, 8, "selectbuddy -1", "" )
	BIND( 6+(SUBWINDOW_WIDTH)+6+2, 402, (SUBWINDOW_WIDTH)-4, 10, "Fire-Team Admin:", .2, 8, "mp_fireteamadmin", "" )

// Buttons //

	BUTTON( 6, WINDOW_HEIGHT-24, .5*(WINDOW_WIDTH-18), 18, "BACK", .3, 14,
		close options_controls ; open options )
	BUTTON( 6+.5*(WINDOW_WIDTH-18)+6, WINDOW_HEIGHT-24, .5*(WINDOW_WIDTH-18), 18, "DEFAULT", .3, 14,
		open options_controls_default )
}
