---------------------------------------------------------------------------------------------------
--  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" );

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

function CreateText()
	t = { BeginGroup() };
	textYSpacer = 210;
	textYAdjust = 35;
	textColumnWidth = 200;
	textX = { -textColumnWidth, -textColumnWidth, textColumnWidth, 0, textColumnWidth, -textColumnWidth, textColumnWidth };
	textY = { -120, -50, -65, -165, -120, 20, 20 };

	for i = 1, 7, 1 do
		table.insert( t, SetStyle( CreditsTitleText ) );					  
		table.insert( t,
					  Text
					  {
					      x = kCenter + textX[i];
					      y = kCenter + textY[i] + textYAdjust;
					      label = "creditsheader"..i;
					  } );
					  
		table.insert( t, SetStyle( CreditsNameText ) );
		table.insert( t,
					  Text
					  {
					      x = kCenter + textX[i] + 1;
					      y = kCenter + textY[i] + textYSpacer + textYAdjust + 1;
					      label = "creditsnames"..i;
					      font = CreditsNameFontDS;
					  } );
		table.insert( t,
					  Text
					  {
					      x = kCenter + textX[i];
					      y = kCenter + textY[i] + textYSpacer + textYAdjust;
					      label = "creditsnames"..i;
					  } );
	end
	
	return Group( t );
end

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

MakeDialog
{
	name = "credits";
	SetStyle( GameWindowStyle );
	
	GameWindow
	{
		SetStyle( CreditsDialogWindowStyle );
		
		DialogWindow
		{
			CreateText();			
			SetStyle( CreditsNameText );
						
			Text
			{
				font = CreditsLicenseFont;
				flags = kVAlignCenter + kHAlignCenter;
				x = kCenter - 35;
				y = kCenter + 210;
				w = 375;
				h = 150;
				name = "license";
				label = "creditsnames8";
			};
			
			SetStyle( CreditsNameText );
						
			Text
			{
				font = CreditsLicenseFont;
				x = kCenter;
				y = kCenter + 160;
				w = 600;
				h = 100;
				name = "copyright";
				label = "copyright";
			};

			SetStyle( ButtonStyle );
			
			Button
			{
				x = kCenter + 230;
				y = kCenter + 205;
				name = "ok";
				text = "ok";
				
				command =
					function()
						WindowReturn();
					end
			};
		};
	};
};

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