require( "scripts/style.lua" );

kDayImageX = 460;
kDayImageY = 247;
kDayImageSpacing = 58;

kDayNumberX = 22;
kDayNumberY = 33;
kDayNumberW = 60;
kDayNumberH = 60;

kNannyImageX = 542;
kNannyImageY = 436;
kNannyImageSpacing = 89;

kFamilyImageX = 234;
kFamilyImageY = 37;
kFamilyImageSpacing = 124;

kPlayerDay = GetPlayerDay();

DayTextFont = {
  trebuchetmsFont,
  14,
  BlackColor
};

TimeTextFont = {
  minionproFont,
  20,
  BlackColor
};


-- Our game set up
MakeDialog
{
	-- Name the modal dialog
	name="Briefing",
	Briefing
	{
		
		lDayImageX = kDayImageX-2;
		lDayImageY = kDayImageY-2;
		lDayImageSpacing = kDayImageSpacing;
		loadingVelDown = 18;
		w = 1024,
		h = 768,
		
		Bitmap(FamilySymbol(142,134,5)),
		Bitmap(FamilySymbol(142,228,4)),
		Bitmap(FamilySymbol(142,322,3)),
		Bitmap(FamilySymbol(142,417,2)),
		Bitmap(FamilySymbol(142,511,1)),
		
		Button(FamilyButton(142,134,5)),
		Button(FamilyButton(142,228,4)),
		Button(FamilyButton(142,322,3)),
		Button(FamilyButton(142,417,2)),
		Button(FamilyButton(142,511,1)),
					
		Text
		{
			name = "familyname",
			x = 434,
			y = 124,
			w = 459,
			h = 105,
			font = {
				oldsansblackFont,
				65,
				BlackColor
			},
			--label = "family1",
			flags = kHAlignCenter + kVAlignCenter;
		},
		--[[
		Bitmap
		{
			name="familyphoto",
			--image="gui/briefing/Singletons",
			x=145,
			y=250,
		},
		Text
		{
			name = "familydescription",
			x = 156,
			y = 461,
			w = 274,
			h = 129,
			font = {
				oldsansblackFont,
				16,
				BlackColor
			},
			--label = "family1description",
		},
		--]]
		
		Bitmap(GrayCalendar(kDayImageX + kDayImageSpacing*0, kDayImageY, 1)),
		Bitmap(GrayCalendar(kDayImageX + kDayImageSpacing*1, kDayImageY, 2)),
		Bitmap(GrayCalendar(kDayImageX + kDayImageSpacing*2, kDayImageY, 3)),
		Bitmap(GrayCalendar(kDayImageX + kDayImageSpacing*3, kDayImageY, 4)),
		Bitmap(GrayCalendar(kDayImageX + kDayImageSpacing*4, kDayImageY, 5)),
		Bitmap(GrayCalendar(kDayImageX + kDayImageSpacing*5, kDayImageY, 6)),
		Bitmap(GrayCalendar(kDayImageX + kDayImageSpacing*6, kDayImageY, 7)),
		
		Bitmap
		{
			name="daycurrent",
			image="gui/briefing/tab",
			x=kDayImageX-2 + kDayImageSpacing*kPlayerDay,
			y=kDayImageY-2,
			Text
			{
				name = "day",
				font = DayTextFont,		
				x=kDayNumberX,
				y=kDayNumberY,
				w=kDayNumberW,
				h=kDayNumberH,
				flags = kHAlignLeft + kVAlignTop,
				label="#<b><i>"..(kPlayerDay+1).."</b></i>"
			},			
		},
		
		Bitmap(Calendar(kDayImageX + kDayImageSpacing*0, kDayImageY, 1)),
		Bitmap(Calendar(kDayImageX + kDayImageSpacing*1, kDayImageY, 2)),
		Bitmap(Calendar(kDayImageX + kDayImageSpacing*2, kDayImageY, 3)),
		Bitmap(Calendar(kDayImageX + kDayImageSpacing*3, kDayImageY, 4)),
		Bitmap(Calendar(kDayImageX + kDayImageSpacing*4, kDayImageY, 5)),
		Bitmap(Calendar(kDayImageX + kDayImageSpacing*5, kDayImageY, 6)),
		Bitmap(Calendar(kDayImageX + kDayImageSpacing*6, kDayImageY, 7)),			
		
		Bitmap(Balloon(kDayImageX + kDayImageSpacing*kPlayerDay + 32,kDayImageY - 15,"new2")),
		
		Button(DayButton(kDayImageX + kDayImageSpacing*0, kDayImageY, 1)),
		Button(DayButton(kDayImageX + kDayImageSpacing*1, kDayImageY, 2)),
		Button(DayButton(kDayImageX + kDayImageSpacing*2, kDayImageY, 3)),
		Button(DayButton(kDayImageX + kDayImageSpacing*3, kDayImageY, 4)),
		Button(DayButton(kDayImageX + kDayImageSpacing*4, kDayImageY, 5)),
		Button(DayButton(kDayImageX + kDayImageSpacing*5, kDayImageY, 6)),
		Button(DayButton(kDayImageX + kDayImageSpacing*6, kDayImageY, 7)),
		
		Text
		{
	  		font = {
				oldsansblackFont,
				20,
				BlackColor
			},
	  		x=479,
	  		y=328,
	  		w = 199,
	  		h = 24,
	  		label="newtrouble"		  	
		},
		
		Text
		{
			name = "troubledescription",
	  		font = {
				oldsansblackFont,
				16,
				BlackColor
			},
	  		x=479,
	  		y=352,
	  		w = 199,
	  		h = 68,
	  		--label="troubledescription11"		  	
		},
		
		Text
		{
	  		font = {
				oldsansblackFont,
				20,
				BlackColor
			},
	  		x=709,
	  		y=335,
	  		w = 199,
	  		h = 68,
	  		label="perfecttime"		  	
		},
		
		Text
		{
	  		name="perfecttime",
	  		font = TimeTextFont,		
	  		x=715,
	  		y=358,
	  		w = 100,
	  		h = 100,
	  		--label="#<b>3 minutes</b>"		  	
		},
		
		Text
		{
	  		font = {
				oldsansblackFont,
				20.,
				BlackColor
			},
	  		x=709,
	  		y=378,
	  		w = 199,
	  		h = 68,
	  		label="goodtime"		  	
		},
		
		Text
		{
	  		name="goodtime",
	  		font = TimeTextFont,		
	  		x=715,
	  		y=402,
	  		w = 100,
	  		h = 100,
	  		--label="#5 minutes"		  	
		},
		
		Bitmap
		{
			name="nanny1",
			image="gui/briefing/nanny01",
			x=kNannyImageX + kNannyImageSpacing*0,
			y=kNannyImageY,
		},
		Bitmap
		{
			name="nanny2",
			image="gui/briefing/nanny02",
			x=kNannyImageX + kNannyImageSpacing*1,
			y=kNannyImageY,
		},
		Bitmap
		{
			name="nanny3",
			image="gui/briefing/nanny03",
			x=kNannyImageX + kNannyImageSpacing*2,
			y=kNannyImageY,
		},
		SetStyle( MenuButtonStyle ),
		Button
		{
			name = "briefingback",
			x=131,
			y=719,
			graphics = MediumButton2Graphics,
			--MenuButtonLabel(50, 5, 48, 5, "back", oldsansblackFont, 24, Color(135,32,33,255), Color(44,76,60,255), Color(83,119,101,255)),
			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()
					if(ShouldGoToMainMenu()) then
						SwapToModal("scripts/mainmenu.lua");
					else
						SwapToModal("scripts/nannyselection.lua");
					end
				end
		},	
		Button
		{
			name = "briefingstart",
			x=537,
			y=528,
			graphics = BigButtonGraphics,
			--MenuButtonLabel(80, 10, 78, 10, "start", oldsansblackFont, 36, Color(135,32,33,255), Color(44,76,60,255), Color(83,119,101,255)),
			MenuButtonLabel(0, 0, 255, 56, "start", oldsansblackFont, 36, Color(135,32,33,255), Color(44,76,60,255), Color(83,119,101,255)),
			command=
				function()
					EnableWindow("briefingstart", false);
					StartLoadingAnimation();
					while not FinishedAnimation() do
						Yield();
					end
					SwapToModal("scripts/gamescreen.lua");
					--SwapToModal("scripts/gamestatus.lua");
				end
		},
	}
}
