class UMenuGameMenu expands UMenuPulldownMenu;

var UWindowPulldownMenuItem NewGame, Load, Save, GameOptions, Botmatch, Quit, Mek;

var localized string[32] NewGameName;
var localized string[240] NewGameHelp;
var localized string[32] LoadName;
var localized string[240] LoadHelp;
var localized string[32] SaveName;
var localized string[240] SaveHelp;
var localized string[32] BotmatchName;
var localized string[240] BotmatchHelp;
var localized string[32] QuitName;
var localized string[240] QuitHelp;

function Created()
{
	Super.Created();

	// Add menu items.
	NewGame = AddMenuItem(NewGameName, None);
	NewGame.bDisabled = True;
	Load = AddMenuItem(LoadName, None);
	Load.bDisabled = True;
	Save = AddMenuItem(SaveName, None);
	Save.bDisabled = True;
	AddMenuItem("-", None);
	Botmatch = AddMenuItem(BotmatchName, None);
	Botmatch.bDisabled = True;
	AddMenuItem("-", None);
	Quit = AddMenuItem(QuitName, None);
	AddMenuItem("-", None);
	Mek = AddMenuItem("&Mek's Test - Please Leave", None);
}


function ExecuteItem(UWindowPulldownMenuItem I) 
{
	switch(I)
	{
	case NewGame:
		// Create new game subwindow.
		return;
	case Load:
		// Create load game subwindow.
		break;
	case Save:
		// Create save game subwindow.
		break;
	case Botmatch:
		// Create botmatch subwindow
		break;
	case Quit:
		GetMenuBar().SaveConfig();
		Root.SaveConfig();
		Root.Console.SaveConfig();
		Root.Console.ViewPort.Actor.SaveConfig();
		if ( Level.Game != None ) {
			Level.Game.SaveConfig();
			Level.Game.GameReplicationInfo.SaveConfig();
		}
		Root.Console.ViewPort.Actor.ConsoleCommand("exit");
		break;
	case Mek:
		Root.CreateWindow(class'UMenuTempWindow', 100, 100, 128, 128);
		UMenuTempWindow(Root.CreateWindow(class'UMenuTempWindow', 110, 110, 128, 128)).bStatusBar = False;
		break;
	}

	Super.ExecuteItem(I);
}

function Select(UWindowPulldownMenuItem I)
{
	switch(I)
	{
	case NewGame:
		UMenuMenuBar(GetMenuBar()).SetHelp(NewGameHelp, I.Caption);
		return;
	case Load:
		UMenuMenuBar(GetMenuBar()).SetHelp(LoadHelp, I.Caption);
		break;
	case Save:
		UMenuMenuBar(GetMenuBar()).SetHelp(SaveHelp, I.Caption);
		break;
	case Botmatch:
		UMenuMenuBar(GetMenuBar()).SetHelp(BotmatchHelp, I.Caption);
		break;
	case Quit:
		UMenuMenuBar(GetMenuBar()).SetHelp(QuitHelp, I.Caption);
		break;
	}

	Super.Select(I);
}

defaultproperties
{
	NewGameName="New"
	NewGameHelp="Select to setup a new single player game of Unreal."
	LoadName="Load"
	LoadHelp="Select to load a previously saved game."
	SaveName="Save"
	SaveHelp="Select to save your current game."
	BotmatchName="Botmatch"
	BotmatchHelp="Select to begin a game of Botmatch: Deathmatch with Bots!"
	QuitName="Quit"
	QuitHelp="Select to save preferences and exit Unreal."
}