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.
SetState( kPause, true );

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

		Bitmap
		{
			image="backgrounds/header_pause",
			x=20,
			y=28
		},
		
		SetStyle(ButtonStyle),
		Button
		{
			x=kCenter,
			y=kButtonY,
			name="resume",
			label="resume",
			close = true,	-- Just close this window
			cancel=true,
			command=
				function()
	                SetState( kPause, false );
				end;

		},

		Button
		{
			x=kCenter,
			y=kButtonY + (kButtonSpacing * 1),
			label="optionsbutton",
			command=
				function()
					-- Pop up an options screen
					DoModal("scripts/options.lua");
				end
		},

		Button
		{
			x=kCenter,
			y=kButtonY + (kButtonSpacing * 2),
			label="quit",
			command=
				function()
					result = DisplayDialog {
						"scripts/yesnoexit.lua",
						body ="backtomain",
						title = "backmain"
					};
					if (result=='yes') then
						SendGameMessage("quit");
					end
				end
--			command=
--				function()
--					PopModal('pausemenu');
--					DoModal('scripts/gameover.lua');
					-- Our game processes this message--it's not
					-- handled by Playground
--                  SendGameMessage( "quit" );
--	                SetState( kPause, false );
--				end
		},
	},
}