//=============================================================================
// UnrealMainMenu
//=============================================================================
class UnrealMainMenu expands UnrealMenu;

function bool ProcessSelection()
{
	local Menu ChildMenu;

	ChildMenu = None;

	if ( Selection == 1 )
		ChildMenu = spawn(class'UnrealGameMenu', owner);
	else if ( Selection == 2 )
		ChildMenu = spawn(class'UnrealMultiPlayerMenu', owner);
	else if ( Selection == 3 )
		ChildMenu = spawn(class'UnrealOptionsMenu', owner);
	else	
		ChildMenu = spawn(class'UnrealQuitMenu', owner);

	if ( ChildMenu != None )
	{
		HUD(Owner).MainMenu = ChildMenu;
		ChildMenu.ParentMenu = self;
		ChildMenu.PlayerOwner = PlayerOwner;
	}
	return true;
}

function DrawMenu(canvas Canvas)
{
	local int StartX, StartY, Spacing;
	
	Spacing = Clamp(0.1 * Canvas.ClipY, 32, 48);
	StartX = Max(40, 0.5 * Canvas.ClipX - 96);
	StartY = Max(4, 0.5 * (Canvas.ClipY - 5 * Spacing - 128));
	Canvas.Font = Font'LargeFont';

	// draw text
	Canvas.SetPos(StartX, StartY );
	Canvas.DrawText("GAME", False);
	Canvas.SetPos(StartX, StartY + Spacing );
	Canvas.DrawText("MULTIPLAYER", False);
	Canvas.SetPos(StartX, StartY + 2 * Spacing );
	Canvas.DrawText("OPTIONS", False);
	Canvas.SetPos(StartX, StartY + 3 * Spacing );
	Canvas.DrawText("QUIT", False);

	// show selection
	Canvas.SetPos( StartX - 36, StartY - Spacing + Spacing * Selection);
	Canvas.DrawIcon(Texture'IconSkull', 1.0);	

	// Draw help panel
	DrawHelpPanel(Canvas, StartY + (MenuLength + 1) * Spacing);
}

