-- wndoptions.lua

require("scripts/style.lua");
require("scripts/styles/mainmenustyle.lua");
require("scripts/styles/optionsstyle.lua");

-- Height defined in config.lua
posY = height - 198.0

MakeDialog
{
	name = "WndOptionsParent",
	
	-- Create our main credits window
	WndOptions
	{
		fit = true;

		-- Set the background image
		BlgBitmap
		{
			name = "bckgrnd",
			image = "common/screens/basics_credits/basics_background",
			--image = "common/screens/options/options_box",
			x = kCenter, y = kCenter,
			
			BlgBitmap
			{
				name = "optionsBox",
				image = "common/screens/options/options_box",
				x = kCenter, y = kCenter,
			},
						
			SetStyle(OptionsTitleStyle),
			
			Text
			{
				name = "title2",
			    x = 460, y = 280, w = 150, h = 50,
				label = "options"
			},
						
			SetStyle(OptionsTextStyle),
			
			Text
			{
			    x = 444, y = 331, w = 150, h = 50,
				label = "sfxlevel",
				name = "sfxlevel2",
			},
	
			Text
			{
			    x = 444, y = 388, w = 150, h = 50,
				label = "musiclevel",
				name = "musiclevel2",
			},
			SetStyle(OptionsFullScreenTextStyle),
		
			Text
			{
				x = 455, y = 479,
				w = kMax, h = kMax,
				flags = kHAlignLeft + kVAlignTop,
				name = "fullscreen2",
				label = "fullscreen",
			},
            
            Text
			{
				x = 425, y = 439,
				w = 180, h = kMax,
				flags = kHAlignLeft + kVAlignTop,
				name = "txtTrashCan",
				label = "enable_trashcan",
			},
	
			-- Create the volume and music level sliders
			SetStyle(OptionsSliderStyle),
		
			Slider
			{
				name = "soundVolumeSlider",
				x = 418, y = 352,
			},
	
			Slider
			{
				name = "musicVolumeSlider",
				x = 418, y = 409,
			},
	
			-- Create the checkbox for the fullscreen toggle
			SetStyle(OptionsCheckboxStyle),
			Button
			{
				x = 540.0, y = 476.0,
				name = "checkboxFullscreen",
				command = function()
						  	if ToggleFullScreen() == false then
						  		DisplayDialog {"scripts/ok.lua", body = "screenswitchfailed", title = "windowtitle"};
						  	end
					      end
			},
            
            Button
			{
				x = 576.0, y = 446.0,
				name = "checkboxTrashCan",
				command = function()
					      end
			},

			-- Create the back and credit buttons
				
			SetStyle(GreenButtonStyle),
			
			BlgButton
			{
				x = 520, y = 510,
				width = 300, height = 300,
			    name = "backtogame",
			    label = "backtogame",
			    positionMatrix = { x = 10, y = 10 },
			    labelMatrix = { x = 0, y = 0 } ,
			    graphics = {
					"common/screens/options/options_button",
					"",
					"",
					"",
				},
				close = true,
			    command =
			        function()
			        	FadeOut();
			        	SaveVolumeLevels();
                        ToggleTrashCan();
			        end
			},
			
			BlgButton
			{
				x = 353, y = 508,
				width = 300, height = 300,
			    name = "credits",
			    label = "credits",
			    positionMatrix = { x = 10, y = 10 },
			    labelMatrix = { x = 0, y = 0 } ,
			    graphics = {
					"common/screens/options/options_button",
					"",
					"",
					"",
				},
			    command =
			        function()
			        	SaveVolumeLevels()
			        	DoModalWithTransition("wndcredits.lua")
			        end
			},
			
		}
	}
}
