require( "scripts/style.lua" );

gMaxScreen=6;
gCurScreen = 0;

function SetScreen( screen )

	for i=1,gMaxScreen do
		EnableWindow("TutorialText"..i,false);
	end
	EnableWindow("TutorialText"..screen,true);
	gCurScreen = screen ;
end

function LockWindow( screen )
	EnableWindow("next"..screen, false);
	EnableWindow("prev"..screen, false);
end

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

DialogHeaderFont = {
  standardFont,
  20,
  WhiteColor
};

DialogHeaderStyle=
{
	parent=DefaultStyle,
	font = DialogHeaderFont,
	flags = kVAlignCenter + kHAlignCenter,
	x=kCenter-3,y=5,w=kMax,h=30
};

MakeDialog
{
	-- Name the modal dialog
	name="Tutorial",
	Bitmap
	{
		image="backgrounds/win_textsmall",
		x=kCenter,
		y=kCenter,

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

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

			SetStyle(DialogHeaderStyle),
			Text
			{
				label="Tutorial1a",
			},

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

			SetStyle(NextButtonStyle),
			Button
			{
				name="next0",
				hotkey="",
				align=kHAlignCenter+kVAlignBottom,
				x=kCenter+50,
				y=kMax-80,
				command=function() SetScreen( gCurScreen+1 ); end;
			},
			Text
			{
				font = SliderFont,
				name = "pagenum1_6",
				x=kCenter,
				y=kMax -120,
				flags = kHAlignCenter + kVAlignCenter,
				label = "pagenum1_6"
			};
		},
		Window
		{
			name="TutorialText2",
			w=kMax,h=kMax,

			SetStyle(DialogHeaderStyle),
			Text
			{
				label="Tutorial2a",
			},

			SetStyle(TextStyle),
			Text
			{
				label="Tutorial2",
			},
			SetStyle(NextButtonStyle),
			Button
			{
				name="next1",
				hotkey="",
				align=kHAlignCenter+kVAlignBottom,
				x=kCenter+50,
				y=kMax-80,
				command=function() SetScreen( gCurScreen+1 ); end;
			},
			SetStyle(BackButtonStyle),
			Button
			{
				name="prev1",
				hotkey="",
				align=kHAlignLeft+kVAlignBottom,
				x=kCenter-50,
				y=kMax-80,
				command=function() SetScreen( gCurScreen-1 ); end;
			},
			
			Text
			{
				font = SliderFont,
				name = "pagenum2_6",
				x=kCenter,
				y=kMax -120,
				flags = kHAlignCenter + kVAlignCenter,
				label = "pagenum2_6"
			};
		},
		Window
		{
			name="TutorialText3",
			w=kMax,h=kMax,

			SetStyle(DialogHeaderStyle),
			Text
			{
				label="Tutorial3a",
			},

			SetStyle(TextStyle),
			Text
			{
				label="Tutorial3",
			},
			SetStyle(NextButtonStyle),
			Button
			{
				name="next2",
				hotkey="",
				align=kHAlignCenter+kVAlignBottom,
				x=kCenter+50,
				y=kMax-80,
				command=function() SetScreen( gCurScreen+1 ); end;
			},
			SetStyle(BackButtonStyle),
			Button
			{
				name="prev2",
				hotkey="",
				align=kHAlignLeft+kVAlignBottom,
				x=kCenter-50,
				y=kMax-80,
				command=function() SetScreen( gCurScreen-1 ); end;
			},
			
			Text
			{
				font = SliderFont,
				name = "pagenum3_6",
				x=kCenter,
				y=kMax -120,
				flags = kHAlignCenter + kVAlignCenter,
				label = "pagenum3_6"
			};
		},
		Window
		{
			name="TutorialText4",
			w=kMax,h=kMax,

			SetStyle(DialogHeaderStyle),
			Text
			{
				label="Tutorial4a",
			},

			SetStyle(TextStyle),
			Text
			{
				label="Tutorial4",
			},
			SetStyle(NextButtonStyle),
			Button
			{
				name="next3",
				hotkey="",
				align=kHAlignCenter+kVAlignBottom,
				x=kCenter+50,
				y=kMax-80,
				command=function() SetScreen( gCurScreen+1 ); end;
			},
			SetStyle(BackButtonStyle),
			Button
			{
				name="prev3",
				hotkey="",
				align=kHAlignLeft+kVAlignBottom,
				x=kCenter-50,
				y=kMax-80,
				command=function() SetScreen( gCurScreen-1 ); end;
			},
			
			Text
			{
				font = SliderFont,
				name = "pagenum4_6",
				x=kCenter,
				y=kMax -120,
				flags = kHAlignCenter + kVAlignCenter,
				label = "pagenum4_6"
			};
		},
		Window
		{
			name="TutorialText5",
			w=kMax,h=kMax,

			SetStyle(DialogHeaderStyle),
			Text
			{
				label="Tutorial5a",
			},

			SetStyle(TextStyle),
			Text
			{
				label="Tutorial5",
			},
			SetStyle(NextButtonStyle),
			Button
			{
				name="next4",
				hotkey="",
				align=kHAlignCenter+kVAlignBottom,
				x=kCenter+50,
				y=kMax-80,
				command=function() SetScreen( gCurScreen+1 ); end;
			},
			SetStyle(BackButtonStyle),
			Button
			{
				name="prev4",
				hotkey="",
				align=kHAlignLeft+kVAlignBottom,
				x=kCenter-50,
				y=kMax-80,
				command=function() SetScreen( gCurScreen-1 ); end;
			},
			
			Text
			{
				font = SliderFont,
				name = "pagenum5_6",
				x=kCenter,
				y=kMax -120,
				flags = kHAlignCenter + kVAlignCenter,
				label = "pagenum5_6"
			};
		},
		Window
		{
			name="TutorialText6",
			w=kMax,h=kMax,

			SetStyle(DialogHeaderStyle),
			Text
			{
				label="Tutorial6a",
			},

			SetStyle(TextStyle),
			Text
			{
				label="Tutorial6",
			},
			SetStyle(BackButtonStyle),
			Button
			{
				name="prev5",
				hotkey="",
				align=kHAlignLeft+kVAlignBottom,
				x=kCenter-50,
				y=kMax-80,
				command=function() SetScreen( gCurScreen-1 ); end;
			},
			
			Text
			{
				font = SliderFont,
				name = "pagenum6_6",
				x=kCenter,
				y=kMax -120,
				flags = kHAlignCenter + kVAlignCenter,
				label = "pagenum6_6"
			};
		}
	}
}

SetScreen(1);
