require( "scripts/style.lua" );


local yes="yes" ;
local yesname="yes" ;
local no="no" ;	
local noname="no" ;	
local name="yesnobox";

local Dialogname = "yesnowindow";
	
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

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


MakeDialog
{
	name=name, -- Remember, this is like saying table['name']=name, so it works.
    Bitmap
    {
		image="backgrounds/speedmenu",
		x=kCenter,
		y=kCenter,
	
		Dialog
		{
			name = Dialogname,
			x = 0,
			y = 0,
			w = kMax, 
			h = kMax,
	
			SetStyle(DialogTitleTextQuit),
			Text
			{
				name = "yesnotitle",
				label= gDialogTable.title,
				x=kCenter,
				y=30,
			};
			
			SetStyle(DialogBodyTextQuit),
			Text
			{
				name = "yesnobody",
				label= gDialogTable.body,
			};
	
			SetStyle(OptionsValidationButtonStyle),
			Button
			{
				command=
					function()
						if (gDialogTable.yes) then 
							gDialogTable.yes() ; 
						end
					end;
				close = true,
				flags = 5,
				label = yes,
				name = yesname,
				x = 222,
				y = 250,
			},
			SetStyle(OptionsCancelButtonStyle),
			Button
			{
				command=
					function() 
						if (gDialogTable.no) then
							gDialogTable.no() ; 
						end
					end;
				close = true,
				flags = 5,
				label = no,
				name = noname,
				x = 388,
				y = 250,
			},
		}, 
    },

} -- MakeDialog
