require( "scripts/style.lua" );

LastTimeTextFont = {
  minionproFont,
  36,
  BlackColor
};


-- Our game set up
MakeDialog
{
	-- Name the modal dialog
	name="gamestatus",
	Bitmap
	{
align=kHAlignLeft + kVAlignTop,
		name = "bg",
		image = "backgrounds/back",
		x = 0,
		y = 0,
		alpha = 0.99,
	},
	GameStatus
	--Bitmap
	{
align=kHAlignLeft + kVAlignTop,
		--image = "backgrounds/gamestatus_bg",
		x = 0,
		y = 0,
		w = 1024,
		h = 768,
		alpha = 0.99,
		Text
		{
			x = 527,
			y = 102,
			w = 406,
			h = 48,
			font = {
				oldsansblackFont,
				20,
				RedTextColor
			},
			label = "allfortoday",
			flags = kHAlignCenter + kVAlignCenter,
		},
		Bitmap
		{
			name="nanny1",
			image="gui/gamestatus/Nanny02",
			x=637,
			y=365,
		},
		Bitmap
		{
			name="nanny2",
			image="gui/gamestatus/Nanny01",
			x=637,
			y=365,
		},
		Bitmap
		{
			name="nanny3",
			image="gui/gamestatus/Nanny03",
			x=637,
			y=365,
		},
		Text
		{
			x = 600,
			y = 212,
			w = 144,
			h = 33,
			font = {
				oldsansblackFont,
				30,
				BlackColor
			},
			label = "rank",
			flags = kHAlignRight,
		},
		Bitmap
		{
			name="rankstar",
			image="gui/gamestatus/star",
			x=750,
			y=195,
		},
		Bitmap
		{
			name="ranka",
			image="gui/gamestatus/A",
			x=756,
			y=201,
		},
		Bitmap
		{
			name="rankb",
			image="gui/gamestatus/B",
			x=761,
			y=202,
		},
		Bitmap
		{
			name="rankc",
			image="gui/gamestatus/C",
			x=758,
			y=202,
		},
		Text
		{
			x = 598,
			y = 275,
			w = 144,
			h = 33,
			font = {
				oldsansblackFont,
				30,
				BlackColor
			},
			label = "time",
			flags = kHAlignRight,
		},
		Text
		{
	  		name="lasttime",
	  		font = LastTimeTextFont,
	  		x=751,
	  		y=274,
	  		w=90,
	  		h=50,
	  		flags = kHAlignLeft + kVAlignTop,
		},
		--[[
		Bitmap
		{
			name="gamestatuscongratperfect",
			image="gui/gamestatus/Perfect_time",
			x=150,
			y=165,
		},
		Bitmap
		{
			name="gamestatuscongratgood",
			image="gui/gamestatus/Good_time",
			x=176,
			y=165,
		},
		--]]
		SetStyle( MenuButtonStyle ),
		Button
		{
			name = "gamestatusok",
			x=753,
			y=701,
			graphics = BigButtonGraphics,
			MenuButtonLabel(0, 0, 255, 56, "ok", oldsansblackFont, 30, Color(135,32,33,255), Color(44,76,60,255), Color(83,119,101,255));
			--close = true,
			command=
				function()
					EnableWindow("gamestatusok", false);
					EnableWindow("gamestatus", false);
					if ShouldGoToMiniGame() then
						DisplayDialog{'scripts/minigame_yesno.lua'};
						EnableWindow("gamestatus", false);
					end
					if ShowCutscene() then
						if (StartCutscene()) then
							local gotocredits = ShouldGoToCredits();
							while IsCutscenePlaying() do
								Yield();
							end
							PopModal("gamestatus");
							if gotocredits then
								SwapToModal("scripts/credits.lua");
							else
								SwapToModal("scripts/map.lua");
							end
						else
							PopModal("gamestatus");
							DisplayDialog{"scripts/cutscenes/final.lua", nanny=GetSelectedNanny(), family=GetSelectedFamily(), credits=ShouldGoToCredits()};
						end
					else
						CloseWindow();
					end
				end
		},
	}
}
