require("scripts/styles/mainmenustyle.lua")

MakeDialog 
{
	name = "WndLevelStatsParent",
	
	SetStyle(BackgroundStyle),
	
	BlgBitmap
	{
		x = kCenter,
		y = kCenter-2,
		image = "common/screens/screen_overlay",
	},
	
	SetStyle(BoxStyle),
	
	BlgBitmap
	{
		x = 0,
		y = 0,
		w = 1024,
		h = 800,
		positionMatrix = {x = 210, y = 161},
		image = "common/screens/stats/stats_box",
	},
		
	WndLevelStats
	{
		name = "WndLevelStats",
		w = width,
		h = height,
		delay = 1,
		jadeAgreePositionX = 176,
		jadeAgreePositionY = 310,
		onDelay = function()
			--ShowAllLabels();
		end,
			
			SetStyle(PortraitStyle),
			
			BlgBitmap
			{
				name = "bmpJade",
				x = kCenter - 201,
				y = kCenter + 129,
				w = 300, h = 400,
				positionMatrix = {x = 69, y = 90},
				-- must be intialized with an image, otherwise it will not be properly placed
				image = "common/screens/stats/jade",
				delay = 15,
			},
						
			-----------------------------------		
			-- Completion state label
			-----------------------------------		
			
			-----------------------------------		
			-- Normal graphics
			
			SetStyle(StatsTitleStyle),
			BlgText 
			{
				name = "txtStageCompletion",
				label = "",
				x = 340, --kCenter + (30)
				y = 200, --kCenter - (185)
				w = 400, h = 60,
				flags = kHAlignCenter + kVAlignCenter,
			},

			SetStyle(StatsTipStyle),

            -- Tips and mentor comments
--~ 			BlgText 
--~ 			{
--~ 				name = "txtTips",
--~ 				label = "",
--~ 				x = 445,
--~ 				y = 420,
--~ 				w = 310, h = 120,
--~ 				flags = kHAlignLeft + kVAlignTop,
--~ 				typewriter = true,
--~ 				typewriteEvery = 1,
--~ 				typewriteDelay = 100,
--~ 				fps = 300,
--~ 			},		

			SetStyle(StatsPerformanceStyle),

--~ 			-- Comparison to previuos score
--~ 			BlgText 
--~ 			{
--~ 				name = "txtPreviousScoreComparison",
--~ 				label = "",
--~ 				x = 340,
--~ 				y = 200,
--~ 				w = 350, h = 50,
--~ 				flags = kHAlignCenter + kVAlignCenter,
--~ 				typewriter = true,
--~ 				typewriteEvery = 1,
--~ 				typewriteDelay = 120,
--~ 				fps = 300,
--~ 			},

			--------------------------------------------------
			
			SetStyle(StatsContentStyle),

			BlgBitmap
			{
				name = "bmpMoney",
				x = 330,
				y = 270,
				image = "common/screens/stats/icon_money",
				delay = 15,
			},
            
            BlgBitmap
			{
				name = "bmpGreenPoints",
				x = 310,
				y = 350,
				image = "common/screens/stats/icon_green_points",
				delay = 15,
			},
			
			BlgBitmap
			{
				name = "bmpHappy",
				x = 465,
				y = 415,
				image = "common/screens/stats/icon_happy",
				delay = 16,
			},
			
			BlgBitmap
			{
				name = "bmpAngry",
				x = 465,
				y = 455,
				image = "common/screens/stats/icon_angry",
				delay = 25,
			},
            
            BlgBitmap
			{
				name = "bmpMole",
				x = 465,
				y = 495,
				image = "common/screens/stats/icon_mole",
				delay = 34,
			},
            
            BlgBitmap
			{
				name = "bmpStatusMoney",
				x = 475,
				y = 278,
				image = "common/screens/stats/checkmark_plus",
				delay = 36,
			},
            
            BlgBitmap
			{
				name = "bmpStatusGreenPoints",
				x = 640,
				y = 345,
				image = "common/screens/stats/checkmark_plus",
				delay = 42,
			},
            
            -----------------------------------		
			-- Expert Badge
			-----------------------------------
			
			SetStyle(StatsContentStyle),
					
			BlgBitmap
			{
				name = "bmpBadge",
				x = kCenter + 200,
				y = kCenter + 165,
				w = 300, h = 400,
				positionMatrix = {x = 50, y = 50},
				-- must be intialized with an image, otherwise it will not be properly placed
				image = "common/shim",
				delay = 47,
			},
            
--~ 			BlgBitmap
--~ 			{
--~ 				name = "bmpBadgeGP",
--~ 				x = kCenter + 145,
--~ 				y = kCenter + 38,
--~ 				w = 300, h = 400,
--~ 				positionMatrix = {x = 50, y = 50},
--~ 				-- must be intialized with an image, otherwise it will not be properly placed
--~ 				image = "common/crown_gold",
--~ 				delay = 47,
--~ 			},
--~ 			
			--------------------------------------
			-- Code-driven text fields
			--------------------------------------
			
			SetStyle(StatsDataStyle),

			BlgText 
			{
				name = "txtTotal",
				label = "",
				x = 375,
				y = 283,
				w = 380, h = 100,
				flags = kHAlignLeft + kVAlignTop,
				delay = 15,
				
			},		
		
			BlgText 
			{
				name = "txtGpRequired",
				label = "",
				x = 385,
				y = 335,
				w = 380, h = 100,
				flags = kHAlignLeft + kVAlignTop,
				delay = 15,
			},

			BlgText 
			{
				name = "txtGpAchieved",
				label = "",
				x = 385,
				y = 363,
				w = 380, h = 100,
				flags = kHAlignLeft + kVAlignTop,
				delay = 15,
			},
            
			BlgText 
			{
				name = "txtServedCustomers",
				label = "",
				x = 520,
				y = 415,
				w = 380, h = 100,
				flags = kHAlignLeft + kVAlignTop,
				delay = 22,
			},	
			
			BlgText
			{
				name = "txtAngryCustomers",
				label = "",
				x = 520,
				y = 455,
				w = 380, h = 100,
				flags = kHAlignLeft + kVAlignTop,
				delay = 31,
			},
            
            BlgText
			{
				name = "txtMolesCaptured",
				label = "",
				x = 520,
				y = 495,
				w = 380, h = 100,
				flags = kHAlignLeft + kVAlignTop,
				delay = 40,
			},

			SetStyle(GreenButtonStyle),			
			
			BlgButton
			{
				name= "btnContinue",
				label = "continue",
				x = 572, y = 521,
				width = 400, height = 200,
				positionMatrix = { x = 10, y = 10},
				graphics = {
					"common/screens/dialog_box/cancel_green",
					"",
					"",
					"",
				},
				default = true,
			  	command =
			        function()
                        if SurveyBuildCheck() then
                            DoModal("scripts/windows/dialogs/surveybuilddialog.lua")
                        else
			        	    CloseWindow()
                        end
			        end				
			},	
			
			SetStyle(OrangeButtonStyle),
			
			BlgButton
			{
				name= "btnRetry",
				label = "try_again",
				x = 403, y = 521,
				width = 400, height = 200,
				positionMatrix = { x = 10, y = 10},
				graphics = {
					"common/screens/dialog_box/confirm_red",
					"",
					"",
					"",
				},
				default = true,
			  	command =
			        function()
						RetryLevel();
			        	CloseWindow();
			        end				
			},			
		}
}
