require( "scripts/style.lua" );

SliderFont = {
  standardFont,
  16,
  BlackColor
};

DialogHeaderFont = {
  standardFont,
  26,
  WhiteColor
};

MakeDialog
{
	-- Name the modal dialog
	name="optionsmenu",
	Bitmap
	{
		image="backgrounds/win_small",
		x = kCenter,
		y = kCenter,

		OptionsWindow
		{
			x=0,y=0,w=kMax,h=kMax,

			Text
			{
				name = "optionsheader",
				label = "optionsheader",
				x=0,y=8,w=kMax,h=kMax,
				flags = kHAlignCenter + kVAlignTop,
				font = DialogHeaderFont,
			},

			Text
			{
				font = SliderFont,
				name = "sfx",
				x=105,y=40,w=50,h=50,
				flags = kHAlignCenter + kVAlignCenter,
				label = "sfxlevel"
			};

			Text
			{
				font = SliderFont,
				name = "music",
				x=345,y=40,w=50,h=50,
				flags = kHAlignCenter + kVAlignCenter,
				label = "musiclevel"
			};

			Text
			{
				font = CheckBoxFont,
				name="enabletutorialtext",
				label="enabletutorial",
				x=212,
				y=300-63,
				w=150,
				h=50,
				flags = kHAlignLeft + kVAlignCenter
			};

			Text
			{
				font = CheckBoxFont,
				name="fscreentext",
				label="fullscreen",
				x=212,
				y=300-177,
				w=150,
				h=50,
				flags = kHAlignLeft + kVAlignCenter
			};

			Text
			{
				font = CheckBoxFont,
				name="mutealltext",
				label="mutesound",
				x=212,
				y=300-117,
				w=150,
				h=50,
				flags = kHAlignLeft + kVAlignCenter
			};

			SetStyle(CloseButtonStyle);
			Button
			{
				x=kCenter+153,y=13,
				name="closebutton",
				cancel=true,
				--command = function() CloseWindow(); end;
				command = 
					function()
						SaveVolumes();
						PopModal("optionsmenu");
					end
			};

			SetStyle(CheckboxButtonStyle),
			Button{
				name="fullscreen",
				--label="fullscreen",
				x=170,
				y=130,
				w=150,
				command=
				function()
					if (ToggleFullScreen() == false) then
						DisplayDialog {
							"scripts/ok.lua",
							body ="screenswitchfailed",
							title = "playground"
						};
					end
				end

			};

			Button{
				name="mutebox",
				x=170,
				y=190,
				w=175,
				--label = "mutesound",
				command =
					function()
						ToggleSoundMute();
					end
			};

			SetStyle(ButtonStyle),

--			Button
--			{
--				x = kCenter,
--				y = kMax-115,
--				name="controlscheme",
--				label="controlscheme",
--				hotkey="",
--				type = kPush,
--				command =
--					function()
--						EnableWindow("optionsmenu",false);
--						DoModal("scripts/controlscheme.lua");
--						EnableWindow("optionsmenu",true);
--					end
--			},

			SetStyle(CheckboxButtonStyle),
			Button{
				name="enabletutorial",
				--label="enabletutorial",
				x=170,
				y=265-20,
				w=150,
				command=
				function()	
					GetTutorialMode();
				end
			};

			SetStyle(SliderStyle),
			Slider
			{
				name="sfxlevelslider",
				x = 110,
				y = 90,
				h = 190,
			};

			Slider
			{
				name="musiclevelslider",
				x = 350,
				y = 90,
				h = 190,
			};
		},
	},
}