require "scripts/style"

gCurScreen = 0;

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

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

PlaySound("POPUP-IN");
MakeDialog
{
	-- Name the modal dialog
	name="help",
	Bitmap
	{
		image="backgrounds/dialog",
		x=kCenter,
		y=kCenter,

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

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

			Text
			{
				flags=kVAlignBottom+kHAlignCenter,
				label="#"..GetString("version",GetConfig(kGameVersion)),
			},
			SetStyle(ButtonStyle),
			Button
			{
				label="back",
				name="back",
				--cancel=true,
				align=kHAlignLeft+kVAlignBottom,
            x = kCenter-80,
            y = kMax-15,
				command=function() CloseWindow(); PlaySound("POPUP-OUT"); end;
			},
			Button
			{
				label="next",
				name="next",
				default=true,
				align=kHAlignRight+kVAlignBottom,
          x = kCenter+80,
          y = kMax-15,
				command=function() SetScreen( gCurScreen+1 ); end;
			}
		},
		Window
		{
			name="helptext2",
			w=kMax,h=kMax,

			SetStyle(TextStyle),
			Text
			{
				label="help2",
			},
			SetStyle(ButtonStyle),
			Button
			{
				label="prev",
				name="prev",
				align=kHAlignLeft+kVAlignBottom,
	         x = kCenter-80,
           y = kMax-15,
				command=function() SetScreen( gCurScreen-1 ); end;
			},
			Button
			{
				label="done",
				name="done",
				--cancel=true,
				default=true,
				align=kHAlignRight+kVAlignBottom,
          x = kCenter+80,
          y = kMax-15,
					command=function() CloseWindow(); PlaySound("POPUP-OUT"); end;
			}
		}
	}
}

SetScreen(1);
