#include "ui/menudef.h"
#include "ui_mp/common_macro.inc"
#define OPTIONS_STYLE			1
#include "ui_mp/menustyle.inc"
#include "ui/choices_setup_common.menu"

#define ON_GPAD_ENABLED when(dvarBool("gpad_enabled") == 1)
#define ON_GPAD_DISABLED when(dvarBool("gpad_enabled") == 0)

{
	menuDef 
	{
		name			iw3sp_mod_gamepad_settings
		fullScreen		0
		rect			0 0 640 480
		focusColor		COLOR_FOCUSED
		soundloop		""
		onOpen
		{
			focusFirst;

			close options_look;
			close options_move;
			close options_shoot;
			close options_misc;
			close options_graphics;
			close options_sound;
			close options_view;
			close options_defaults;
			close options_driverinfo;
			close options_credits;
			close options_multi;
			close options_graphics_defaults;
			close options_graphics_texture;
			close options_control_defaults;

			close iw3sp_mod_options;
			close iw3sp_mod_controls_pc_main;
			close iw3sp_mod_controls_pc_options;
			close iw3sp_mod_gamepad_controls;
			
			setLocalVarBool ui_hideBack 1;
		}
		onClose
		{
			setLocalVarBool ui_hideBack 0;
		}
		onESC 
		{ 
			close self;
		}

		#include "ui_mp/leftside_controls_gamepad.inc"

		CHOICE_SECTION_TITLE( 21, "@IW3SP_MOD_LOC_MENU_GAMEPAD_OPTIONS" )
		CHOICE_DVARYESNO( 22, "@IW3SP_MOD_LOC_MENU_GAMEPAD_ENABLED", gpad_enabled, uiScript "gamepadFirstExecIfEnabled" )
		CHOICE_DVARFLOATLIST_VIS( 23, "@IW3SP_MOD_LOC_MENU_GAMEPAD_BUTTON_STYLE", gpad_style, { "@IW3SP_MOD_LOC_MENU_GAMEPAD_BUTTON_STYLE_XBOX" 0 "@IW3SP_MOD_LOC_MENU_GAMEPAD_BUTTON_STYLE_SONY" 1 }, ;, ON_GPAD_ENABLED )
		CHOICE_DVARYESNO_VIS( 24, "@MENU_AIM_ASSIST", gpad_aimassist, exec "setaimassist", ON_GPAD_ENABLED )
	}
}
