require( "scripts/style.lua" );

gMaxScreen=6;
gCurScreen = 0;

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

SliderFont = {
  standardFont,
  16,
  BlackColor
};

DialogHeaderFont = {
  standardFont,
  20,
  WhiteColor
};

AboutButtonGraphics = {
	"buttons/button_special_normal.png",
	"buttons/button_special_hovered.png",
	"buttons/button_special_hovered.png",
};

AboutButtonStyle = {
	parent = DefaultStyle,
	sound=kDefaultButtonSound,
	type=kPush,
	graphics = AboutButtonGraphics,
	w=270,h=90,
};

NatGeoButtonGraphics = {
	"ui/btn_natgeo1.png",
	"ui/btn_natgeo2.png",
	"ui/btn_natgeo2.png",
};

NatGeoButtonStyle = {
	parent = DefaultStyle,
	sound=kDefaultButtonSound,
	type=kPush,
	graphics = NatGeoButtonGraphics,
	w=139,h=50,
};

MakeDialog
{
	-- Name the modal dialog
	name="aboutthis",
	Bitmap
	{
		image="backgrounds/win_textlarge",
		x = kCenter,
		y = kCenter,
		
		SetStyle(CloseButtonStyle);
		Button
		{
			x=kCenter+154,y=14,
			name="closebutton",
			cancel=true,
			command = function() CloseWindow(); end;
		};
		Window
		{
			name = "AboutThisGame1",
			w=kMax,h=kMax,
			Text
			{
				font = DialogHeaderFont,
				name = "aboutthisgameheader",
				x=85,y=12,w=320,h=20,
				flags = kHAlignCenter + kVAlignCenter,
				label = "aboutthisgameheader"
			};
			
			Text
			{
				font = SliderFont,
				name = "aboutthisgame1",
				x=85,y=40-20,w=320,h=400,
				flags = kHAlignCenter + kVAlignCenter,
				label = "aboutthisgame1"
			};
			
			Text
			{
				font = SliderFont,
				name = "pagenum1",
				x=kCenter,y=kMax - 110-20,
				flags = kHAlignCenter + kVAlignCenter,
				label = "pagenum1"
			};
			
			SetStyle(NextButtonStyle);
			Button
			{
				x=kCenter+50,y=kMax - 120-20,
				name="next",
				cancel=true,
				command=function() SetScreen( gCurScreen+1 ); end;
			};

			SetStyle(NatGeoButtonStyle);
			Button
			{
				x=kCenter,y=kMax - 75-20,
				name="aboutnatgeo",
				cancel=true,
				command = function() SetScreen(6); end;
			};
		},
		Window
		{
			name = "AboutThisGame2",
			w=kMax,h=kMax,
			Text
			{
				font = DialogHeaderFont,
				name = "aboutthisgameheader",
				x=85,y=12,w=320,h=20,
				flags = kHAlignCenter + kVAlignCenter,
				label = "aboutthisgameheader"
			};
			
			Text
			{
				font = SliderFont,
				name = "aboutthisgame2",
				x=85,y=40,w=320,h=400,
				flags = kHAlignCenter + kVAlignCenter,
				label = "aboutthisgame2"
			};
			
			Text
			{
				font = SliderFont,
				name = "pagenum2",
				x=kCenter,y=kMax - 110-20,
				flags = kHAlignCenter + kVAlignCenter,
				label = "pagenum2"
			};
			
			SetStyle(NextButtonStyle);
			Button
			{
				x=kCenter+50,y=kMax - 120-20,
				name="next",
				cancel=true,
				command=function() SetScreen( gCurScreen+1 ); end;
			};
			SetStyle(BackButtonStyle);
			Button
			{
				x=kCenter-50,y=kMax - 120-20,
				name="back",
				cancel=true,
				command=function() SetScreen( gCurScreen-1 ); end;
			};
			SetStyle(NatGeoButtonStyle);
			Button
			{
				x=kCenter,y=kMax - 75 - 20,
				name="aboutnatgeo",
				cancel=true,
				command = function() SetScreen(6); end;
			};
		},
		Window
		{
			name = "AboutThisGame3",
			w=kMax,h=kMax,
			Text
			{
				font = DialogHeaderFont,
				name = "aboutthisgameheader",
				x=85,y=12,w=320,h=20,
				flags = kHAlignCenter + kVAlignCenter,
				label = "aboutthisgameheader"
			};
			
			Text
			{
				font = SliderFont,
				name = "aboutthisgame3",
				x=85,y=40,w=320,h=400,
				flags = kHAlignCenter + kVAlignCenter,
				label = "aboutthisgame3"
			};
			
			Text
			{
				font = SliderFont,
				name = "pagenum3",
				x=kCenter,y=kMax - 110-20,
				flags = kHAlignCenter + kVAlignCenter,
				label = "pagenum3"
			};
			
			SetStyle(NextButtonStyle);
			Button
			{
				x=kCenter+50,y=kMax - 120-20,
				name="next",
				cancel=true,
				command=function() SetScreen( gCurScreen+1 ); end;
			};
			SetStyle(BackButtonStyle);
			Button
			{
				x=kCenter-50,y=kMax - 120-20,
				name="back",
				cancel=true,
				command=function() SetScreen( gCurScreen-1 ); end;
			};
			SetStyle(NatGeoButtonStyle);
			Button
			{
				x=kCenter,y=kMax - 75 -20,
				name="aboutnatgeo",
				cancel=true,
				command = function() SetScreen(6); end;
			};
		},
		Window
		{
			name = "AboutThisGame4",
			w=kMax,h=kMax,
			Text
			{
				font = DialogHeaderFont,
				name = "aboutthisgameheader",
				x=85,y=12,w=320,h=20,
				flags = kHAlignCenter + kVAlignCenter,
				label = "aboutthisgameheader"
			};
			
			Text
			{
				font = SliderFont,
				name = "aboutthisgame4",
				x=85,y=40,w=320,h=400,
				flags = kHAlignCenter + kVAlignCenter,
				label = "aboutthisgame4"
			};
			
			Text
			{
				font = SliderFont,
				name = "pagenum4",
				x=kCenter,y=kMax - 110-20,
				flags = kHAlignCenter + kVAlignCenter,
				label = "pagenum4"
			};
			
			SetStyle(NextButtonStyle);
			Button
			{
				x=kCenter+50,y=kMax - 120-20,
				name="next",
				cancel=true,
				command=function() SetScreen( gCurScreen+1 ); end;
			};
			SetStyle(BackButtonStyle);
			Button
			{
				x=kCenter-50,y=kMax - 120-20,
				name="back",
				cancel=true,
				command=function() SetScreen( gCurScreen-1 ); end;
			};
			SetStyle(NatGeoButtonStyle);
			Button
			{
				x=kCenter,y=kMax - 75 -20,
				name="aboutnatgeo",
				cancel=true,
				command = function() SetScreen(6); end;
			};
		},
		Window
		{
			name = "AboutThisGame5",
			w=kMax,h=kMax,
			Text
			{
				font = DialogHeaderFont,
				name = "aboutthisgameheader",
				x=85,y=12,w=320,h=20,
				flags = kHAlignCenter + kVAlignCenter,
				label = "aboutthisgameheader"
			};
			
			Text
			{
				font = SliderFont,
				name = "aboutthisgame5",
				x=85,y=40,w=320,h=400,
				flags = kHAlignCenter + kVAlignCenter,
				label = "aboutthisgame5"
			};
			
			Text
			{
				font = SliderFont,
				name = "pagenum5",
				x=kCenter,y=kMax - 110-20,
				flags = kHAlignCenter + kVAlignCenter,
				label = "pagenum5"
			};
			
			SetStyle(BackButtonStyle);
			Button
			{
				x=kCenter-50,y=kMax - 120-20,
				name="back",
				cancel=true,
				command=function() SetScreen( gCurScreen-1 ); end;
			};
			SetStyle(NatGeoButtonStyle);
			Button
			{
				x=kCenter,y=kMax - 75-20,
				name="aboutnatgeo",
				cancel=true,
				command = function() SetScreen(6); end;
			};
		},
		Window
		{
			name = "AboutThisGame6",
			w=kMax,h=kMax,
			Text
			{
				font = DialogHeaderFont,
				name = "aboutnatgeoheader",
				x=85,y=12,w=320,h=20,
				flags = kHAlignCenter + kVAlignCenter,
				label = "aboutnatgeo"
			};
			
			Text
			{
				font = SliderFont,
				name = "aboutnatgeobody",
				x=85,y=40,w=320,h=400,
				flags = kHAlignCenter + kVAlignCenter,
				label = "aboutnatgeobody"
			};
			
			SetStyle(AboutButtonStyle);
			Button
			{
				x=kCenter,y=kMax - 75 - 75,
				name="aboutnatgeo",
				cancel=true,
				command = function() SetScreen(1); end;
			};
			Text
			{
				font = DialogHeaderFont,
				name = "buttonlabel",
				x=kCenter,y=kMax-100,w=320,h=20,
				flags = kHAlignCenter + kVAlignCenter,
				label = "aboutthisgamebutton"
			};
		},
	},
}
SetScreen(1);