//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.CreateTitleMenu = function()
	{
		var title = new Menu("Title", EMenuLayout.Grid, new MenuGrid(5, 25));

		title.AddMenuItem(new Text("Polyology"), EMenuItemStyle.Title, new Vec2(2, 4));
		title.AddMenuItem(new Text("Demo", 'right'), EMenuItemStyle.Small, new Vec2(3, 7));
		
		title.AddMenuItem(new Button("Play",
		function()
		{
			gLevelSystem.LoadLevel("Vanilla", "Blocks");
			gSounds.Get("pauseClose").Play();
		}), EMenuItemStyle.Medium, new Vec2(2, 9));
		
		title.AddMenuItem(new Button("Options", function()
		{
			var titleMenu = gMenuSystem.FindMenu("Title")
			gMenuSystem.Unregister(titleMenu);
			gMenuSystem.Register(gOptionsMenu);
			gOptionsMenu.SetParentMenu(titleMenu);
		}), EMenuItemStyle.Medium, new Vec2(2, 13));
		
		title.AddMenuItem(new Button("Extras", function() { gLevelSystem.LoadLevel("Menu", "Extras"); }), EMenuItemStyle.Medium, new Vec2(2, 17));
		
		//if(gCommands)
		{
			title.AddMenuItem(new Button("Quit",
			function() {
				Command("quit");
				}), EMenuItemStyle.Medium, new Vec2(2, 21));
		}

		
		return title;
	}

	this.Load = function()
	{
		this.title = this.CreateTitleMenu();
		gMenuSystem.Register(this.title);
	}
	
	this.Unload = function()
	{
		gMenuSystem.Unregister(this.title);
	}
	
	this.Update = function()
	{
	}
	
	this.DrawClear = function()
	{
	}
	
	this.Draw = function()
	{
	}
	
	this.Debug = function()
	{
	}
}

