---------------------------------------------------------------------------------------------------
--  Copyright © 2009 PoBros, Incorporated. All Rights Reserved.
--
--  This source code is the proprietary confidential property of PoBros Incorporated.
--  Modification; reproduction; publication; or distribution in any form to any party 
--  other than the licensee is strictly prohibited.
--
--  FOR USE BY AUTHORIZED PERSONS ONLY
---------------------------------------------------------------------------------------------------

require( "scripts/style.lua" );

local kTextYStart = kCenter - 125;
local kTextYSpace = 30;
local kNameCount = 10;

---------------------------------------------------------------------------------------------------

function AddText( count )
	t = { SetStyle( HighscoreNameText ); };
	
	for i = 0, count - 1, 1 do
		table.insert( t,
					  Text
					  {
						  name = "textname" .. i,
						  label = "#testname",
						  y = kTextYStart + ( kTextYSpace * i );
					  } );	
	end
	
	table.insert( t, SetStyle( HighscoreIndexText ) );
	
	for i = 0, count - 1, 1 do
		table.insert( t,
					  Text
					  {
					      name = "textindex" .. i,
					      label = "#" .. ( i + 1 ) .. ".",
					      y = kTextYStart + ( kTextYSpace * i );
					  } );
	end
	
	table.insert( t, SetStyle( HighscoreScoreText ) );
	
	for i = 0, count - 1, 1 do
		table.insert( t,
					  Text
					  {
						  name = "textscore" .. i;
						  label = "#textscore";
						  y = kTextYStart + ( kTextYSpace * i );
					  } );
	end

	return Group( t );
end

---------------------------------------------------------------------------------------------------

MakeDialog
{
	name = "highscore";
	SetStyle( GameWindowStyle );
	
	HighscoreWindow
	{
		SetStyle( LargeDialogWindowStyle );
		
		namecount = kNameCount;
		
		defaultvalues =
		{
			"Darcy",	11852000,
			"Penelope",	12192000,
			"Sofia",	13534000,
			"Lonnie",	14875000,
			"Clayton",	15163000,
			"Mathew",	17114000,
			"Jessie",	18224000,
			"Christy",	20001000,
			"Keith",	21171000,
			"Samuel",	22575000
		};
		
		DialogWindow
		{
			SetStyle( LargeDialogTitleText );

			Text
			{
				name = "top10";
				label = "top10";
			};
			
			AddText( kNameCount );
			
			SetStyle( ButtonStyle );
			
			Button
			{
				name = "ok";
				text = "ok";
				x = kCenter;
				y = kCenter + 195;
				
				command =
					function()
						WindowReturn( "highscore" );
					end
			};
		};
	};
};

---------------------------------------------------------------------------------------------------
