require "scripts/style"

SliderFont = {
  standardFont,
  15,
  BlackColor
};


MakeDialog
{
	-- Name the modal dialog
	name="optionsmenu",
	Bitmap
	{
		image="backgrounds/options",
		x = kCenter+2,
		y = kCenter+7,
		OptionsWindow
		{
align=kHAlignLeft + kVAlignTop,
			x=-1,y=0,w=kMax,h=kMax,
			Text
			{
				font = SliderFont,
				name = "sfx",
				x=36,y=70,w=50,h=50,
				flags = kHAlignCenter + kVAlignCenter,
				label = "sfxlevel"
			};
			Text
			{
				font = SliderFont,
				name = "music",
				x=36,y=115,w=50,h=50,
				flags = kHAlignCenter + kVAlignCenter,
				label = "musiclevel"
			};
			SetStyle(CheckboxButtonStyle),
			Button{
				name="fullscreen",
				label="fullscreen",
				x=45,
				y=172,
				w=150,
				command=
				function()
					if (ToggleFullScreen() == false) then
						DisplayDialog {
							"scripts/ok.lua",
							body ="screenswitchfailed",
							title = "playground"
						};
					end
				end
			};
			Button{
				name="mutebox",
				x=190,
				y=172,
				w=175,
				label = "mutesound",
				command =
					function()
						ToggleSoundMute();
					end
			};
			SetStyle(ButtonStyle),
			Button
			{
				x = kCenter-103,
				y = kMax-80,
				name="back",
				label="back",
				cancel=true,
				default=true,
				type = kPush,
				command =
					function()
						SaveVolumes();
						PopModal("optionsmenu");
					end
			},
			Button
			{
				x = kCenter+103,
				y = kMax-80,
				name="credits",
				label="creditsbutton",
				type = kPush,
				command =
					function()
						DoModal("scripts/credits.lua");
					end
			},

			SetStyle(SliderStyle),
			Slider
			{
				name="sfxlevelslider",
				x = 92,
				y = 78,
				w = 270,
			};
			Slider
			{
				name="musiclevelslider",
				x = 92,
				y = 123,
				w = 270,
			};
		},
		SetStyle(DefaultStyle),
		Text
		{
			name = "optstitle",
			label = "options",
			x = 50,
			y = 40,
			w = 302,
			h = 45,
			font = DialogTitleFont,
			flags = kHAlignCenter+kVAlignTop,
		}
	},
}
