require( "scripts/style.lua" );

SliderFont = {
  standardFont,
  22,
  BorderColor
};

TitleFont = {
  standardFont,
  30,
  BorderColor
};

CheckboxFont = {
  standardFont,
  20,
  BorderColor
};

ButtonFont = {
  standardFont,
  24,
  MenuRedColor
};


MakeDialog
{
	Bitmap
	{
		name="pausebackground",
		image="backgrounds/popup",
		x = kCenter,
		y = kCenter,
		
		OptionsWindow
		{
			x=0,y=0,w=kMax,h=kMax,
			
			Text
			{
				font = TitleFont,
				name = "title",
				x=kCenter,y=105,w=kMax,h=50,
				flags = kHAlignCenter + kVAlignTop,
				label = "options"
			};
			
			
			Text
			{
				font = SliderFont,
				name = "sfx",
				x=20,y=130,w=80,h=60,
				flags = kHAlignCenter + kVAlignCenter,
				label = "sfxlevel"
			};
		
			Slider
			{
				name="sfxlevelslider",
				railimage = "buttons/slider_groove.png",
				sliderimage = "buttons/slider_a.png",
				sliderrollimage = "buttons/slider_b.png",
				x = 130,
				y = 140,
			};
			
			Text
			{
				font = SliderFont,
				name = "music",
				x=20,y=180,w=80,h=60,
				flags = kHAlignCenter + kVAlignCenter,
				label = "musiclevel"
			};
			
			Slider
			{
				name="musiclevelslider",
				railimage = "buttons/slider_groove.png",
				sliderimage = "buttons/slider_a.png",
				sliderrollimage = "buttons/slider_b.png",
				x = 130,
				y = 190,
			};
			
			
			
			Button{
				graphics = CheckboxButtonGraphics,
				name="fullscreen",
				type = kToggle,
				x=50,
				y=225,
				w=150,
				Text
				{
					font = CheckboxFont,
					name = "fullscreenlabel",
					x=50,
					y=25,
					w=kMax,
					h=kMax,
					flags = kHAlignLeft + kVAlignTop,
					label="fullscreen",
				};
				command=
				function()
					if (ToggleFullScreen() == false) then
						DisplayDialog { 
							"scripts/ok.lua", 
							body ="screenswitchfailed",
							title = "" 
						};
					end
				end
				
			};
			
			Button{
				graphics = CheckboxButtonGraphics,
				name="mutebox",
				type = kToggle,
				x=225,
				y=225,
				w=225,
				Text
				{
					font = CheckboxFont,
					name = "mutesoundlabel",
					x=50,
					y=25,
					w=kMax,
					h=kMax,
					flags = kHAlignLeft + kVAlignTop,
					label="mutesound",
				};
				command =
					function()
						ToggleSoundMute();
					end
			};
			
			Button
			{
				x=50,
				y=285,
				font = ButtonFont,
				graphics = StandardButtonGraphics,
				name="credits",
				label="credits",
				type = kPush,
				command =
					function()
						DoModal("scripts/credits.lua");
					end
			},
			
			Button
			{
				x=230,
				y=285,
				font = ButtonFont,
				graphics = StandardButtonGraphics,
				name="back",
				label="ok",
				type = kPush,
				command =
					function()
						SaveVolumes();
						PopModal();
					end
			},
		},
	},
}