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 = "gui/gamestatus/commom/stats_bg",
		x = 0,
		y = 0,
		alpha = 0.99,
	},
	GameStatus
	--Bitmap
	{
align=kHAlignLeft + kVAlignTop,
		type = "final",
		--image = "backgrounds/gamestatus_bg",
		x = 0,
		y = 0,
		w = 1024,
		h = 768,
		alpha = 0.99,
		Bitmap
		{
			name = "grifoimg",
			image = "gui/gamestatus/final/grifo_static",
			x = 74,
			y = 72,
			scale = 1.00
		},
		Text
		{
			name = "allfortodaytext",
			x = 74,
			y = 74,
			w = 406,
			h = 48,
			font = {
				oldsansblackFont,
				48,
				RedTextColor
			},
			label = "allfortoday",
			flags = kHAlignCenter + kVAlignCenter,
		},
		Text
		{
			name = "ranktext",
			x = 513,
			y = 178,
			w = 144,
			h = 40,
			font = {
				oldsansblackFont,
				40,
				RedTextColor
			},
			label = "rank",
			flags = kHAlignRight,
		},
		Text
		{
			name = "yourtimetext",
			x = 473,
			y = 107,
			w = 244,
			h = 40,
			font = {
				oldsansblackFont,
				40,
				RedTextColor
			},
			label = "totaltime",
			flags = kHAlignRight,
		},
		Text
		{
	  		name="lasttime",
	  		font = {
				oldsansblackFont,
				40,
				RedTextColor
			},
	  		x=734+2,
	  		y=92+1,
	  		w=120,
	  		h=50,
	  		flags = kHAlignLeft + kVAlignBottom,
		},
		Text
		{
	  		name="daytimevalue",
	  		font = {
				oldsansblackFont,
				40,
				RedTextColor
			},
	  		x=734-508,
	  		y=264,
	  		w=120,
	  		h=50,
	  		flags = kHAlignLeft + kVAlignBottom,
		},
		Text
		{
	  		name="nighttimevalue",
	  		font = {
				oldsansblackFont,
				40,
				RedTextColor
			},
	  		x=734-499,
	  		y=479,
	  		w=120,
	  		h=50,
	  		flags = kHAlignLeft + kVAlignBottom,
		},
		--[[
		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=606,
			y=528,
			graphics = BigButtonGraphics,
			MenuButtonLabel(0, 0, 255, 56, "ok", oldsansblackFont, 40, Color(135,32,33,255), Color(44,76,60,255), Color(83,119,101,255));
			--close = true,
			command=
				function()
					if ShouldGoToMiniGame() then
						DisplayDialog{'scripts/minigame_yesno.lua', nanny=GetSelectedNanny()};
						--EnableWindow("gamestatus", false);
						--CloseWindow();
					else
						if ShowCutscene() then
							EnableWindow("gamestatusok", false);
							EnableWindow("gamestatus", false);
							if (StartCutscene()) then
								local gotocredits = ShouldGoToCredits();
								while IsCutscenePlayingGS() 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
				end
		},
		SetStyle(DialogBodyText),
		Bitmap
		{
			name = "piece_day",
			image = "gui/gamestatus/final/piece",
			x = 92,
			y = 172,
			scale = 1.47,
			SetStyle(DialogBodyText),
			Text
			{
				name = "daytitletext",
				label = "day",
				x = 114,
				y = 24,
				w = 202,
				h = 53,
			font = {
				oldsansblackFont,
				53,
				RedTextColor
			},
				flags = kHAlignCenter+kVAlignCenter,
			}
		},
		Bitmap
		{
			name = "piece_night",
			image = "gui/gamestatus/final/piece",
			x = 90
,
			y = 376,
			scale = 1.47,
			SetStyle(DialogBodyText),
			Text
			{
				name = "nighttitletext",
				label = "night",
				x = 114,
				y = 24,
				w = 202,
				h = 53,
			font = {
				oldsansblackFont,
				53,
				RedTextColor
			},
				flags = kHAlignCenter+kVAlignCenter,
			}
		},
		SetStyle(DialogBodyText),
		Text
		{
			name = "timedaytxt",
			label = "time",
			x = 125,
			y = 274,
			w = 122,
			h = 50,
			font = {
				oldsansblackFont,
				40,
				RedTextColor
			},
			flags = kHAlignLeft+kVAlignTop,
		},
		Text
		{
			name = "timednighttxt",
			label = "time",
			x = 125,
			y = 491,
			w = 122,
			h = 50,
			font = {
				oldsansblackFont,
				40,
				RedTextColor
			},
			flags = kHAlignLeft+kVAlignTop,
		},
		SetStyle(DialogBodyText),
		Text
		{
			name = "dayranktxt",
			label = "dayrank",
			x = 107,
			y = 327,
			w = 154,
			h = 37,
			font = {
				oldsansblackFont,
				37,
				RedTextColor
			},
			flags = kHAlignLeft+kVAlignTop,
		},
		Text
		{
			name = "nightranktxt",
			label = "nightrank",
			x = 107,
			y = 545,
			w = 164,
			h = 37,
			font = {
				oldsansblackFont,
				37,
				RedTextColor
			},
			flags = kHAlignLeft+kVAlignTop,
		}
	}
}
