//=============================================================================
// ComputerScreenEmail
//=============================================================================

class ComputerScreenGoalz expands ComputerUIWindow;


var MenuUIHeaderWindow          winHeader;
var MenuUIActionButtonWindow    btnSpecial;
var MenuUIActionButtonWindow    btnLogout;
var MenuUIListWindow            lstBulletins;
var MenuUINormalLargeTextWindow winBulletin;

var Localized String NoBulletinsTodayText;
var Localized String BulletinsHeaderText;


// ----------------------------------------------------------------------
// CreateControls()
// ----------------------------------------------------------------------

function CreateControls()
{
	Super.CreateControls();

	//btnLogout = winButtonBar.AddButton(ButtonLabelLogout, HALIGN_Right);

	CreateHeaderWindow();
	CreateBulletinsListWindow();
	CreateBulletinViewWindow();
}

// ----------------------------------------------------------------------
// CreateHeaderWindow()
// ----------------------------------------------------------------------

function CreateHeaderWindow()
{
	winHeader = MenuUIHeaderWindow(winClient.NewChild(Class'MenuUIHeaderWindow'));
	winHeader.SetPos(11, 6);
	winHeader.SetSize(300, 12);
	winHeader.SetTextAlignments(HALIGN_Left, VALIGN_Top);
	winHeader.SetText(BulletinsHeaderText);
}

// ----------------------------------------------------------------------
// CreateBulletinsListWindow()
// ----------------------------------------------------------------------

function CreateBulletinsListWindow()
{
	local MenuUIScrollAreaWindow winScroll;

	winScroll = CreateScrollAreaWindow(winClient);
	winScroll.SetPos(11, 22);
	//winScroll.SetSize(373, 113);
	winScroll.SetSize(373, 373);

	lstBulletins = MenuUIListWindow(winScroll.clipWindow.NewChild(Class'MenuUIListWindow'));
	lstBulletins.EnableMultiSelect(False);
	lstBulletins.EnableAutoExpandColumns(False);
	lstBulletins.EnableHotKeys(False);
	lstBulletins.SetSize(373, 373);

	lstBulletins.SetNumColumns(1);
	lstBulletins.SetColumnWidth(0, 373);
}

// ----------------------------------------------------------------------
// CreateBulletinViewWindow()
// ----------------------------------------------------------------------

function CreateBulletinViewWindow()
{
}

// ----------------------------------------------------------------------
// SetNetworkTerminal()
// ----------------------------------------------------------------------

function SetNetworkTerminal(NetworkTerminal newTerm)
{
	Super.SetNetworkTerminal(newTerm);

	if (winTerm.AreSpecialOptionsAvailable())
	{
		btnSpecial = winButtonBar.AddButton(ButtonLabelSpecial, HALIGN_Left);
		CreateLeftEdgeWindow();
	}
}

// ----------------------------------------------------------------------
// SetCompOwner()
// ----------------------------------------------------------------------

function SetCompOwner(ElectronicDevices newCompOwner)
{
	local int bulletinIndex;
	local int rowId;
	local int eIndex;

	Super.SetCompOwner(newCompOwner);

	_MMRPGPlayer(Player).UpdMis();

	// Now populate the bulletins
	//if (compOwner != None)
	if(compOwner == None)
	{
		// Now populate our list
		for(bulletinIndex=0; bulletinIndex<=9; bulletinIndex++)
		{
			if(bulletinIndex == 0)
			{
				if(_MMRPGPlayer(Player).bClubMission == 2)
				{
					lstBulletins.AddRow("Hooker [Near Asteur Apts]");
					lstBulletins.AddRow("- Find the pistol belonging to the hooker's boyfriend and return it to her.");
					lstBulletins.AddRow("  [ADDITIONAL NOTES: Pistol was taken by a cop.]");
					lstBulletins.AddRow("    ");
				}
			}
			if(bulletinIndex == 1)
			{
				if(_MMRPGPlayer(Player).bColaMission == 2)
				{
					lstBulletins.AddRow("Boy [Abandoned Bar]");
					lstBulletins.AddRow("- Get some BlueCola for the boy, in return for access to the NSF base.");
					lstBulletins.AddRow("  [ADDITIONAL NOTES: BlueCola is not yet avaliable publically, and so it is rare.]");
					lstBulletins.AddRow("   ");
				}
				if(_MMRPGPlayer(Player).bColaMission == 3)
				{
					lstBulletins.AddRow("Boy [Abandoned Bar]");
					lstBulletins.AddRow("- Get some BlueCola for the boy, in return for access to the NSF base.");
					lstBulletins.AddRow("  [ADDITIONAL NOTES: BlueCola is not yet avaliable publically, and so it is rare.]");
					lstBulletins.AddRow("   ");

					lstBulletins.AddRow("Restaurant Owner [Fuhao Dragon]");
					lstBulletins.AddRow("- Steal the recipe from the Pung Yao restaurant, and bring it to the");
					lstBulletins.AddRow("  Fuhao Dragon in return for some BlueCola.");
					lstBulletins.AddRow("   ");
				}
				if(_MMRPGPlayer(Player).bColaMission == 4)
				{
					lstBulletins.AddRow("Boy [Abandoned Bar]");
					lstBulletins.AddRow("- Get some BlueCola for the boy, in return for access to the NSF base.");
					lstBulletins.AddRow("  [ADDITIONAL NOTES: BlueCola is not yet avaliable publically, and so it is rare.]");
					lstBulletins.AddRow("   ");
				}
			}
			if(bulletinIndex == 2)
			{
				if(_MMRPGPlayer(Player).bArenaMission == 2)
				{
					lstBulletins.AddRow("Bum [City Park]");
					lstBulletins.AddRow("- Go behind Stretto's and look for a man recruiting for a fighting arena.");
					lstBulletins.AddRow("- Pass his trial to gain access to the arena in the abandoned metro.");
					lstBulletins.AddRow("   ");
				}
				if(_MMRPGPlayer(Player).bArenaMission == 3)
				{
					lstBulletins.AddRow("Arena Recruiter [Alley]");
					lstBulletins.AddRow("- Pass the recruiter's trial to gain access to the arena in the abandoned metro.");
					lstBulletins.AddRow("   ");
				}
			}
			if(bulletinIndex == 3)
			{
				if(_MMRPGPlayer(Player).bKillMission == 2)
				{
					lstBulletins.AddRow("Man [Cafe Stretto]");
					lstBulletins.AddRow("- Johnny in the Lady Luck Bar is looking for an assassin.");
					lstBulletins.AddRow("   ");
				}
				if(_MMRPGPlayer(Player).bKillMission == 3)
				{
					lstBulletins.AddRow("Johnny [Lady Luck Bar]");
					lstBulletins.AddRow("- Kill the businessman for Johnny.");
					lstBulletins.AddRow("  [ADDITIONAL NOTES: He often spends time in the Players' Club.]");
					lstBulletins.AddRow("   ");
				}
				if(_MMRPGPlayer(Player).bKillMission == 4)
				{
					lstBulletins.AddRow("Johnny [Lady Luck Bar]");
					lstBulletins.AddRow("- Speak to Johnny to tell him about the businessman.");
					lstBulletins.AddRow("   ");
				}
			}
			if(bulletinIndex == 4)
			{
				if(_MMRPGPlayer(Player).bThiefMission == 2)
				{
					lstBulletins.AddRow("Thief [MainMan's Club]");
					lstBulletins.AddRow("- Steal the Golden Lion Statue from an apartment in the Old Market Place.");
					lstBulletins.AddRow("   ");
				}
			}
			if(bulletinIndex == 5)
			{
				if(_MMRPGPlayer(Player).bpaxxMission == 2)
				{
					lstBulletins.AddRow("Cop [Juke Box Cafe]");
					lstBulletins.AddRow("- Free the hostages in the apartment above the clothes shop.");
					lstBulletins.AddRow("   ");
				}
				if(_MMRPGPlayer(Player).bpaxxMission == 3)
				{
					lstBulletins.AddRow("Cop [Juke Box Cafe]");
					lstBulletins.AddRow("- Free the hostages in the apartment above the clothes shop.");
					lstBulletins.AddRow("   ");
				}
				if(_MMRPGPlayer(Player).bpaxxMission == 4)
				{
					lstBulletins.AddRow("Cop [Juke Box Cafe]");
					lstBulletins.AddRow("- Inform the cop of the freeing of the hostages.");
					lstBulletins.AddRow("   ");
				}
			}
			if(bulletinIndex == 6)
			{
				if(_MMRPGPlayer(Player).bSpyMission == 2)
				{
					lstBulletins.AddRow("Woman [Fox Pointe Apartments]");
					lstBulletins.AddRow("- Spy on the top window on the East side of the Fox Pointe apartments.");
					lstBulletins.AddRow("  [ADDITIONAL NOTES: There is a security camera outside the front door.]");
					lstBulletins.AddRow("   ");
				}
				if(_MMRPGPlayer(Player).bSpyMission == 3)
				{
					lstBulletins.AddRow("Woman [Fox Pointe Apartments]");
					lstBulletins.AddRow("- Tell the spy the details of the conversation you recorded.");
					lstBulletins.AddRow("   ");
				}
			}
			if(bulletinIndex == 7)
			{
				if(_MMRPGPlayer(Player).bcontMission == 2)
				{
					lstBulletins.AddRow("Man [Park Entrance]");
					lstBulletins.AddRow("- Sabotage the arms dealer's apartment (Fox Pointe apartments) by");
					lstBulletins.AddRow("  placing a timed bomb on his wall");
					lstBulletins.AddRow("  [ADDITIONAL NOTES: Extra bombs availabe from man.]");
					lstBulletins.AddRow("   ");
				}
				if(_MMRPGPlayer(Player).bcontMission == 3)
				{
					lstBulletins.AddRow("Man [Park Entrance]");
					lstBulletins.AddRow("- Get back to the man to tell him of the success of the mission.");
					lstBulletins.AddRow("   ");
				}
			}
			if(bulletinIndex == 8)
			{
				if(_MMRPGPlayer(Player).bbeerMission == 2)
				{
					lstBulletins.AddRow("Female [Lady Luck Bar]");
					lstBulletins.AddRow("- Buy a bottle of Biesdorfer Schwarzbier for the woman.");
					lstBulletins.AddRow("   ");
				}
			}
		}


		
		// Select the first row
		rowId = lstBulletins.IndexToRowId(0);
		lstBulletins.SetRow(rowId, True);
	}
	else
	{
		// No bulletins, so just print a "No Bulletins Today!" message
		winBulletin.SetText(NoBulletinsTodayText);
		winBulletin.SetTextAlignments(HALIGN_Center, VALIGN_Center);
	}
}

// ----------------------------------------------------------------------
// ButtonActivated()
// ----------------------------------------------------------------------

function bool ButtonActivated( Window buttonPressed )
{
	local bool bHandled;

	bHandled = True;

	switch( buttonPressed )
	{
		case btnLogout:
			CloseScreen("EXIT");
			break;

		case btnSpecial:
			CloseScreen("SPECIAL");
			break;

		default:
			bHandled = False;
			break;
	}

	if (bHandled)
		return True;
	else
		return Super.ButtonActivated(buttonPressed);
}


event bool ListSelectionChanged(window list, int numSelections, int focusRowId)
{
}

defaultproperties
{
    backgroundStyle=DSTY_Translucent
     NoBulletinsTodayText="No Active Goals."
     BulletinsHeaderText="Goals"
     Title="Goals"
     ClientWidth=395
     ClientHeight=412
	ComputerGoalz_1
     //clientTextures(0)=Texture'DeusExUI.UserInterface.ComputerBulletinBackground_1'
    // clientTextures(1)=Texture'DeusExUI.UserInterface.ComputerBulletinBackground_2'
     clientTextures(0)=Texture'NailageEffects.ComputerGoalz_1'
     clientTextures(1)=Texture'NailageEffects.ComputerGoalz_2'
     clientTextures(2)=Texture'DeusExUI.UserInterface.ComputerBulletinBackground_3'
     clientTextures(3)=Texture'DeusExUI.UserInterface.ComputerBulletinBackground_4'
     textureRows=2
     textureCols=2
     statusPosY=383
     defaultStatusLeftOffset=12
     ComputerNodeFunctionLabel=""
}
