require( "scripts/style.lua" );



InfoFont = {
  standardFont,
  30,
  BorderColor
};

function InstantQuit( )
	DebugOut("InstantQuit!");
	ActivatePauseClock(false);
	QuitGame(true);
	PopModal(); -- pop off quit menu
	PopModal(); -- take off pause menu
	-- the main game will get popped off by the quit dialog returning 
end

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 = "choosecharacter",
			x=31,y=120,w=404,h=32,
			flags = kHAlignCenter + kVAlignTop,
			label = "choosecharacter"
		};
		
		AnimWindow
		{
			x = 140,
			y = 220,
			anim = "spongebob/idle.anm",
			texture = "idle.png",
			script = "SelectAnim",
		};	
		
		AnimWindow
		{
			x = 320,
			y = 220,
			anim = "patrick/idle.anm",
			texture = "idle.png",
			script = "SelectAnim",
		};	
		
		Button
		{
			x=50,
			y=275,
			font = StandardButtonFont,
			graphics = StandardButtonGraphics,
			name="character1",
			label="character1",
			type = kPush,
			command=
				function()
					SetMainCharacter(0);
					UpdateAnimationChange();
					ActivatePauseClock(false);
				    PauseMusic(false);
					PauseGame(false);
					PopModal();
				end
		},
		
		Button
		{
			x=240,
			y=275,
			font = StandardButtonFont,
			graphics = StandardButtonGraphics,
			name="character2",
			label="character2",
			type = kPush,
			command=
				function()
					SetMainCharacter(1);
					UpdateAnimationChange();
					ActivatePauseClock(false);
				    PauseMusic(false);
					PauseGame(false);
					PopModal();
				end
		},
		
	},
};
ActivatePauseClock(true);
PauseMusic(false);
SetFade(kDisableFade);