require( "scripts/style.lua" );

HeaderFont = {
  standardFont,
  36,
  RedColor
};


GameModeFont = {
  standardFont,
  35,
  RedColor
};

TableInfoFont = {
  standardFont,
  30,
  BorderColor
};

EligibleFont = {
  standardFont,
  20,
  BorderColor
};

EligibleAsteriskFont = {
  standardFont,
  12,
  BorderColor
};

ConnectingToServerFont = {
	standardFont,
	18,
	BorderColor
};

TableHeaderFont = {
  standardFont,
  30,
  RedColor
};

ScoreInfoFont = {
  standardFont,
  22,
  BorderColor
};


ScoreFont = {
  standardFont,
  18,
  BorderColor
};

RankFont = {
  standardFont,
  26,
  BorderColor
};

ChangeViewFont = {
  standardFont,
  20,
  MenuRedColor
};



UpButtonGraphics = {
	"buttons/arrowup_a.png",
	"buttons/arrowup_b.png",
	"buttons/arrowup_c.png"
};

DownButtonGraphics = {
	"buttons/arrowdown_a.png",
	"buttons/arrowdown_b.png",
	"buttons/arrowdown_c.png"
};



kScoreRowSpace = 25;
kRowY = 85;
kNumberX = 30;
kNameX = 47;
kNameWidth = 150;
kNameHeight = 18;
kScoreX = 270;
kLevelX = 325;
kP1X = kNumberX + 1;



MakeDialog
{
	
	Bitmap
	{ 
		image="backgrounds/high_score_menu_bg",	
		name="hiscorescreen",
		
		HiscoreWindow
		{
			x=0,y=0,h=kMax,w=kMax,
			
			Text
			{
				font = HeaderFont,
				name = "header",
				x=0,y=25,w=kMax,h=kMax,
				flags = kHAlignCenter + kVAlignTop,
				label = "highscoreheader"
			};
			
			Text
			{
				font = GameModeFont,
				name = "gamemode",
				x=0,y=85,w=kMax,h=kMax,
				flags = kHAlignCenter + kVAlignTop,
				label = "GAMEMODE"
			};
			
			Bitmap
			{
				x = 42,
				y = 138,
				w = 343,
				h = 344,
				image="placeholder",
				name="leftpanel",
				
				Text
				{
					font = TableHeaderFont,
					name = "local",
					x=0,y=10,w=kMax,h=kMax,
					flags = kHAlignCenter + kVAlignTop,
					label = "localhighscores"
				};
				
				
				Text
				{
					font = TableHeaderFont,
					name = "global",
					x=0,y=10,w=kMax,h=kMax,
					flags = kHAlignCenter + kVAlignTop,
					label = "globalhighscores"
				};
				
				Text
				{
					font = TableHeaderFont,
					name = "topplayers",
					x=0,y=10,w=kMax,h=kMax,
					flags = kHAlignCenter + kVAlignTop,
					label = "topplayers"
				};
				
				Text
				{
					font = ScoreFont,
					name = "category",
					x=kCenter,y=40,w=201,h=40,
					flags = kHAlignCenter + kVAlignTop,
					label = "Category Name"
				};
				
				Button
				{
					font = StandardButtonFont,
					graphics = LeftArrowGraphics,
					name="categoryleft",
					label="",
					type = kPush,
					x=kCenter - 100,
					y=35,
					scale = 0.5
				};
				
				Button
				{
					font = StandardButtonFont,
					graphics = RightArrowGraphics,
					name="categoryright",
					label="",
					type = kPush,
					x=kCenter + 100,
					y=35,
					scale = 0.5
				};
				
				
				
				Text
				{
					font = ScoreFont,
					name = "score",
					x=0,y=kRowY-(1*kScoreRowSpace),w=kScoreX,h=kMax,
					flags = kHAlignRight + kVAlignTop,
					label = "score"
				};
				
				Text
				{
					font = ScoreFont,
					name = "level",
					x=0,y=kRowY-(1*kScoreRowSpace),w=kLevelX,h=kMax,
					flags = kHAlignRight + kVAlignTop,
					label = "level_lower"
				};
				
				Text
				{
					font = ScoreFont,
					name = "1",
					x=0,y=kRowY,w=kNumberX,h=kMax,
					flags = kHAlignRight + kVAlignTop,
					label = "1."
				};
				
				Bitmap
				{
					image = "hiscore/p1icon.png",
					name = "p1_1",
					x=kP1X,y=kRowY
				};
				
				Text
				{
					font = ScoreFont,
					name = "name1",
					x=kNameX,y=kRowY,w=kNameWidth,h=kNameHeight,
					flags = kHAlignLeft + kVAlignTop,
					label = "name"
				};
				
				Text
				{
					font = ScoreFont,
					name = "score1",
					x=0,y=kRowY,w=kScoreX,h=kMax,
					flags = kHAlignRight + kVAlignTop,
					label = "12345"
				};
				
				Text
				{
					font = ScoreFont,
					name = "level1",
					x=0,y=kRowY,w=kLevelX,h=kMax,
					flags = kHAlignRight + kVAlignTop,
					label = "12345"
				};
				
				Text
				{
					font = ScoreFont,
					name = "2",
					x=0,y=kRowY+(1*kScoreRowSpace),w=kNumberX,h=kMax,
					flags = kHAlignRight + kVAlignTop,
					label = "2."
				};
				
				Bitmap
				{
					image = "hiscore/p1icon.png",
					name = "p1_2",
					x=kP1X,y=kRowY+(1*kScoreRowSpace)
				};
				
				
				Text
				{
					font = ScoreFont,
					name = "name2",
					x=kNameX,y=kRowY+(1*kScoreRowSpace),w=kNameWidth,h=kNameHeight,
					flags = kHAlignLeft + kVAlignTop,
					label = "name"
				};
				
				Text
				{
					font = ScoreFont,
					name = "score2",
					x=0,y=kRowY+(1*kScoreRowSpace),w=kScoreX,h=kMax,
					flags = kHAlignRight + kVAlignTop,
					label = "12345"
				};
				
				Text
				{
					font = ScoreFont,
					name = "level2",
					x=0,y=kRowY+(1*kScoreRowSpace),w=kLevelX,h=kMax,
					flags = kHAlignRight + kVAlignTop,
					label = "12345"
				};
				
				Text
				{
					font = ScoreFont,
					name = "3",
					x=0,y=kRowY+(2*kScoreRowSpace),w=kNumberX,h=kMax,
					flags = kHAlignRight + kVAlignTop,
					label = "3."
				};
				
				Bitmap
				{
					image = "hiscore/p1icon.png",
					name = "p1_3",
					x=kP1X,y=kRowY+(2*kScoreRowSpace)
				};
				
				Text
				{
					font = ScoreFont,
					name = "name3",
					x=kNameX,y=kRowY+(2*kScoreRowSpace),w=kNameWidth,h=kNameHeight,
					flags = kHAlignLeft + kVAlignTop,
					label = "name"
				};
				
				Text
				{
					font = ScoreFont,
					name = "score3",
					x=0,y=kRowY+(2*kScoreRowSpace),w=kScoreX,h=kMax,
					flags = kHAlignRight + kVAlignTop,
					label = "12345"
				};
				
				Text
				{
					font = ScoreFont,
					name = "level3",
					x=0,y=kRowY+(2*kScoreRowSpace),w=kLevelX,h=kMax,
					flags = kHAlignRight + kVAlignTop,
					label = "12345"
				};
				
				Text
				{
					font = ScoreFont,
					name = "4",
					x=0,y=kRowY+(3*kScoreRowSpace),w=kNumberX,h=kMax,
					flags = kHAlignRight + kVAlignTop,
					label = "4."
				};
				
				Bitmap
				{
					image = "hiscore/p1icon.png",
					name = "p1_4",
					x=kP1X,y=kRowY+(3*kScoreRowSpace)
				};
				
				Text
				{
					font = ScoreFont,
					name = "name4",
					x=kNameX,y=kRowY+(3*kScoreRowSpace),w=kNameWidth,h=kNameHeight,
					flags = kHAlignLeft + kVAlignTop,
					label = "name"
				};
				
				Text
				{
					font = ScoreFont,
					name = "score4",
					x=0,y=kRowY+(3*kScoreRowSpace),w=kScoreX,h=kMax,
					flags = kHAlignRight + kVAlignTop,
					label = "12345"
				};
				
				Text
				{
					font = ScoreFont,
					name = "level4",
					x=0,y=kRowY+(3*kScoreRowSpace),w=kLevelX,h=kMax,
					flags = kHAlignRight + kVAlignTop,
					label = "12345"
				};
				
				Text
				{
					font = ScoreFont,
					name = "5",
					x=0,y=kRowY+(4*kScoreRowSpace),w=kNumberX,h=kMax,
					flags = kHAlignRight + kVAlignTop,
					label = "5."
				};
				
				Bitmap
				{
					image = "hiscore/p1icon.png",
					name = "p1_5",
					x=kP1X,y=kRowY+(4*kScoreRowSpace)
				};
				
				Text
				{
					font = ScoreFont,
					name = "name5",
					x=kNameX,y=kRowY+(4*kScoreRowSpace),w=kNameWidth,h=kNameHeight,
					flags = kHAlignLeft + kVAlignTop,
					label = "name"
				};
				
				Text
				{
					font = ScoreFont,
					name = "score5",
					x=0,y=kRowY+(4*kScoreRowSpace),w=kScoreX,h=kMax,
					flags = kHAlignRight + kVAlignTop,
					label = "12345"
				};
				
				Text
				{
					font = ScoreFont,
					name = "level5",
					x=0,y=kRowY+(4*kScoreRowSpace),w=kLevelX,h=kMax,
					flags = kHAlignRight + kVAlignTop,
					label = "12345"
				};
				
				Text
				{
					font = ScoreFont,
					name = "6",
					x=0,y=kRowY+(5*kScoreRowSpace),w=kNumberX,h=kMax,
					flags = kHAlignRight + kVAlignTop,
					label = "6."
				};
				
				Bitmap
				{
					image = "hiscore/p1icon.png",
					name = "p1_6",
					x=kP1X,y=kRowY+(5*kScoreRowSpace)
				};
				
				Text
				{
					font = ScoreFont,
					name = "name6",
					x=kNameX,y=kRowY+(5*kScoreRowSpace),w=kNameWidth,h=kNameHeight,
					flags = kHAlignLeft + kVAlignTop,
					label = "name"
				};
				
				Text
				{
					font = ScoreFont,
					name = "score6",
					x=0,y=kRowY+(5*kScoreRowSpace),w=kScoreX,h=kMax,
					flags = kHAlignRight + kVAlignTop,
					label = "12345"
				};
				
				Text
				{
					font = ScoreFont,
					name = "level6",
					x=0,y=kRowY+(5*kScoreRowSpace),w=kLevelX,h=kMax,
					flags = kHAlignRight + kVAlignTop,
					label = "12345"
				};
				
				Text
				{
					font = ScoreFont,
					name = "7",
					x=0,y=kRowY+(6*kScoreRowSpace),w=kNumberX,h=kMax,
					flags = kHAlignRight + kVAlignTop,
					label = "7."
				};
				
				Bitmap
				{
					image = "hiscore/p1icon.png",
					name = "p1_7",
					x=kP1X,y=kRowY+(6*kScoreRowSpace)
				};
				
				Text
				{
					font = ScoreFont,
					name = "name7",
					x=kNameX,y=kRowY+(6*kScoreRowSpace),w=kNameWidth,h=kNameHeight,
					flags = kHAlignLeft + kVAlignTop,
					label = "name"
				};
				
				Text
				{
					font = ScoreFont,
					name = "score7",
					x=0,y=kRowY+(6*kScoreRowSpace),w=kScoreX,h=kMax,
					flags = kHAlignRight + kVAlignTop,
					label = "12345"
				};
				
				Text
				{
					font = ScoreFont,
					name = "level7",
					x=0,y=kRowY+(6*kScoreRowSpace),w=kLevelX,h=kMax,
					flags = kHAlignRight + kVAlignTop,
					label = "12345"
				};
				
				Text
				{
					font = ScoreFont,
					name = "8",
					x=0,y=kRowY+(7*kScoreRowSpace),w=kNumberX,h=kMax,
					flags = kHAlignRight + kVAlignTop,
					label = "8."
				};
				
				Bitmap
				{
					image = "hiscore/p1icon.png",
					name = "p1_8",
					x=kP1X,y=kRowY+(7*kScoreRowSpace)
				};
				
				Text
				{
					font = ScoreFont,
					name = "name8",
					x=kNameX,y=kRowY+(7*kScoreRowSpace),w=kNameWidth,h=kNameHeight,
					flags = kHAlignLeft + kVAlignTop,
					label = "name"
				};
				
				Text
				{
					font = ScoreFont,
					name = "score8",
					x=0,y=kRowY+(7*kScoreRowSpace),w=kScoreX,h=kMax,
					flags = kHAlignRight + kVAlignTop,
					label = "12345"
				};
				
				Text
				{
					font = ScoreFont,
					name = "level8",
					x=0,y=kRowY+(7*kScoreRowSpace),w=kLevelX,h=kMax,
					flags = kHAlignRight + kVAlignTop,
					label = "12345"
				};
				
				Text
				{
					font = ScoreFont,
					name = "9",
					x=0,y=kRowY+(8*kScoreRowSpace),w=kNumberX,h=kMax,
					flags = kHAlignRight + kVAlignTop,
					label = "9."
				};
				
				Bitmap
				{
					image = "hiscore/p1icon.png",
					name = "p1_9",
					x=kP1X,y=kRowY+(8*kScoreRowSpace)
				};
				
				Text
				{
					font = ScoreFont,
					name = "name9",
					x=kNameX,y=kRowY+(8*kScoreRowSpace),w=kNameWidth,h=kNameHeight,
					flags = kHAlignLeft + kVAlignTop,
					label = "name"
				};
				
				Text
				{
					font = ScoreFont,
					name = "score9",
					x=0,y=kRowY+(8*kScoreRowSpace),w=kScoreX,h=kMax,
					flags = kHAlignRight + kVAlignTop,
					label = "12345"
				};
				
				Text
				{
					font = ScoreFont,
					name = "level9",
					x=0,y=kRowY+(8*kScoreRowSpace),w=kLevelX,h=kMax,
					flags = kHAlignRight + kVAlignTop,
					label = "12345"
				};
				
				Text
				{
					font = ScoreFont,
					name = "10",
					x=0,y=kRowY+(9*kScoreRowSpace),w=kNumberX,h=kMax,
					flags = kHAlignRight + kVAlignTop,
					label = "10."
				};
				
				Bitmap
				{
					image = "hiscore/p1icon.png",
					name = "p1_10",
					x=kP1X,y=kRowY+(9*kScoreRowSpace)
				};
				
				Text
				{
					font = ScoreFont,
					name = "name10",
					x=kNameX,y=kRowY+(9*kScoreRowSpace),w=kNameWidth,h=kNameHeight,
					flags = kHAlignLeft + kVAlignTop,
					label = "name"
				};
				
				Text
				{
					font = ScoreFont,
					name = "score10",
					x=0,y=kRowY+(9*kScoreRowSpace),w=kScoreX,h=kMax,
					flags = kHAlignRight + kVAlignTop,
					label = "12345"
				};
				
				Text
				{
					font = ScoreFont,
					name = "level10",
					x=0,y=kRowY+(9*kScoreRowSpace),w=kLevelX,h=kMax,
					flags = kHAlignRight + kVAlignTop,
					label = "12345"
				};
				
			};
			
			Bitmap
			{
				x = 420,
				y = 150,
				h = 300,
				w = 347,
				
				image="placeholder",	
				name="rightpanelsmall",
				
				Text
				{
					font = ScoreInfoFont,
					name = "yourrankglobalinfo",
					x=10,y=55,w=kMax-10,h=kMax,
					flags = kHAlignCenter + kVAlignTop,
					label = "globalhighscoreinfo"
				};
				
				Text
				{
					font = RankFont,
					name = "yourrank",
					x=10,y=15,w=kMax-10,h=kMax,
					flags = kHAlignCenter + kVAlignTop,
					label = "yourrank"
				};
				
				Text
				{
					font = RankFont,
					name = "congratulations",
					x=10,y=50,w=kMax-10,h=kMax,
					flags = kHAlignCenter + kVAlignTop,
					label = "congratshighscore"
				};
				
				Text
				{
					font = RankFont,
					name = "dnq",
					x=10,y=50,w=kMax-10,h=kMax,
					flags = kHAlignCenter + kVAlignTop,
					label = "scorednq"
				};
			},
			
			
			Bitmap
			{
				x = 420,
				y = 150,
				h = 300,
				w = 347,
				image="placeholder",	
				name="rightpanel",
				
				Text
				{
					font = TableHeaderFont,
					name = "globalinfoheader",
					x=0,y=15,w=kMax,h=kMax,
					flags = kHAlignCenter + kVAlignTop,
					label = "globalhighscores"
				};
				
				Text
				{
					font = ScoreInfoFont,
					name = "info",
					x=10,y=55,w=kMax-10,h=kMax,
					flags = kHAlignCenter + kVAlignTop,
					label = "globalhighscoreinfo"
				};
					
				
				SetStyle(SmallButtonStyle);
				Button
				{
					x=kCenter,
					y=160,
					name="moreinfo",
					label="moreinfo",
					type = kPush,
					command =
						function()
							DoModal("scripts/hiscoreinfo.lua");
						end
					
				};
				SetStyle(DefaultStyle);
				
				
				Text
				{
					font = EligibleFont,
					name = "eligible",
					x=10,y=220,w=kMax-10,h=60,
					flags = kHAlignCenter + kVAlignTop,
					label = "eligible"
				};
				
				
			
					
				SetStyle(SmallButtonStyle);
				Button
				{
					x=kCenter,
					y=270,
					name="submit",
					label="submit",
					type = kPush
				};
				SetStyle(DefaultStyle);
			};
			
			Text
			{
				font = EligibleAsteriskFont,
				name = "eligibleasterisk",
				x=405,y=550,w=kMax-50,h=kMax,
				flags = kHAlignLeft + kVAlignTop,
				label = "eligibleasterisk",
				padding=0
			};
			
			
			
			Text
			{
				font = ConnectingToServerFont,
				name = "server",
				x=430,y=362,w=327,h=130,
				flags = kHAlignCenter + kVAlignCenter,
				label = "connectingtoserver"
			};
			
			Text
			{
				font = ConnectingToServerFont,
				name = "error",
				x=485,y=362,w=258,h=130,
				flags = kHAlignCenter + kVAlignCenter,
				label = "Server error"
			};
			
			
			
			
			
			Button
			{
				font = StandardButtonFont,
				graphics = LeftArrowGraphics,
				name="gamemodeleft",
				label="",
				type = kPush,
				x=150,
				y=83,
				scale = 0.8
			};
			
			Button
			{
				font = StandardButtonFont,
				graphics = RightArrowGraphics,
				name="gamemoderight",
				label="",
				type = kPush,
				x=580,
				y=83,
				scale = 0.8
			};
			
			
			
			
			
			Button
			{
				font = StandardButtonFont,
				graphics = UpButtonGraphics,
				name="scrollup",
				label="",
				type = kPush,
				x=405,
				y=225,
				scale = 0.8
			};
			
			Button
			{
				font = StandardButtonFont,
				graphics = DownButtonGraphics,
				name="scrolldown",
				label="",
				type = kPush,
				x=405,
				y=430,
				scale = 0.8
			};
			
			
			
			
			Button
			{
				x=37,
				y=500,
				font = ChangeViewFont,
				graphics = LargeButtonGraphics,
				name="view",
				label="viewglobal",
				type = kPush
			};
			
			Button
			{
				x=37,
				y=500,
				font = ChangeViewFont,
				graphics = LargeButtonGraphics,
				name="viewlocal",
				label="viewlocal",
				type = kPush
			};
			
			SetStyle(StandardButtonStyle);
			Button
			{
				x=500,
				y=500,
				name="back",
				flags = kHAlignCenter + kVAlignCenter,
				label="back",
				command = 
					function()
						PopModal(); -- take off high score menu, restart game loop
					end
			};
			SetStyle(DefaultStyle);
		}
	}
}
