-------------------------------------
--				Init
-------------------------------------
require "scripts/style"

gCurScreen = 0;

-------------------------------------
--				Styles
-------------------------------------
TextStyle=
{
	parent = DialogBodyText,
	x = 0,
	y = 46,
	w = kMax,
	h = kMax - 80
};

-------------------------------------
--				Functions
-------------------------------------
function SetScreen( screen )

	if screen == 1 then
		SetWindowVisible("helptext1",true)
		SetWindowVisible("helptext2",false)
	elseif screen ==2 then
		SetWindowVisible("helptext1",false)
		SetWindowVisible("helptext2",true)
	end

	gCurScreen = screen ;
end

-------------------------------------
--			Main Dialog
-------------------------------------
MakeDialog
{
	name = "help",
	Bitmap
	{
		name = "dialogshadow",
		image = "backgrounds/dialogs/backgroundalpha",
	},

	Bitmap
	{
		image = "backgrounds/dialogs/dialogfullscreendefault",
		x = 0,
		y = 0,

		Window
		{
			name = "helptext1",
			w = kMax,
			h = kMax,

			SetStyle(TextStyle),
			Text
			{
				label = "help1",
			},

			Text
			{
				flags = kVAlignBottom + kHAlignCenter,
				label = "#"..GetString("version",GetConfig(kGameVersion)),
			},
			
			SetStyle(ButtonStyle),
			Button
			{
				name = "back",
				x = 20,
				y = kMax - 20,
				DefaultButtonLabel("back"),
				cancel = true,
				align = kHAlignLeft + kVAlignBottom,
				command = 
					function() 
						CloseWindow(); 
					end;
			},

			Button
			{
				name = "next",
				x = kMax - 20,
				y = kMax - 20,
				DefaultButtonLabel("next"),
				default = true,
				align = kHAlignRight + kVAlignBottom,
				command = 
					function() 
						SetScreen( gCurScreen+1 ); 
					end;
			}
		},

		Window
		{
			name = "helptext2",
			w = kMax,
			h = kMax,

			SetStyle(TextStyle),
			Text
			{
				label = "help2",
			},

			SetStyle(ButtonStyle),
			Button
			{
				name = "prev",
				x = 20,
				y= kMax - 20,
				DefaultButtonLabel("prev"),
				align = kHAlignLeft + kVAlignBottom,
				command = 
					function() 
						SetScreen( gCurScreen-1 ); 
					end;
			},

			Button
			{
				name = "done",
				x = kMax - 20,
				y = kMax - 20,
				DefaultButtonLabel("done"),
				cancel = true,
				default = true,
				align = kHAlignRight + kVAlignBottom,
				command = 
					function() 
						CloseWindow(); 
					end;
			}
		}
	}
}

-------------------------------------
--				Finalize
-------------------------------------
SetScreen(1);