require( "scripts/style.lua" );


local yes="yes" ;
local yesname="yes" ;
local no="no" ;	
local noname="no" ;	
local name="yesnobox";
local yescmd=gDialogTable.yes;
local nocmd=gDialogTable.no;
	
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

DialogHeaderFont = {
  standardFont,
  28,
  WhiteColor
};
SetState("dimBg","1");
MakeDialog
{
	name=name, -- Remember, this is like saying table['name']=name, so it works.
    Bitmap
    {
		image="backgrounds/win_textsmall",
		x=kCenter,
		y=kCenter,

		SetStyle(CloseButtonStyle);
		Button
		{
			x=kCenter+153,y=13,
			name="closebutton",
			cancel=true,
			command = function() 
				SetState("dimBg","0");
				CloseWindow(); 
			end;
		};


	        Text
		{
			font = DialogHeaderFont,
			name = "yesnotitle",
			label= gDialogTable.title,
			x=0,y=7,w=kMax,h=kMax,
			flags = kHAlignCenter + kVAlignTop,
		};
		
		SetStyle(DialogBodyText),
		Text
		{
			name = "yesnobody",
			label= gDialogTable.body,
		};

        SetStyle(ScaledButtonStyle),
        Button
        {
			command=
				function()
					if (yescmd) then 
						SetState("dimBg","0");
						yescmd() ; 
					end
				end;
            close = true,
            flags = 5,
            label = yes,
            name = yesname,
	hotkey="",
            x = kCenter,
            y = kMax-90,
        },
--        Button
--        {
--			command=
--				function() 
--					if (nocmd) then
--						nocmd() ; 
--					end
--                end;
--            close = true,
--            flags = 5,
--            label = no,
--            name = noname,
--	hotkey="",
--            x = kCenter+80,
--            y = kMax-90,
--        },
        
    },

} -- MakeDialog
