require( "scripts/style.lua" );



InfoFont = {
  standardFont,
  30,
  BorderColor
};



MakeDialog
{

	ScreenFade
	{
		x=0,
		y=0,
		w=kMax,
		h=kMax,
		name="screenfade"
	},
	
	Bitmap
	{
		name="pausebackground",
		image="backgrounds/popup",
		x=kCenter,
		y=kCenter,
		
		Text
		{
			font = InfoFont,
			name = "gamepaused",
			x=31,y=120,w=404,h=32,
			flags = kHAlignCenter + kVAlignTop,
			label = "gamepaused"
		};
			
		
		SetStyle(StandardButtonStyle);
		Button
		{
			x=50,
			y=175,
			name="resume",
			label="resume",
			command=
				function()
					ActivatePauseClock(false);
				    PauseMusic(false);
					PauseGame(false);
					PopModal();
				end
		},
		
		Button
		{
			x=50,
			y=225,
			name="restart",
			label="restart",
			command=
				function()
					ActivatePauseClock(false);
					RestartLevel();
					PauseGame(false);
					PopModal();
				end
		},
		
		Button
		{
			x=50,
			y=275,
			name="floscloset",
			label="floscloset",
			command=
				function()
					ActivatePauseClock(false);
					ReleaseGameAssets();
					DoModalWithTip("scripts/floscloset.lua", "flosclosettip", EnterFlosCloset());
					LoadGameAssets();
					ActivatePauseClock(true);
				end
		},
		
		Button
		{
			x=240,
			y=175,
			name="help",
			label="help",
			command=
				function()
					ActivatePauseClock(false);
					ReleaseGameAssets();
					DoModal("scripts/help1.lua");
					LoadGameAssets();
					ActivatePauseClock(true);
				end
		},
		
		Button
		{
			x=240,
			y=225,
			name="options",
			label="options",
			command=
				function()
					ActivatePauseClock(false);
					DoModal("scripts/options.lua");
					ActivatePauseClock(true);
				end
		},
		
		Button
		{
			x=240,
			y=275,
			name="quit",
			label="quit",
			command=
				function()
					result = DisplayDialog { 
							"scripts/yesno.lua", 
							body ="quitconfirm",
							title = "",
					};

					if (result=='yes') then
						HandleSSSG();
						ActivatePauseClock(false);
						QuitGame(true);
						PopModal(); -- take off pause menu
						PopModal(); -- quit and restart main loop
					end
				end
		},
		SetStyle(DefaultStyle);
	},
};
ActivatePauseClock(true);
PauseMusic(true);
SetFade(kDisableFade);