---------------------------------------------------------------------------------------------------
--  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 yes = "ok";
local yesname = "yes";
local no = "cancel";	
local noname = "no";	
local name = "yesnobox";
local kButtonY = kCenter + 135;
local kButtonXSpace = 100;
	
if( gDialogTable.yeslabel ) then
	yes = gDialogTable.yeslabel;
end

if( gDialogTable.nolabel ) then
	no = gDialogTable.nolabel;
end

if( gDialogTable.yesname ) then
	yesname = gDialogTable.yesname;
end

if( gDialogTable.noname ) then
	noname = gDialogTable.noname;
end

if( gDialogTable.name ) then
	name = gDialogTable.name;
end

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

MakeDialog
{
	name = name;
	SetStyle( GameWindowStyle );
	
	GameWindow
	{
		SetStyle( DialogWindowStyle );
		
		DialogWindow
		{
			SetStyle( DialogTitleText );
			
			Text
			{
				name = "yesnotitle";
				label = gDialogTable.title;
			};
			
			SetStyle( DialogBodyText );

			Text
			{
				y = kCenter - 10;
				name = "yesnobody";
				label = gDialogTable.body;
			};

			SetStyle( TwoButtonDialogButton1Style );
			
			Button
			{	
				text = yes;
				name = yesname;
				
				command=
					function()
						if( gDialogTable.yes ) then 
							gDialogTable.yes();
						end
						
						WindowReturn( yesname );
					end
			};
			
			SetStyle( TwoButtonDialogButton2Style );
			
			Button
			{
				text = no;
				name = noname;

				command=
					function() 
						if( gDialogTable.no ) then
							gDialogTable.no();
						end
						
						WindowReturn( noname );
					end
			};
		}
    }

} -- MakeDialog

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