//=============================================================================
// UnrealGameMenu
//=============================================================================
class UnrealGameMenu expands UnrealMenu;

function bool ProcessSelection()
{
	local Menu ChildMenu;

	if ( Selection == 1 )
		ChildMenu = spawn(class'UnrealSlotMenu', owner);
	else if ( Selection == 2 ) 
	{
		ChildMenu = spawn(class'UnrealSlotMenu', owner);
		UnrealSlotMenu(ChildMenu).bSaveMenu = true;
	}
	else if ( Selection == 3 )
		ChildMenu = spawn(class'UnrealNewGameMenu', owner);
	else if ( Selection == 4 )
	{
		if ( (Level.Game != None) && (Level.Game.GameMenuType != None) )
			ChildMenu = Menu(spawn(Level.Game.GameMenuType, owner));
	}
	else 
		return false;

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

function SaveConfigs()
{
	Level.Game.SaveConfig();
}

function DrawMenu(canvas Canvas)
{
	local int StartX, StartY, Spacing;
	local string[16] SkillName;
	
	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("LOAD GAME", False);
	Canvas.SetPos(StartX, StartY + Spacing );
	Canvas.DrawText("SAVE GAME", False);
	Canvas.SetPos(StartX, StartY + 2 * Spacing );
	Canvas.DrawText("NEW GAME", False);
	Canvas.SetPos(StartX, StartY + 3 * Spacing );
	Canvas.DrawText("GAME OPTIONS", 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);
}

