//=============================================================================
// UnrealNewGameMenu
//=============================================================================
class UnrealNewGameMenu expands UnrealGameMenu;

function PostBeginPlay()
{
	CallParent.PostBeginPlay();
	Selection = Clamp(Level.Game.Difficulty + 1,1,4);
} 

function bool ProcessSelection()
{
	local Menu ChildMenu;

	Level.Game.Difficulty = Selection - 1;
	SaveConfigs();
	PlayerOwner.ReStartLevel(); 
	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("EASY", False);
	Canvas.SetPos(StartX, StartY + Spacing );
	Canvas.DrawText("MEDIUM", False);
	Canvas.SetPos(StartX, StartY + 2 * Spacing );
	Canvas.DrawText("HARD", False);
	Canvas.SetPos(StartX, StartY + 3 * Spacing );
	Canvas.DrawText("UNREAL", 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);
}

