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

class ComputerScreenCreditz 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;

var String credlist[35];


// ----------------------------------------------------------------------
// 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<arrayCount(credlist); bulletinIndex++)
		{
			lstBulletins.AddRow(credlist[bulletinIndex]);
		}
		
		// 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="Error"
     BulletinsHeaderText="MMCity Credits"
     Title="MMCity Credits"
     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=""
     credlist(0)="MainMan's City Credits List:"
     credlist(1)="  "
     credlist(2)="Cataclyzm - Weapon models [Scoped+Silenced Pistol, USP, XCR,"
     credlist(3)="            TMP, Desert Eagle, M4 Edit, MAC-10, SCAR, FAMAS, 870"
     credlist(4)="          - Skins to aforementioned weapons"
     credlist(5)="  "
     credlist(6)="Ketchup   - Original M4 model [later edited by Cataclyzm]"
     credlist(7)="  "
     credlist(8)="Smookie   - Mapping advice, explaining more advanced techniques"
     credlist(9)="          - Textures"
     credlist(10)="  "
     credlist(11)="Nobody    - Introduction to config files and coding"
     credlist(12)="            troubleshooting"
     credlist(13)="   "
     credlist(14)="Allan     - Barrel model and skin"
     credlist(15)="   "
     credlist(16)="DXEditing - Coding troubleshooting"
     credlist(17)="Forums"
     credlist(18)="   "
     credlist(19)="Trestkon  - MainMan's City site hosting"
     credlist(20)="   "
     credlist(21)="Kale      - MainMan's City site registration system"
     credlist(22)="   "
     credlist(23)="Testers   - Cataclyzm, Clix, Jon, Jay, Smookie, Snakey, Spiderbot, Wasted"
     credlist(24)="   "
     credlist(25)="DX: IW    - Textures"
     credlist(26)="   "
     credlist(27)="~MainMan~ - All coding, textures, models, and other"
     credlist(28)="            work, not previously mentioned."
}
