//=============================================================================
// UnrealDMGameOptionsMenu
//=============================================================================
class UnrealDMGameOptionsMenu expands UnrealGameOptionsMenu;

function bool ProcessYes()
{
	if ( Selection == 6 )
		DeathMatchGame(Level.Game).bCoopWeaponMode = True;		
	else if ( Selection == 7 )
		DeathMatchGame(Level.Game).bNoExit = False;	
	else 
		return CallParent.ProcessYes();

	return true;
}

function bool ProcessNo()
{
	if ( Selection == 6 )
		DeathMatchGame(Level.Game).bCoopWeaponMode = False;		
	else if ( Selection == 7 )
		DeathMatchGame(Level.Game).bNoExit = True;	
	else 
		return CallParent.ProcessNo();

	return true;
}

function bool ProcessLeft()
{
	if ( Selection == 3 )
		DeathMatchGame(Level.Game).FragLimit = FMax(0, DeathMatchGame(Level.Game).FragLimit - 5);
	else if ( Selection == 4 )
		DeathMatchGame(Level.Game).TimeLimit = FMax(0, DeathMatchGame(Level.Game).TimeLimit - 5);
	else if ( Selection == 5 )
		DeathMatchGame(Level.Game).MaxPlayers = Max(1, DeathMatchGame(Level.Game).MaxPlayers - 1);
	else if ( Selection == 6 )
		DeathMatchGame(Level.Game).bCoopWeaponMode = !DeathMatchGame(Level.Game).bCoopWeaponMode;		
	else if ( Selection == 7 )
		DeathMatchGame(Level.Game).bNoExit = !DeathMatchGame(Level.Game).bNoExit;	
	else 
		return CallParent.ProcessLeft();

	return true;
}

function bool ProcessRight()
{
	if ( Selection == 3 )
		DeathMatchGame(Level.Game).FragLimit += 5;
	else if ( Selection == 4 )
		DeathMatchGame(Level.Game).TimeLimit += 5;
	else if ( Selection == 5 )
		DeathMatchGame(Level.Game).MaxPlayers += 1;
	else if ( Selection == 6 )
		DeathMatchGame(Level.Game).bCoopWeaponMode = !DeathMatchGame(Level.Game).bCoopWeaponMode;		
	else if ( Selection == 7 )
		DeathMatchGame(Level.Game).bNoExit = !DeathMatchGame(Level.Game).bNoExit;	
	else 
		return CallParent.ProcessRight();

	return true;
}

function bool ProcessSelection()
{
	local Menu ChildMenu;

	if ( Selection == 6 )
		DeathMatchGame(Level.Game).bCoopWeaponMode = !DeathMatchGame(Level.Game).bCoopWeaponMode;		
	else if ( Selection == 7 )
		DeathMatchGame(Level.Game).bNoExit = !DeathMatchGame(Level.Game).bNoExit;	
	else
		return CallParent.ProcessSelection();

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

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

function int DrawOptions(canvas Canvas, int StartX, int StartY, int Spacing)
{
	StartY = CallParent.DrawOptions(Canvas, StartX, StartY, Spacing);

	// draw text
	Canvas.SetPos(StartX, StartY );
	Canvas.DrawText("Frag limit", False);
	Canvas.SetPos(StartX + 160, StartY );
	Canvas.DrawText(DeathMatchGame(Level.Game).FragLimit, False);
	Canvas.SetPos(StartX, StartY + Spacing );
	Canvas.DrawText("Time Limit", False);
	Canvas.SetPos(StartX + 160, StartY + Spacing );
	Canvas.DrawText(DeathMatchGame(Level.Game).TimeLimit, False);
	Canvas.SetPos(StartX, StartY + 2 * Spacing );
	Canvas.DrawText("Max Players", False);
	Canvas.SetPos(StartX + 160, StartY + 2 * Spacing );
	Canvas.DrawText(DeathMatchGame(Level.Game).MaxPlayers, False);
	Canvas.SetPos(StartX, StartY + 3 * Spacing );
	Canvas.DrawText("Coop Weapon Mode", False);
	Canvas.SetPos(StartX + 160, StartY + 3 * Spacing );
	Canvas.DrawText(DeathMatchGame(Level.Game).bCoopWeaponMode, False);
	Canvas.SetPos(StartX, StartY + 4 * Spacing );
	Canvas.DrawText("Exiting Allowed", False);
	Canvas.SetPos(StartX + 160, StartY + 4 * Spacing );
	Canvas.DrawText(!DeathMatchGame(Level.Game).bNoExit, False);

	return (StartY + 5*Spacing);
}

