//Copyright (C) Ben Parbury - All Rights Reserved. Unauthorized copying of this file, via any medium is strictly prohibited. Written by Ben Parbury <ben@gridlockinteractive.com> 2014
function LevelScript()
{
	this.CreateCreditsMenu = function()
	{
		this.credits = new Menu("Credits", EMenuLayout.Grid, new MenuGrid(5, 29));

		this.credits.AddMenuItem(new Text("Created by"), EMenuItemStyle.Medium, new Vec2(2, 1));
		this.credits.AddMenuItem(new Text("Ben Parbury"), EMenuItemStyle.Small, new Vec2(2, 3));
		this.credits.AddMenuItem(new Text("Audio by"), EMenuItemStyle.Medium, new Vec2(2, 5));
		this.credits.AddMenuItem(new Text("Ross Tregenza"), EMenuItemStyle.Small, new Vec2(2, 7));
		this.credits.AddMenuItem(new Text("Graeme Norgate"), EMenuItemStyle.Small, new Vec2(2, 9));
		this.credits.AddMenuItem(new Text("Additional Coding"), EMenuItemStyle.Medium, new Vec2(2, 11));
		this.credits.AddMenuItem(new Text("Nathaniel Wooding"), EMenuItemStyle.Small, new Vec2(2, 13));
		this.credits.AddMenuItem(new Text("Special Thanks"), EMenuItemStyle.Medium, new Vec2(2, 15));
		
		var specialThanks = [ "Pete Bottomley", "Chris Brown", "Han Carpenter", "Mat Carpenter", "Charlie Cole",
		"James Cooper", "Steph Charij", "Abigail Cox", "Liz Davenport", "Colin Gulliver", "Sam Howels", "Tony Jackson",
		"Steve Kirby", "Ho-Yee Li", "Margaret Parbury", "Luke Pressley", "Rich Smith", "Simon Vickers", "Jenny Walker",
		"Rich Welsh", "Dan Peake", "Tim Pinder", "Barry Clark", "Stephen Barnett", "Claire Moncrieff", "Jonathan Bunner",
		"Joe Moudling", "Aidan Wilson", "Derek Littlewood", "Anand Misir", "Dan Train", "East Midlands Indies", "Fasahat Salim",
		"Anna Beck-Thomsen", "Pete Cassell", "Josh Singer"];
		specialThanks.sort();
		var count = 0;
		var rows = specialThanks.length/5;
		for(var y = 0; y < rows; y++)
		{
			for(var x = 0; x < 5; x++)
			{
				if(count < specialThanks.length)
				{
					this.credits.AddMenuItem(new Text(specialThanks[count]), EMenuItemStyle.Tiny, new Vec2(x, y + 17));
				}
				count++;
			}
		}
		this.credits.AddMenuItem(new Button("Back", function() 
		{ gLevelSystem.LoadLevel("Menu", "Extras");}), EMenuItemStyle.Small, new Vec2(1, rows + 19));
		
		this.credits.AddMenuItem(new Button("Licenses", function() { gLevelSystem.LoadLevel("Menu", "Licenses"); }), EMenuItemStyle.Small, new Vec2(3, rows + 19));

		gMenuSystem.Register(this.credits);
	}

	this.Load = function()
	{
		this.CreateCreditsMenu();
	}
	
	this.Unload = function()
	{
		gMenuSystem.Unregister(this.credits);
	}
	
	this.Update = function()
	{
	}
	
	this.DrawClear = function()
	{
	}
	
	this.Draw = function()
	{
	}
	
	this.Debug = function()
	{
	}
}

