require( "scripts/style.lua" );

function EnableNanny( nannyNumber )

	if (nannyNumber == -1) then
		EnableWindow("nanny_0", false);
		EnableWindow("nanny_1", false);
		EnableWindow("nanny_2", false);
	end

	if (nannyNumber == 0) then
		EnableWindow("nanny_0", true);
		EnableWindow("nanny_1", false);
		EnableWindow("nanny_2", false);
	end

	if (nannyNumber == 1) then
		EnableWindow("nanny_0", false);
		EnableWindow("nanny_1", true);
		EnableWindow("nanny_2", false);
	end

	if (nannyNumber == 2) then
		EnableWindow("nanny_0", false);
		EnableWindow("nanny_1", false);
		EnableWindow("nanny_2", true);
	end

end

function FamilyNumber( familyNumber )

	if (familyNumber == 0) then
		EnableWindow("family1", false);
		EnableWindow("family2", false);
		EnableWindow("family3", false);
		EnableWindow("family4", false);
		EnableWindow("family5", false);
	end

	if (familyNumber == 1) then
		EnableWindow("family1", true);
		EnableWindow("family2", false);
		EnableWindow("family3", false);
		EnableWindow("family4", false);
		EnableWindow("family5", false);	
	end

	if (familyNumber == 2) then
		EnableWindow("family1", false);
		EnableWindow("family2", true);
		EnableWindow("family3", false);
		EnableWindow("family4", false);
		EnableWindow("family5", false);	
	end

	if (familyNumber == 3) then
		EnableWindow("family1", false);
		EnableWindow("family2", false);
		EnableWindow("family3", true);
		EnableWindow("family4", false);
		EnableWindow("family5", false);	
	end

	if (familyNumber == 4) then
		EnableWindow("family1", false);
		EnableWindow("family2", false);
		EnableWindow("family3", false);
		EnableWindow("family4", true);
		EnableWindow("family5", false);	
	end

	if (familyNumber == 5) then
		EnableWindow("family1", false);
		EnableWindow("family2", false);
		EnableWindow("family3", false);
		EnableWindow("family4", false);
		EnableWindow("family5", true);	
	end

end

MakeDialog
{
	Bitmap
	{
align=kHAlignLeft + kVAlignTop,
		name = "background",
		image = "alt_cutscenes/end/end_family_bg",
		x = 0,
		y = 0,
		scale = 1.00,
		Text
		{
			x = 69,
			y = 548,
			w = 886,
			h = 130,
			font = {
				oldsansblackFont,
				40,
				RedTextColor
			},
			label = "#"..GetString("alternative_cuts_end1", GetString("family"..gDialogTable.family)),
			flags = kHAlignCenter + kVAlignCenter,
		},
		Bitmap
		{
			name = "nanny_2",
			image = "alt_cutscenes/end/betty",
			x = 456,
			y = 111,
			scale = 1.00,
		},
		Bitmap
		{
			name = "nanny_0",
			image = "alt_cutscenes/end/claudia",
			x = 478,
			y = 164,
			scale = 1.00
		},
		Bitmap
		{
			name = "nanny_1",
			image = "alt_cutscenes/end/matilda",
			x = 474,
			y = 133,
			scale = 1.00
		},

		Bitmap
		{
			name = "family1",
			image = "alt_cutscenes/end/singletons",
			x = 305,
			y = 147,
			scale = 1.00
		},
		Bitmap
		{
			name = "family2",
			image = "alt_cutscenes/end/sagets",
			x = 287,
			y = 148,
			scale = 1.00
		},
		Bitmap
		{
			name = "family3",
			image = "alt_cutscenes/end/barnes",
			x = 279,
			y = 146,
			scale = 1.00
		},
		Bitmap
		{
			name = "family4",
			image = "alt_cutscenes/end/mendozas",
			x = 271,
			y = 136,
			scale = 1.00
		},
		Bitmap
		{
			name = "family5",
			image = "alt_cutscenes/end/nelsons",
			x = 280,
			y = 160,
			scale = 1.00
		},

		SetStyle( MenuButtonStyle ),
		Button
		{
			name = "button_next",
			x=727,
			y=500,
			graphics = MediumButton2Graphics,
			--MenuButtonLabel(50, 5, 48, 5, "next", oldsansblackFont, 24, Color(135,32,33,255), Color(44,76,60,255), Color(83,119,101,255)),
			MenuButtonLabel(0, 0, 152, 34, "next", oldsansblackFont, 24, Color(135,32,33,255), Color(44,76,60,255), Color(83,119,101,255)),
				command =
					function()
						if (gDialogTable.credits == true) then
							SwapToModal("scripts/cutscenes/end_game.lua");
						else					
							SwapToModal("scripts/map.lua");
						end
					end,
		},
	}
}

EnableNanny( gDialogTable.nanny );
FamilyNumber( gDialogTable.family );