require( "scripts/style.lua" );

-- Our game set up
MakeDialog
{
	-- Name the modal dialog
	name="NannySelection",
	NannySelection
	{
		w = 1024,
		h = 768,
		
		Text
		{
			x = 150,
			y = 94,
			w = 406,
			h = 48,
			font = {
				oldsansblackFont,
				20,
				RedTextColor
			},
			label = "choosenanny",
			flags = kHAlignCenter + kVAlignCenter,
		},	
		
			
		Button
		{
			name = "nanny1",
			type = kToggle,
			x=191,
			y=133,
			w=458,
			h=197,
			sound = "audio/sfx/select_nanny.ogg",
			graphics = {
				"gui/nannyselection/nanny1_normal",
				"gui/nannyselection/nanny1_hit",
				"gui/nannyselection/nanny1_mouse_on",
				"gui/nannyselection/nanny1_hit",
			},	
			command=
				function()
                    ToggleNanny(0);
				end,
			Text
			{
				x = 172,
				y = 16,
				w = 252,
				h = 32,
				font = {
					oldsansblackFont,
					25,
					BlackColor
				},
				label = "nanny1",
				flags = kVAlignCenter,
			},	
			Text
			{
				x = 172,
				y = 49,
				w = 252,
				h = 86,
				font = {
					oldsansblackFont,
					16,
					BlackColor
				},
				label = "nanny1description",
			},	
			Text
			{
				x = 172,
				y = 135,
				w = 252,
				h = 24,
				font = {
					oldsansblackFont,
					20,
					BlackColor
				},
				label = "nanny1power",
				flags = kVAlignCenter,
			},	
		},
		Button
		{
			name = "nanny2",
			type = kToggle,
			x=221,
			y=312,
			w=428,
			h=201,
			sound = "audio/sfx/select_nanny.ogg",
			graphics = {
				"gui/nannyselection/nanny2_normal",
				"gui/nannyselection/nanny2_hit",
				"gui/nannyselection/nanny2_mouse_on",
				"gui/nannyselection/nanny2_hit",
			},	
			command=
				function()
				    ToggleNanny(1);
				end,
			Text
			{
				x = 13,
				y = 45,
				w = 252,
				h = 32,
				font = {
					oldsansblackFont,
					25,
					BlackColor
				},
				label = "nanny2",
				flags = kVAlignCenter,
			},	
			Text
			{
				x = 13,
				y = 78,
				w = 252,
				h = 86,
				font = {
					oldsansblackFont,
					16,
					BlackColor
				},
				label = "nanny2description",
			},	
			Text
			{
				x = 13,
				y = 164,
				w = 252,
				h = 24,
				font = {
					oldsansblackFont,
					20,
					BlackColor
				},
				label = "nanny2power",
				flags = kVAlignCenter,
			},	
		},
		Button
		{
			name = "nanny3",
			type = kToggle,
			x=189,
			y=519,
			w=434,
			h=179,
			sound = "audio/sfx/select_nanny.ogg",
			graphics = {
				"gui/nannyselection/nanny3_normal",
				"gui/nannyselection/nanny3_hit",
				"gui/nannyselection/nanny3_mouse_on",
				"gui/nannyselection/nanny3_hit",
			},	
			command=
				function()
                    ToggleNanny(2);
				end,
			Text
			{
				x = 172,
				y = 16,
				w = 252,
				h = 32,
				font = {
					oldsansblackFont,
					25,
					BlackColor
				},
				label = "nanny3",
				flags = kVAlignCenter,
			},	
			Text
			{
				x = 172,
				y = 49,
				w = 252,
				h = 86,
				font = {
					oldsansblackFont,
					16,
					BlackColor
				},
				label = "nanny3description",
			},	
			Text
			{
				x = 172,
				y = 135,
				w = 252,
				h = 24,
				font = {
					oldsansblackFont,
					20,
					BlackColor
				},
				label = "nanny3power",
				flags = kVAlignCenter,
			},	
		},
		SetStyle( MenuButtonStyle ),
		Button
		{
			name = "nannyselectionback",
			x=168,
			y=715,
			graphics = MediumButton2Graphics,
			MenuButtonLabel(0, 0, 152, 34, "back", oldsansblackFont, 24, Color(135,32,33,255), Color(44,76,60,255), Color(83,119,101,255)),
			command=
				function()
					DeselectNanny();
					SwapToModal("scripts/familyintroduction.lua");
				end
		},
		Button
		{
			name = "nannyselectionok",
			x=398,
			y=698,
			graphics = BigButtonGraphics,
			MenuButtonLabel(0,0,255,56, "ok", oldsansblackFont, 36, Color(135,32,33,255), Color(44,76,60,255), Color(83,119,101,255));
			command=
				function()
					EnableWindow("nannyselectionok", false);
					EnableWindow("nannyselectionback", false);
					EnableWindow("nanny1", false);					
					EnableWindow("nanny2", false);
					EnableWindow("nanny3", false);
					
					ReadFile("scripts/splashback.lua");
					
					if (not SelectNanny()) then					
						while IsCutscenePlaying() do
							Yield();
						end
					else
						DisplayDialog{"scripts/cutscenes/intro1.lua", nanny=GetSelectedNanny(), family=GetSelectedFamily()};
					end
					
					
					--EraseCutscene();
					
					SwapToModal("scripts/gamescreen.lua");
					--SwapToModal("scripts/briefing.lua");
				end
		},	
	}
}
