require("scripts/styles/style.lua");
require( "scripts/styles/uistyle.lua" );

MakeState{

	-- score passed as a parameter. scoreText and scoreShade should count up to this number
	gameScore = gDialogTable.score,
	
	BlgContainer{
		BlgMovieClip{
		transformMatrix = {x = 150, y = 142},

			-- Graphic content
			SetStyle(WindowBGStyle),
			BlgMovieClip{
				repeatCount = 0,
				SetStyle(PalmTrunkStyle),
				BlgContainer{
					transformMatrix = {x = 505, y = 56},
					BlgBitmap {
						image="common/backgrounds/trunk",
						center = {x = 27, y = 122},
						transformMatrix = {x = 0, y = 0},
					},
					BlgBitmap {
						image = "common/backgrounds/hojas",
						center = {x = 90, y = 202},
						transformMatrix = {x = 0, y = 0},
					},
					
				},	
			},
			
			BlgBitmap {
				image="common/backgrounds/box_mainmenu",
				center = {x = 0, y = 0},
				transformMatrix = {x = 112, y = 30},
			},
			
			SetStyle(Button1Style),		
			BlgText {
				label = "Well_Done",
				flags = kHAlignCenter + kVAlignTop,
				w = 500,
				h = 200,
				font = {
					standardFont,
					60,
					DefaultColor,
				},

				transformMatrix = {x = 110, y = 70},
			},
			
			-- score textBox
			-- this one should count from 0 up to gameScore by increments of gameScore * 0.01 every frame
			
			SetStyle(Button3Style),
			
			BlgBitmap{
				image = "common/backgrounds/goal_coin_large",
				transformMatrix = {x = 370, y = 175},
			},
			BlgBitmap{
				image = "common/backgrounds/goal_coin_large",
				transformMatrix = {x = 370, y = 230},
			},
			
			BlgText {
				label = ("Money"),
				flags = kHAlignRight + kVAlignTop,
				w = 120,
				h = 100,
				font = {
					standardFont,
					36,
					DefaultColor,
				},

				transformMatrix = {x = 150, y = 155},
			},
				
			BlgText {
				label = ("#"..gDialogTable.money),
				flags = kHAlignRight + kVAlignTop,
				w = 120,
				h = 100,
				font = {
					standardFont,
					36,
					DefaultColor,
				},

				transformMatrix = {x = 380, y = 155},
			},
			
			BlgText {
				label = ("You_Earned"),
				flags = kHAlignCenter + kVAlignTop,
				w = 200,
				h = 100,
				font = {
					standardFont,
					36,
					DefaultColor,
				},

				transformMatrix = {x = 150, y = 210},
			},
			BlgText {
				label = ("#"..gDialogTable.score),
				flags = kHAlignRight + kVAlignTop,
				w = 120,
				h = 100,
				font = {
					standardFont,
					36,
					DefaultColor,
				},

				transformMatrix = {x = 380, y = 210},
			},
			
			BlgText {
				label = ("Total"),
				flags = kHAlignRight + kVAlignTop,
				w = 120,
				h = 100,
				font = {
					standardFont,
					36,
					DefaultColor,
				},

				transformMatrix = {x = 170, y = 275},
			},
			BlgText {
				label = ("#"..(gDialogTable.money + gDialogTable.score)),
				flags = kHAlignRight + kVAlignTop,
				w = 150,
				h = 100,
				font = {
					standardFont,
					60,
					DefaultColor,
				},

				transformMatrix = {x = 350, y = 260},
			},
		
			SetStyle(Button5Style),
			BlgButton{
				transformMatrix = {x = 430, y = 330},
				label = "wnd_okdialog_ok",
				font = {
					standardFont,
					23,
					DefaultColor,
				},
				upState = {
					bitmap = "common/buttons/btn_default",
				},
				overState = {
					bitmap = "common/buttons/btn_rollover",
				},
				downState = {
					bitmap = "common/buttons/btn_pushed",
					sound = kDefaultButtonSound,
				},
				command = function()
					PopState();
					OnCompleteButtonOk();
				end
			},


			animation = nil,
		},
	}
};
