-- FirstStage generated output file
require( "scripts/style.lua" );

--PauseGame(true);
SetDefaultStyle( DefaultStyle );

local quit_button_label ="quit" ;	
local quit_button_name="QUIT";
local name ="quitbox";
local error_image_name = "error_image";
local debug_button_label = "Debug" ;	
local debug_button_name = "debug_button";
	
if (gDialogTable.oklabel) then
	ok = gDialogTable.oklabel ;
end

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

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

local okcommand = 	function()
						ErrorCatched();
					end;

d = MediumDialog

MakeDialog
{
	Bitmap
	{
			image = "backgrounds/speedmenu",
			name = "error_background",
			x = kCenter,
			y = kCenter,

      ErrorDialog
      {
        x = 0,
        y = 0,
        w = kMax,
        h = kMax,
		error_desc = gDialogTable.error_desc,
  		SetStyle( OptionsValidationButtonStyle ),
		Button
		{
			close = true,
			flags = 5,
			label = quit_button_label,
			name = quit_button_name,
			x = kCenter,
			y = kMax-90,
			command = okcommand,
		},
		-- Button
		-- {
			-- close = false,
			-- flags = 5,
			-- x = kMax - 200,
			-- y = kMax - 90,
			-- label = "Debug",
			-- name = debug_button_name,
			-- command = 
				-- function()
					-- Break();
				-- end
		-- },
		-- Bitmap
		-- {
			-- name = image_name,
			-- image = gDialogTable.image,
			-- x = 50,
			-- y = 50,
		-- },
		SetStyle( DialogTitleText ),
		Text{ label=gDialogTable.title },
		SetStyle( DialogBodyText ),
		Text
		{
			x = 50,
			y = 80,
			w = kMax -50,
			h = kMax - 90,
			name = "error_desc",
		},
       },
	},
}

gDialogTable = {}
