require( "scripts/style.lua" );

MakeDialog
{
	-- Name the modal dialog
	name="GameMenu",
	Bitmap
	{
		image="backgrounds/game_menu",
		x = kCenter,
		y = kCenter-40,
		
		GameMenu
		{
			x=0,y=0,w=kMax,h=kMax,
			SetStyle(ButtonStyle),

			Button
			{
				x = kCenter, y = 20,
				name="resume",
				parent = DefaultStyle,
				sound = kDefaultButtonSound, type= kPush,
				graphics = {"buttons/gmenu/b_resume",	"buttons/gmenu/b_resume_pressed",	"buttons/gmenu/b_resume_mouseover"},
				command =
					function()
						PopModal("GameMenu");
						if(not(StartLighting == nil)) then
							StartLighting();
						end	
						if(not(StartLightingMG == nil)) then
							StartLightingMG();
						end	
					end
			},

			Button
			{
				x = kCenter, y = 90,
				name="options",
				parent = DefaultStyle,
				sound = kDefaultButtonSound, type= kPush,
				graphics = {"buttons/gmenu/b_options",	"buttons/gmenu/b_options_pressed",	"buttons/gmenu/b_options_mouseover"},
				command =
					function()
						DoModal("scripts/options.lua");
					end
			},
			
			Button
			{
				x = kCenter, y = 160,
				name="replay",
				parent = DefaultStyle,
				sound = kDefaultButtonSound, type= kPush,
				graphics = {"buttons/gmenu/b_replay",	"buttons/gmenu/b_replay_pressed",	"buttons/gmenu/b_replay_mouseover"},
				command =
					function()
						 -- SetNameComicsToRun("tutor.xml");
						 -- DoModal("scripts/tutor.lua");
						 DoModal("scripts/askreplay.lua");
					end
			},
			
			Button
			{
				x = kCenter, y = 230,
				name="map",
				parent = DefaultStyle,
				sound = kDefaultButtonSound, type= kPush,
				graphics = {"buttons/gmenu/b_map",	"buttons/gmenu/b_map_pressed",	"buttons/gmenu/b_map_mouseover"},
				command =
					function()
						-- PopModal("GameMenu");
						-- if(not(StartLighting == nil)) then
							-- ProcessGameClose();
							-- CSWithSh("MainGame", "scripts/map.lua");
						-- end	
						-- if(not(StartLightingMG == nil)) then
							-- CSWithSh(gCurrMiniGameName, "scripts/map.lua");
						-- end	
						
						-- DoModal("scripts/shadow.lua");
						DoModal("scripts/askgame2map.lua");
					end
			},
			
			Button
			{
				x = kCenter, y = 300,
				name="back",
				parent = DefaultStyle,
				sound = kDefaultButtonSound, type= kPush,
				graphics = {"buttons/gmenu/b_menu",	"buttons/gmenu/b_menu_pressed",	"buttons/gmenu/b_menu_mouseover"},
				command =
					function()
						-- PopModal("GameMenu");
						-- if(not(StartLighting == nil)) then
							-- ProcessGameClose();
							-- CSWithSh("MainGame", "scripts/mainmenu.lua");
						-- end	
						-- if(not(StartLightingMG == nil)) then
							-- CSWithSh(gCurrMiniGameName, "scripts/mainmenu.lua");
						-- end	
						
						-- DoModal("scripts/shadow.lua");
						DoModal("scripts/askgame2mmenu.lua");
					end
			},
			
		},
	},
}

