require("menu/options.lua");
require("scripts/game_style.lua");

radio_button_graphics = 
{ 
	"menu/btn_radbtn_01",  
	"menu/btn_radbtn_03",  
	"menu/btn_radbtn_02",  
	"menu/btn_radbtn_04",  
};

MakeDialog
{
	OptionsMenu
	{
		name = "ingame_options",
		x = 0,
		y = 0,
		w = 800,
		h = 600,
		ingame = true,
		
		-- Background
		Bitmap
		{
			name = options_win_medframeop_params["name"],
			image = options_win_medframeop_params["image"],
			x = options_win_medframeop_params["x"],
			y = options_win_medframeop_params["y"],
		},
		
		-- Ingame Options title
		Text
		{
			name = "ingame_title",
			font = Green15Font,
			flags = kHAlignCenter + kVAlignCenter,
			label = "ui.dialog.options.label",
			x = options_txt_options_params["x"] - 10,
			y = options_txt_options_params["y"] - 10,
			w = options_txt_options_params["w"] + 20,
			h = options_txt_options_params["h"] + 20,
			flags = kHAlignCenter + kVAlignCenter,
		},	
		
		-- Rules button
		MonopolyButton
		{
			name = options_btn_menu_rules_params["name"],
			graphics = options_btn_menu_rules_params["graphics"];
			x = options_btn_menu_rules_params["x"],
			y = options_btn_menu_rules_params["y"],
			label = "rules.btn",
			font = White15Font,
			command =
				function()
					DoModal("scripts/rules_ingame.lua");
				end;
		},
				
		-- Quit button
		MonopolyButton
		{
			name = options_btn_menu_quit_params["name"],
			graphics = options_btn_menu_quit_params["graphics"];
			x = options_btn_menu_quit_params["x"],
			y = options_btn_menu_quit_params["y"],
			label = "savenquit.btn",
			font = White15Font,
			command = 
				function()
					if GetCurrentGameSlot() == 0 then
						SwapToModal("scripts/savemenu.lua");
					else
						result = DisplayDialog
						{
							"scripts/saveconfirm.lua"
						};
						if (result == 'yes') then
							SwapToModal("scripts/savemenu.lua");
						elseif (result == 'cancel') then
							OnOptionsCancel();
							OnGameQuit();
						end
					end
				end
		},

		-- Ok button
		MonopolyButton
		{
			name = options_btn_menu_optok_params["name"],
			graphics = options_btn_menu_optok_params["graphics"];
			x = options_btn_menu_optok_params["x"],
			y = options_btn_menu_optok_params["y"],
			label = "common.ok.label",
			font = White15Font,
			
			command = 
				function()
					OnSave();
				end;
		},
		
		-- Cancel button
		MonopolyButton
		{
			name = options_btn_menu_optcancel_params["name"],
			graphics = options_btn_menu_optcancel_params["graphics"];
			x = options_btn_menu_optcancel_params["x"],
			y = options_btn_menu_optcancel_params["y"],
			label = "common.cancel.label",
			font = White15Font,
			
			command =
				function()
					OnOptionsCancel();
				end;
		},
		
		-- Fullscreen text
		Text
		{
			name = options_txt_fullscreen_params["name"],
			font = Green15Font,
			flags = kHAlignCenter + kVAlignCenter,
			label = "fullscreen.check",
			x = options_txt_fullscreen_params["x"]-5,
			y = options_txt_fullscreen_params["y"]-5,
			w = options_txt_fullscreen_params["w"]+10,
			h = options_txt_fullscreen_params["h"] + 10,
		},
		
		BeginGroup();
		
		MonopolyButton
		{
			name = "fullscreen.yes",
			graphics = radio_button_graphics,
			x = options_rad_button_fullon_params["x"],
			y = options_rad_button_fullon_params["y"],
			w = options_rad_button_fullon_params["w"] + 40,
			h = options_rad_button_fullon_params["h"],
			type = kRadio,
			command =
				function()
					OnFullScreen(true);
				end,
		},
		Text
		{
			name = options_txt_fullon_params["name"],
			label = "common.yes.label",
			font = Green15Font,
			flags = kHAlignCenter + kVAlignCenter,
			--x = options_txt_fullon_params["x"] - options_rad_button_fullon_params["x"]-5,
			--y = options_txt_fullon_params["y"] - options_rad_button_fullon_params["y"]-5,
			x = options_txt_fullon_params["x"] - 5,
			y = options_txt_fullon_params["y"] - 5,
			w = options_txt_fullon_params["w"] + 10,
			h = options_txt_fullon_params["h"] + 10,
		},
		
		MonopolyButton
		{
			name = "fullscreen.no",
			graphics = radio_button_graphics,
			x = options_rad_button_fulloff_params["x"],
			y = options_rad_button_fulloff_params["y"],
			w = options_rad_button_fulloff_params["w"] + 40,
			h = options_rad_button_fulloff_params["h"],
			type = kRadio,
			command =
				function()
					OnFullScreen(false);
				end,
		},
		Text
		{
			name = options_txt_fulloff_params["name"],
			label = "common.no.label",
			font = Green15Font,
			flags = kHAlignCenter + kVAlignCenter,
			--x = options_txt_fulloff_params["x"] - options_rad_button_fulloff_params["x"]-5,
			--y = options_txt_fulloff_params["y"] - options_rad_button_fulloff_params["y"]-5,
			x = options_txt_fulloff_params["x"] - 5,
			y = options_txt_fulloff_params["y"] - 5,
			w = options_txt_fulloff_params["w"] + 10,
			h = options_txt_fulloff_params["h"] + 10,
		},


		BeginGroup();
		
		-- Play advice text
		Text
		{
			name = options_txt_playadvice_params["name"],
			font = Green15Font,
			flags = kHAlignCenter + kVAlignCenter,
			label = "playadvice.check",
			x = options_txt_playadvice_params["x"] - 5,
			y = options_txt_playadvice_params["y"] - 5,
			w = options_txt_playadvice_params["w"] + 10,
			h = options_txt_playadvice_params["h"] + 10,
		},
		
		BeginGroup();
		
		MonopolyButton
		{
			name = "advice.yes",
			graphics = radio_button_graphics,
			x = options_rad_button_advon_params["x"],
			y = options_rad_button_advon_params["y"],
			w = options_rad_button_advon_params["w"] + 40,
			h = options_rad_button_advon_params["h"],
			type = kRadio,
		},
		Text
		{
			name = options_txt_advon_params["name"],
			label = "common.yes.label",
			font = Green15Font,
			flags = kHAlignCenter + kVAlignCenter,
			x = options_txt_advon_params["x"] - 5,
			y = options_txt_advon_params["y"] - 5,
			w = options_txt_advon_params["w"] + 10,
			h = options_txt_advon_params["h"] + 10,
		},
		
		MonopolyButton
		{
			name = "advice.no",
			graphics = radio_button_graphics,
			x = options_rad_button_advoff_params["x"],
			y = options_rad_button_advoff_params["y"],
			w = options_rad_button_advoff_params["w"] + 40,
			h = options_rad_button_advoff_params["h"],
			type = kRadio,
		},
		Text
		{
			name = options_txt_advoff_params["name"],
			label = "common.no.label",
			font = Green15Font,
			flags = kHAlignCenter + kVAlignCenter,
			x = options_txt_advoff_params["x"] - 5,
			y = options_txt_advoff_params["y"] - 5,
			w = options_txt_advoff_params["w"] + 10,
			h = options_txt_advoff_params["h"] + 10,
		},
		
		BeginGroup();

		-- Music volume
		Text
		{
			name = options_txt_musicvol_params["name"],
			label = "music.slider",
			font = Green15Font,
			flags = kHAlignCenter + kVAlignCenter,
			x = options_txt_musicvol_params["x"] - 5,
			y = options_txt_musicvol_params["y"] - 5,
			w = options_txt_musicvol_params["w"] + 10,
			h = options_txt_musicvol_params["h"] + 10,
		},
		
		Text
		{
			name = options_txt_musicvol_params["name"],
			label = "music.slider",
			font = Green15Font,
			flags = kHAlignCenter + kVAlignCenter,
			x = options_txt_musicvol_params["x"] - 5,
			y = options_txt_musicvol_params["y"] - 5,
			w = options_txt_musicvol_params["w"] + 10,
			h = options_txt_musicvol_params["h"] + 10,
		},
		
		Text
		{
			name = options_txt_musmin_params["name"],
			label = "common.min",
			font = Green15Font,
			flags = kHAlignCenter + kVAlignCenter,
			x = options_txt_musmin_params["x"] - 5,
			y = options_txt_musmin_params["y"] - 5,
			w = options_txt_musmin_params["w"] + 10,
			h = options_txt_musmin_params["h"] + 10,
		},
		
		Text
		{
			name = options_txt_musmax_params["name"],
			label = "common.max",
			font = Green15Font,
			flags = kHAlignCenter + kVAlignCenter,
			x = options_txt_musmax_params["x"] - 5,
			y = options_txt_musmax_params["y"] - 5,
			w = options_txt_musmax_params["w"] + 10,
			h = options_txt_musmax_params["h"] + 10,
		},
		
		SetStyle(RulesSliderStyle),
		
		SliderEx
		{
			name = "mus.slider",
			x = options_btn_slider_mus_params["x"] - 30,
			y = options_btn_slider_mus_params["y"],
			w = 75,
		},
		
		SetStyle(DefaultStyle),
		
		-- SFX volume
		Text
		{
			name = options_txt_sfxvol_params["name"],
			label = "sfx.slider",
			font = Green15Font,
			flags = kHAlignCenter + kVAlignCenter,
			x = options_txt_sfxvol_params["x"] - 5;
			y = options_txt_sfxvol_params["y"] - 5;
			w = options_txt_sfxvol_params["w"] + 10;
			h = options_txt_sfxvol_params["h"] + 10;
		},
		
		Text
		{
			name = options_txt_sfxmin_params["name"],
			label = "common.min",
			font = Green15Font,
			flags = kHAlignCenter + kVAlignCenter,
			x = options_txt_sfxmin_params["x"] - 5,
			y = options_txt_sfxmin_params["y"] - 5,
			w = options_txt_sfxmin_params["w"] + 10,
			h = options_txt_sfxmin_params["h"] + 10,
		},
		
		Text
		{
			name = options_txt_sfxmax_params["name"],
			label = "common.max",
			font = Green15Font,
			flags = kHAlignCenter + kVAlignCenter,
			x = options_txt_sfxmax_params["x"] - 5,
			y = options_txt_sfxmax_params["y"] - 5,
			w = options_txt_sfxmax_params["w"] + 10,
			h = options_txt_sfxmax_params["h"] + 10,
		},
		
		SetStyle(RulesSliderStyle),
		
		SliderEx
		{
			name = "sfx.slider",
			x = options_btn_slider_sfx_params["x"] - 30,
			y = options_btn_slider_sfx_params["y"],
			w = 75,
		},
		SetStyle(DefaultStyle),
	},
}
