--============================================================================
--  options.lua
--  Copyright (c) 2010; Bamtang Games. All Rights Reserved.
------------------------------------------------------------------------------
require("scripts/style.lua");

MakeDialog {
    -- Name the modal dialog
    name="OptionsDialog";

    Bitmap {
        name = "bmpBgAlpha";
        image = "gpx/screens/transparent_background";
        x = 0; y = 0;
        alpha = true;
    };

    wndMove {
        x = kCenter; y = kCenter;
		w = kMax; h = kMax;
		swtOptionsDialog {
			x = 0; y = 0;
			w = kMax; h = kMax;

			Bitmap {
				image = "gpx/screens/panel02";
				name = "bmpPanelContainer";
				x = kCenter; y = kCenter;

				Bitmap {
					image = "gpx/screens/trophy_icon_01";
					x = 19;
					y = 3;
				};

				Bitmap {
					image = "gpx/screens/trophy_icon_02";
					x = 416;
					y = 3;
				};

				clsText {
					name = "lblTitle";
					font = Font58;
					flags = kHAlignCenter + kVAlignCenter;
					label = "lblOptionsTitle";
					x = kCenter; y = 31;
					w = 400; h = 70;
					Scale = 0.6;
					Space = -10;
				};

				Text {
					font = Font32;
					name = "lblMusic";
					x = 31; y = 119;
					w = 150; h = 50;
					flags = kHAlignLeft;
					label = "lblMusicLevel";
				};
				Bitmap {
					image = "gpx/screens/sign_minus";
					x = 136;
					y = 118;
				};
				Bitmap {
					image = "gpx/screens/sign_plus";
					x = 480;
					y = 118;
				};

				Text {
					font = Font32;
					name = "lblSound";
					flags = kHAlignLeft;
					label = "lblSoundLevel";
					x = 31; y = 177;
					w = 150; h = 50;
				};
				Bitmap {
					image = "gpx/screens/sign_minus";
					x = 136;
					y = 180;
				};
				Bitmap {
					image = "gpx/screens/sign_plus";
					x = 480;
					y = 180;
				};

				SetStyle(SliderStyle);
				Slider {
					name = "sliderMusicLevel";
					x = 168; y = 115;
					w = 305;
				};

				Slider {
					name = "sliderSoundLevel";
					x = 168; y = 176;
					w = 305;
				};

				SetStyle(CheckboxButtonStyle);
				Button {
					name = "chkFullScreen";
					label = "lblFullscreen";
					font = Font32;
					x = 147; y = 238;
					w = 260;
					command = 
						function()
							if (gsw_toggleFullScreen() == false) then
								DisplayDialog {
									"scripts/ok.lua";
									body ="screenswitchfailed";
									title = ""
								};
							end
						end
				};

	--[[
				Button {
					name = "chkAudioMute";
					x = 280;
					y = 224;
					w = 240;
					label = "mutesound";
					command =
						function()
							gsw_toggleSoundMute();
						end
				};
	--]]
				SetStyle(OptionButtonStyle);
				Button {
					x = 106; y = 301;
					name = "back";
					label = "btnBack";
					cancel = true;
					command =
						function()
							gfn_saveVolumeLevels();
							PopModal("OptionsDialog");
						end
				};

				Button {
					x = 283; y = 301;
					name = "credits";
					label = "btnCredits";
					font = Font18;
					command =
						function()
							DoModal("scripts/credits.lua");
						end
				};
			};
		};
	};
}
