//=============================================================================
// UnrealQuitMenu
//=============================================================================
class UnrealQuitMenu expands UnrealMenu;

var bool bResponse;

function bool ProcessYes()
{
	bResponse = true;
	return true;
}

function bool ProcessNo()
{
	bResponse = false;
	return true;
}

function bool ProcessLeft()
{
	bResponse = !bResponse;
	return true;
}

function bool ProcessRight()
{
	bResponse = !bResponse;
	return true;
}

function bool ProcessSelection()
{
	local Menu ChildMenu;

	ChildMenu = None;

	if ( bResponse )
	{
		PlayerOwner.SaveConfig('PlayerPawn');
		if ( Level.Game != None )
			Level.Game.SaveConfig();
		PlayerOwner.ConsoleCommand("Exit");
	}
	else 
		ExitMenu();
}

function DrawMenu(canvas Canvas)
{
	local int StartX, StartY, Spacing;
	
	StartX = Max(8, 0.5 * Canvas.ClipX - 64);
	StartY = Max(4, 0.5 * Canvas.ClipY - 32);
	Canvas.Font = Font'MedFont';

	// draw text
	Canvas.SetPos(StartX, StartY );
	Canvas.DrawText("Quit?", False);
	Canvas.SetPos(StartX + 48, StartY + Spacing );
	if ( bResponse )
		Canvas.DrawText("[YES]  No", False);
	else
		Canvas.DrawText(" Yes  [NO]", False);

	// Draw help panel
	DrawHelpPanel(Canvas, 0.5 * Canvas.ClipY + 16);
}

