class UMenuMultiplayerMenu expands UMenuPulldownMenu;

var UWindowPulldownMenuItem Join, Start, Player, Browser;
var UBrowserMainWindow MainWindow;

var localized string[32] JoinName;
var localized string[32] StartName;
var localized string[32] PlayerMenuName;
var localized string[32] BrowserName;

function Created()
{
	Super.Created();

	Join = AddMenuItem(JoinName, None);
	Start = AddMenuItem(StartName, None);
	Start.bDisabled = True;
	Player = AddMenuItem(PlayerMenuName, None);
	Player.bDisabled = True;
	AddMenuItem("-", None);
	Browser = AddMenuItem(BrowserName, None);

	Join.CreateSubMenu(class'UMenuJoinMenu');
}


function ExecuteItem(UWindowPulldownMenuItem I) 
{
	switch(I)
	{
	case Join:
		// Join submenu.
		return;
	case Start:
		// Create start subwindow.
		break;
	case Player:
		// Create player subwindow.
		break;
	case Browser:
		if(MainWindow == None)
		{
			MainWindow = UBrowserMainWindow(Root.CreateWindow(class'UBrowserMainWindow', 50, 30, 500, 300));
		} else {
			MainWindow.ShowWindow();
		}

		MainWindow.SetSize(Min(500, Root.WinWidth - 10), Root.WinHeight-50);

		MainWindow.WinLeft = Int((Root.WinWidth - MainWindow.WinWidth) / 2);
		MainWindow.WinTop = Int((Root.WinHeight - MainWindow.WinHeight) / 2);
		break;
	}

	Super.ExecuteItem(I);
}

defaultproperties
{
	JoinName="Join Game"
	StartName="Start New Game"
	PlayerMenuName="Player Setup"
	BrowserName="Unreal Browser"
}