#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"

{
	menuDef 
	{
		name			iw3sp_mod_options
		fullScreen		0
		rect			0 0 640 480
		focusColor		COLOR_FOCUSED
		soundloop		""
		onOpen
		{
			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_gamepad_default;

			setLocalVarBool ui_showApply 0;
			setLocalVarBool ui_hideBack 1;

			// setfromdvar dst src
			exec "exec options_iw3sp_mod.cfg";

			uiScript getLanguage;
		}
		onClose
		{
			setLocalVarBool ui_hideBack 0;
		}
		onESC 
		{ 
			close self;
		}

		#include "ui_mp/leftside_options.inc"
		
		CHOICE_SECTION_TITLE( 21, "@IW3SP_MOD_LOC_MENU_IW3SP_MOD_OPTIONS" )

		CHOICE_DVARYESNO( 22, "@IW3SP_MOD_LOC_MENU_ENABLE_AUTOUPDATE", iw3sp_auto_update, ; )
		CHOICE_DVARYESNO( 23, "@IW3SP_MOD_LOC_MENU_BRANDING", cg_drawBrandingInfo, ; )
		CHOICE_DVARYESNO( 24, "@IW3SP_MOD_LOC_MENU_EXTERNAL_CONSOLE", external_console, ; )
		CHOICE_DVARYESNO( 25, "@IW3SP_MOD_LOC_MENU_ALLOW_CHEATS_CMD", sv_allowCheats, exec "applyCheat"; )
		CHOICE_DVARFLOATLIST( 26, "Console UI", ui_console_menu_style, { "@MENU_DISABLED" 0 "@MENU_ENABLED" 1 }, setLocalVarBool ui_showApply 1; )

		// Added 03.24.2024 (8:02 PM)
		itemDef 
		{
			name			apply
			text			"@MENU_APPLY"
			type			1
			style			WINDOW_STYLE_FILLED
			textstyle		ITEM_TEXTSTYLE_SHADOWED
			rect			200 -26 80 20 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_BOTTOM
			textfont		UI_FONT_NORMAL
			textalign		ITEM_ALIGN_LEFT
			textscale		TEXTSIZE_SMALL
			textaligny		18
			visible			when( localVarBool( ui_showApply ) && !dvarint( sv_running ) );
			mouseEnter		{ play "mouse_over"; }
			action 
			{
				play 		"mouse_click";
				open 		iw3sp_mod_settings_restart
			}
		}

		itemDef 
		{
			name			apply2
			text			"@MENU_APPLY"
			type			1
			style			WINDOW_STYLE_FILLED
			textstyle		ITEM_TEXTSTYLE_SHADOWED
			rect			200 -26 80 20 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_BOTTOM
			textfont		UI_FONT_NORMAL
			textalign		ITEM_ALIGN_LEFT
			textscale		TEXTSIZE_SMALL
			textaligny		18
			visible			when( localVarBool( ui_showApply ) && dvarint( sv_running ) );
			mouseEnter		{ play "mouse_over"; }
			action 
			{
				play "mouse_click";
				uiScript openMenuOnDvar g_reloading 0 vid_restart_popmenu_listen; 
				uiScript openMenuOnDvarNot g_reloading 0 vid_restart_popmenu_dead;
			}	
		}
	
	}
}
