require( "scripts/style.lua" );

kButtonSpacing = 57;	-- Put our buttons 60 pixels apart
kButtonY = kCenter-60;	-- 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.
SetPauseState( true );

MakeDialog
{
	-- Name the modal dialog
	name="pausemenu",
	Bitmap
	{
		image="screens/title/popup/transparent.png",
		
		alpha=true,

		PauseWindow {
		
			name = "PauseWindow",
			x=kCenter,
			y=kCenter,
			
			w=1024,
			h=768,
			
			SetStyle(MenuButtonStyle),
			Button
			{
				x=336,
				y=300,
				name="resumebutton",
				MenuButtonLabel("resume"),
				close = true,	-- Just close this window
				mask = "screens/title/popup/resume_mask.png",
				graphics = {
					"screens/title/popup/resume_off.png",
					"screens/title/popup/resume_on.png",
					"screens/title/popup/resume_off.png",
				},
				command=
					function()
						SetPauseState( false );
					end;

			},

			Button
			{
				x=335,
				y=300 + (kButtonSpacing * 1),
				name="optionsbutton",
				MenuButtonLabel("optionsbutton"),
				--close = true,	-- Just close this window
				--cancel=true,
				mask = "screens/title/popup/option_mask.png",
				graphics = {
					"screens/title/popup/option_off.png",
					"screens/title/popup/option_on.png",
					"screens/title/popup/option_off.png",
				},
		 		command=
		 			function()
		 				SetPauseState( false );
		 				DoModal('scripts/optionswindow.lua');
		 			end
			},

			Button
			{
				x=336,
				y=300 + (kButtonSpacing * 2),
				MenuButtonLabel("quit"),
				mask = "screens/title/popup/leave_game_mask.png",
				graphics = {
					"screens/title/popup/leave_game_off.png",
					"screens/title/popup/leave_game_on.png",
					"screens/title/popup/leave_game_off.png",
				},
				command=
					function()
						result = DisplayDialog {
							"scripts/yesno.lua",
							body ="quitconfirm",
							title = "quittitle"
						};
						if (result=='yes') then
							PostMessage( CreateNamedMessage( kQuitNow, "Quit" ) );
						end
					end
			},
		},
	},
}