
require( "scripts/style.lua" );

Paused(0)

MetricsMode(5);

ScreenColor = Color(255,255,255,255);
InsFont = {
	standardFont,
	22,
	ScreenColor
};

MakeDialog
{
	Bitmap
	{ 
		name="backgroundimage",
		image="Game/Textures/Map/Map01.jpg",	
	},

	StoryMap
	{ 
		x=0,
		y=0,
		w=800,
		h=600,

		Button
		{
			x=635,
			y=535,
			font = StandardButtonFont,
			graphics = StandardButtonGraphics,
			name="play",
			label="play",
			type = kPush,
			command=
				function()
					StartGame();
				end
		},

		Button
		{
			x=435,
			y=535,
			font = StandardButtonFont,
			graphics = LongButtonGraphics,
			name="backtomenu",
			label="backtomenu",
			type = kPush,
			command=
				function()
					if (AllowedToPause()) then
						Paused(1);
						
						if (QuitStraightOutOfMap() == 1) then
						
							SwapToModal("scripts/mainmenu.lua");
							
						else

							DebugOut( "QuitYesNo : Calling" );
							result = DisplayDialog { 
								"scripts/yesno.lua", 
								body ="quitsaveconfirm",
								title = "quitsavetitle" 
							};
							
							DebugOut( "QuitYesNo : Output = (On Next Line)");
							DebugOut( result);
							
							
							if (result=='yes') then
							
								DebugOut( "QuitYesNo : Yes !" );
							
								QuitStoryMap();
								Paused(0);
								
								--PopModal();
								SwapToModal("scripts/mainmenu.lua");						
							end		
						end		
						
						Paused(0);
					end
				end
		},	
       
		StoryMapFade
		{ 
			x=0,
			y=0,
			w=800,
			h=600,	
		}		
	}		
	
}

function ContinueToGame ( )
	
	if (DoInstructions() == 1) then
		InstructionsOn(2);
		DoModal("scripts/instructions.lua");
		InstructionsOn(0);
	end
	
	--PopModal();
	SwapToModal("scripts/game.lua");
end
