require( "scripts/style.lua" );

SliderFont = {
  standardFont,
  16,
  BlackColor
};

CheckFont = {
  standardFont,
  22,
  BlackColor
};

by = 95

MetricsMode(6);

MakeDialog
{
	Bitmap
	{
		name="pausebackground",
		image="backgrounds/submitdialog",
		x = kCenter,
		y = kCenter,
		
		OptionsWindow
		{
			x=0,y=0,w=kMax,h=kMax,
			
			Text
			{
				font = DialogTitleFont,
				name = "gameoptions",
				label= "gameoptions",
				x=12, y=by+9,
				w=kMax-12,h=40,
				flags = kVAlignCenter + kHAlignCenter,
			};
						
			Text
			{
				font = SliderFont,
				name = "sfx",
				x=85,y=by+65+5,w=50,h=50,
				flags = kHAlignCenter + kVAlignCenter,
				label = "sfxlevel"
			};
		
			Slider
			{
				name="sfxlevelslider",
				railimage = "buttons/sliderrail.png",
				sliderimage = "buttons/sliderknob.png",
				sliderrollimage = "buttons/sliderknobover.png",
				x = 145,
				y = by+65,
			};
			
			Text
			{
				font = SliderFont,
				name = "music",
				x=85,y=by+115+5,w=50,h=50,
				flags = kHAlignCenter + kVAlignCenter,
				label = "musiclevel"
			};
			
			Slider
			{
				name="musiclevelslider",
				railimage = "buttons/sliderrail.png",
				sliderimage = "buttons/sliderknob.png",
				sliderrollimage = "buttons/sliderknobover.png",
				x = 145,
				y = by+115,
			};
			
			
			
			Button{
				graphics = CheckboxButtonGraphics,
				name="fullscreen",
				type = kToggle,
				x=80,
				y=by+175,
				w=350,
				Text
				{
					font = CheckFont,
					name = "fullscreenlabel",
					x=50,
					y=18,
					w=kMax,
					h=kMax,
					flags = kHAlignLeft + kVAlignTop,
					label="fullscreen",
				};
				command=
				function()
					if (ToggleFullScreen() == false) then
						DisplayDialog { 
							"scripts/ok.lua", 
							body ="screenswitchfailed",
							title = "playground" 
						};
					end
				end
				
			};
			
			Button{
				graphics = CheckboxButtonGraphics,
				name="mutebox",
				type = kToggle,
				x=80,
				y=by+225,
				w=350,
				Text
				{
					font = CheckFont,
					name = "mutesoundlabel",
					x=50,
					y=18,
					w=kMax,
					h=kMax,
					flags = kHAlignLeft + kVAlignTop,
					label="mutesound",
				};
				command =
					function()
						ToggleSoundMute();
					end
			};
			
			
			
			Button{
				graphics = CheckboxButtonGraphics,
				name="noscroll",
				type = kToggle,
				x=80,
				y=by+275,
				w=350,
				Text
				{
					font = CheckFont,
					name = "noscrolllabel",
					x=50,
					y=18,
					w=kMax,
					h=kMax,
					flags = kHAlignLeft + kVAlignTop,
					label="noscroll",
				};
				command=
				function()
					ToggleNoScroll();
				end
				
			};
			
			
			
			Button
			{
				x=90,
				y=by+340,
				font = StandardButtonFont,
				graphics = StandardButtonGraphics,
				name="back",
				label="back",
				type = kPush,
				command =
					function()
						SaveVolumes();
						PopModal();
					end
			},
			
			Button
			{
				x=260,
				y=by+340,
				font = StandardButtonFont,
				graphics = StandardButtonGraphics,
				name="credits",
				label="credits",
				type = kPush,
				command =
					function()
						DoModal("scripts/credits.lua");
						MetricsMode(6);
					end
			},
		},
	},
}