class RPGMenuMain expands MenuUIMenuWindow;

// ----------------------------------------------------------------------
// InitWindow()
//
// Initialize the Window
// ----------------------------------------------------------------------

event InitWindow()
{
	Super.InitWindow();

	UpdateButtonStatus();
	ShowVersionInfo();
}

function ProcessCustomMenuButton(string key)
{
	switch(key)
	{
		//case "CREDZ":
		//	_MMRPGPlayer(Player).ShowCredzYe();
		//	break;
		case "DISCONNECT":
			Player.DisconnectPlayer();
			break;
		case "RECONNECT":
			_MMRPGPlayer(Player).Reconnect();
			break;

	}
}

function bool ButtonActivated( Window buttonPressed )
{
	if (buttonPressed == winButtons[3])
		_MMRPGPlayer(Player).CredInst = 1;

	Super.ButtonActivated(buttonPressed);
}



function UpdateButtonStatus()
{
	local DeusExLevelInfo info;

	info = player.GetLevelInfo();

         winButtons[5].SetSensitivity(False);
}

// ----------------------------------------------------------------------
// ShowVersionInfo()
// ----------------------------------------------------------------------

function ShowVersionInfo()
{
	local TextWindow version;
	local string str;

	str="~ MainMan's City ~ 2007 ~";
	version = TextWindow(NewChild(Class'TextWindow'));
	version.SetTextMargins(0, 0);
	version.SetWindowAlignments(HALIGN_Right, VALIGN_Bottom);
	version.SetTextColorRGB(255, 255, 255);
	version.SetTextAlignments(HALIGN_Right, VALIGN_Bottom);
//	version.SetText(player.GetDeusExVersion());
	version.SetText(str);
}

// ----------------------------------------------------------------------
//



defaultproperties
{
     ButtonNames(0)="Preferences"
     ButtonNames(1)="Return"
     ButtonNames(2)="Disconnect"
     ButtonNames(3)="Credits"
     ButtonNames(4)="Exit"
     ButtonNames(5)="© ~MainMan~"
     buttonXPos=7
     buttonWidth=245
     buttonDefaults(0)=(Y=13,Invoke=Class'DeusEx.MenuSettings')
     buttonDefaults(1)=(Y=49,Action=MA_Previous)
     buttonDefaults(2)=(Y=85,Action=MA_Custom,Key="DISCONNECT")
     buttonDefaults(3)=(Y=121,Action=MA_Previous)
     buttonDefaults(4)=(Y=157,Action=MA_Quit)
     buttonDefaults(5)=(Y=215,Action=MA_Previous)
     Title="MainMan's City"
     ClientWidth=258
     ClientHeight=257
     verticalOffset=2
     clientTextures(0)=Texture'DeusExUI.UserInterface.MenuMultiplayerBackground_1'
     clientTextures(1)=Texture'DeusExUI.UserInterface.MenuMultiplayerBackground_2'
     clientTextures(2)=Texture'DeusExUI.UserInterface.MenuMultiplayerBackground_3'
     textureCols=2
}
