require( "scripts/style.lua" );

kButtonSpacing = 60;	-- Put our buttons 60 pixels apart
kButtonY = kCenter-30;	-- Three buttons means center 60 pixels above the center

-- When this dialog is popped up, we're entering pause state, so
-- let's just notify TGameState now.

MakeDialog
{
	-- Name the modal dialog
	name="playmenu",
	Bitmap
	{
		image="backgrounds/dialog",
		x=kCenter,
		y=kCenter,

		Bitmap
		{
			image="backgrounds/header_mode",
			x=20,
			y=28
		},
		
		SetStyle(ButtonStyle),

		Button
		{
			x=kCenter,
			y=kButtonY,
			label="continue",
			close=true,
			command=
				function()
					SetCurrentGameMode(GetCurrentGameMode());
					ModalReturn(1);
				end
		},

		Button
		{
			x=kCenter,
			y=kButtonY + (kButtonSpacing * 1),
			label="startnew",
--			close=true,
			command=
				function()
					result=DisplayDialog {"scripts/yesnonew.lua", body="areyousure", title=""};
					PopModal("playmenu");
					if (result == 'yes') then
						ModalReturn(2);
					else
						ModalReturn(0);
					end
				end
		},

		Button
		{
			x=kCenter,
			y=kButtonY + (kButtonSpacing * 2),
			name="cancel",
			label="cancel",
			close = true,	-- Just close this window
			cancel=true,
			command=
				function()
					ModalReturn(0);
				end
			-- command=
			--	function()
	        --        SetState( kPause, false );
			--	end;

		},
	},
}