require( "scripts/style.lua" );

SliderFont = {
  standardFont,
  16,
  BlackColor
};


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

		OptionsWindow
		{
			Bitmap
			{
				image="backgrounds/header_options",
				x=20,
				y=28
			};
			
			x=0,y=0,w=kMax,h=kMax,

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

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

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

			};

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

			SetStyle(ButtonStyle),
			Button
			{
				x = kCenter-80,
				y = kMax-75,
				name="back",
				label="back",
				cancel=true,
				default=true,
				type = kPush,
				command =
					function()
						SaveVolumes();
						PopModal("optionsmenu");
					end
			},

			Button
			{
				x = kCenter+80,
				y = kMax-75,
				name="credits",
				label="creditsbutton",
				type = kPush,
				command =
					function()
						DoModal("scripts/credits.lua");
					end
			},

			SetStyle(SliderStyle),
			Slider
			{
				name="sfxlevelslider",
				x = 100,
--				y = 50,
				y = 90,
				w = 270,
			};

			Slider
			{
				name="musiclevelslider",
				x = 100,
--				y = 120,
				y = 130,
				w = 270,
			};
		},
	},
}