class MMRPGATMScreen extends ComputerUIWindow;

#exec obj load file=..\Textures\NailageEffects.utx package=NailageEffects

var MenuUIChoiceButton btnWithdraw1;
var MenuUIChoiceButton btnWithdraw2;
var MenuUIChoiceButton btnWithdraw3;
var MenuUIChoiceButton btnWithdraw4;
var MenuUIChoiceButton btnWithdraw5;
var MenuUIChoiceButton btnWithdraw6;
var MenuUIChoiceButton btnWithdraw7;
var MenuUIChoiceButton btnWithdraw8;
var MenuUIChoiceButton btnWithdraw9;
var MenuUIChoiceButton btnWithdraw10;

var MenuUIChoiceButton btnDeposit1;
var MenuUIChoiceButton btnDeposit2;
var MenuUIChoiceButton btnDeposit3;
var MenuUIChoiceButton btnDeposit4;
var MenuUIChoiceButton btnDeposit5;
var MenuUIChoiceButton btnDeposit6;
var MenuUIChoiceButton btnDeposit7;
var MenuUIChoiceButton btnDeposit8;
var MenuUIChoiceButton btnDeposit9;

var string DepositClass1;
var string DepositClass2;
var string DepositClass3;
var string DepositClass4;
var string DepositClass5;
var string DepositClass6;
var string DepositClass7;
var string DepositClass8;
var string DepositClass9;

var MenuUISmallLabelWindow   winSpecialInfo;

var int buttonLeftMargin;
var int buttonLeftMargin2;
var int firstButtonPosY;
var int specialOffsetY;
var int statusPosYOffset;
var int TopTextureHeight;
var int MiddleTextureHeight;
var int BottomTextureHeight;

var localized String SecurityButtonLabel;
var localized String EmailButtonLabel;

var localized String ButtonLabelMoney;
var MenuUIActionButtonWindow btnMoney;

var bool bWaiting;



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


function CreateControls()
{
	Super.CreateControls();

	btnMoney = winButtonBar.AddButton(ButtonLabelMoney, HALIGN_Right);

	CreateSpecialInfoWindow();
}

// ----------------------------------------------------------------------
// CreateClientWindow()
// ----------------------------------------------------------------------

function CreateClientWindow()
{
	Super.CreateClientWindow();

	if (winClient != None)
		ComputerUIScaleClientWindow(winClient).SetTextureHeights(TopTextureHeight, MiddleTextureHeight, BottomTextureHeight);
}

// ----------------------------------------------------------------------
// CreateSpecialInfoWindow()
// ----------------------------------------------------------------------

function CreateSpecialInfoWindow()
{
	winSpecialInfo = MenuUISmallLabelWindow(winClient.NewChild(Class'MenuUISmallLabelWindow'));

	winSpecialInfo.SetPos(10, 97);
	winSpecialInfo.SetSize(800, 25);
	winSpecialInfo.SetTextAlignments(HALIGN_Left, VALIGN_Center);
	winSpecialInfo.SetTextMargins(0, 0);
}

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

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





// ----------------------------------------------------------------------
// SetCompOwner()
//
// Loop through the special options and create 'em, baby!
// ----------------------------------------------------------------------

function SetCompOwner(ElectronicDevices newCompOwner)
{
	bWaiting = False;
	Super.SetCompOwner(newCompOwner);

	CreateOptionButtons();
}

// ----------------------------------------------------------------------
// CreateOptionButtons()
// ----------------------------------------------------------------------

function CreateOptionButtons()
{
	local int specialIndex;
	local int numOptions;
	local MenuUIChoiceButton winButton;

	local inventory inv;
	local int i;

	local string astr1;
	local string astr2;
	local string astr3;
	local string astr4;
	local string astr5;
	local string astr6;
	local string astr7;
	local string astr8;
	local string astr9;
	local string astr10;

	local Class<Inventory> aclass1;
	local Class<Inventory> aclass2;
	local Class<Inventory> aclass3;
	local Class<Inventory> aclass4;
	local Class<Inventory> aclass5;
	local Class<Inventory> aclass6;
	local Class<Inventory> aclass7;
	local Class<Inventory> aclass8;
	local Class<Inventory> aclass9;
	local Class<Inventory> aclass10;

	numOptions = 0;
	specialIndex = 1;

LAG:

				// Create the button
				winButton = MenuUIChoiceButton(winClient.NewChild(Class'MenuUIChoiceButton'));
				winButton.SetPos(buttonLeftMargin2, firstButtonPosY + (numOptions * MiddleTextureHeight));
				winButton.SetSensitivity(True);
				winButton.SetWidth(430);

				if(specialIndex == 1)
				{
					if(_MMRPGPlayer(Player).bTempItem1 != None)
					{
						if(_MMRPGPlayer(Player).bTempItem1.IsA('FoodMMRPG'))
						{
							winButton.SetButtonText("Deposit " $_MMRPGPlayer(Player).bTempItem1.ItemName$ "[" $FoodMMRPG(_MMRPGPlayer(Player).bTempItem1).NumCopies$ "]");
							winButton.SetSensitivity(True);		
						}
						if(_MMRPGPlayer(Player).bTempItem1.IsA('WeaponGasGrenade'))
						{
							winButton.SetButtonText("Deposit " $_MMRPGPlayer(Player).bTempItem1.ItemName$ "[" $WeaponGasGrenade(_MMRPGPlayer(Player).bTempItem1).AmmoType.AmmoAmount$ "]");
							winButton.SetSensitivity(True);		
						}
						if( (!_MMRPGPlayer(Player).bTempItem1.IsA('WeaponGasGrenade')) && (!_MMRPGPlayer(Player).bTempItem1.IsA('FoodMMRPG')) && (!_MMRPGPlayer(Player).bTempItem1.IsA('MedkitMMRPG')))
						{
							winButton.SetButtonText("Deposit " $_MMRPGPlayer(Player).bTempItem1.ItemName);
							winButton.SetSensitivity(True);
						}
					}
					else
					{
						winButton.SetButtonText("-EMPTY-");
						winButton.SetSensitivity(False);
					}
					btnDeposit1 = winButton;
				}
				if(specialIndex == 2)
				{
					if(_MMRPGPlayer(Player).bTempItem2 != None)
					{
						if(_MMRPGPlayer(Player).bTempItem2.IsA('FoodMMRPG'))
						{
							winButton.SetButtonText("Deposit " $_MMRPGPlayer(Player).bTempItem2.ItemName$ "[" $FoodMMRPG(_MMRPGPlayer(Player).bTempItem2).NumCopies$ "]");
							winButton.SetSensitivity(True);		
						}
						if(_MMRPGPlayer(Player).bTempItem2.IsA('WeaponGasGrenade'))
						{
							winButton.SetButtonText("Deposit " $_MMRPGPlayer(Player).bTempItem2.ItemName$ "[" $WeaponGasGrenade(_MMRPGPlayer(Player).bTempItem2).AmmoType.AmmoAmount$ "]");
							winButton.SetSensitivity(True);		
						}
						if( (!_MMRPGPlayer(Player).bTempItem2.IsA('WeaponGasGrenade')) && (!_MMRPGPlayer(Player).bTempItem2.IsA('FoodMMRPG')) && (!_MMRPGPlayer(Player).bTempItem2.IsA('MedkitMMRPG')))
						{
							winButton.SetButtonText("Deposit " $_MMRPGPlayer(Player).bTempItem2.ItemName);
							winButton.SetSensitivity(True);
						}
					}
					else
					{
						winButton.SetButtonText("-EMPTY-");
						winButton.SetSensitivity(False);
					}
					btnDeposit2 = winButton;
				}
				if(specialIndex == 3)
				{
					if(_MMRPGPlayer(Player).bTempItem3 != None)
					{
						if(_MMRPGPlayer(Player).bTempItem3.IsA('FoodMMRPG'))
						{
							winButton.SetButtonText("Deposit " $_MMRPGPlayer(Player).bTempItem3.ItemName$ "[" $FoodMMRPG(_MMRPGPlayer(Player).bTempItem3).NumCopies$ "]");
							winButton.SetSensitivity(True);		
						}
						if(_MMRPGPlayer(Player).bTempItem3.IsA('WeaponGasGrenade'))
						{
							winButton.SetButtonText("Deposit " $_MMRPGPlayer(Player).bTempItem3.ItemName$ "[" $WeaponGasGrenade(_MMRPGPlayer(Player).bTempItem3).AmmoType.AmmoAmount$ "]");
							winButton.SetSensitivity(True);		
						}
						if( (!_MMRPGPlayer(Player).bTempItem3.IsA('WeaponGasGrenade')) && (!_MMRPGPlayer(Player).bTempItem3.IsA('FoodMMRPG')) && (!_MMRPGPlayer(Player).bTempItem3.IsA('MedkitMMRPG')))
						{
							winButton.SetButtonText("Deposit " $_MMRPGPlayer(Player).bTempItem3.ItemName);
							winButton.SetSensitivity(True);
						}
					}
					else
					{
						winButton.SetButtonText("-EMPTY-");
						winButton.SetSensitivity(False);
					}
					btnDeposit3 = winButton;
				}
				if(specialIndex == 4)
				{
					if(_MMRPGPlayer(Player).bTempItem4 != None)
					{
						if(_MMRPGPlayer(Player).bTempItem4.IsA('FoodMMRPG'))
						{
							winButton.SetButtonText("Deposit " $_MMRPGPlayer(Player).bTempItem4.ItemName$ "[" $FoodMMRPG(_MMRPGPlayer(Player).bTempItem4).NumCopies$ "]");
							winButton.SetSensitivity(True);		
						}
						if(_MMRPGPlayer(Player).bTempItem4.IsA('WeaponGasGrenade'))
						{
							winButton.SetButtonText("Deposit " $_MMRPGPlayer(Player).bTempItem4.ItemName$ "[" $WeaponGasGrenade(_MMRPGPlayer(Player).bTempItem4).AmmoType.AmmoAmount$ "]");
							winButton.SetSensitivity(True);		
						}
						if( (!_MMRPGPlayer(Player).bTempItem4.IsA('WeaponGasGrenade')) && (!_MMRPGPlayer(Player).bTempItem4.IsA('FoodMMRPG'))&& (!_MMRPGPlayer(Player).bTempItem4.IsA('MedkitMMRPG')) )
						{
							winButton.SetButtonText("Deposit " $_MMRPGPlayer(Player).bTempItem4.ItemName);
							winButton.SetSensitivity(True);
						}
					}
					else
					{
						winButton.SetButtonText("-EMPTY-");
						winButton.SetSensitivity(False);
					}
					btnDeposit4 = winButton;
				}
				if(specialIndex == 5)
				{
					if(_MMRPGPlayer(Player).bTempItem5 != None)
					{
						if(_MMRPGPlayer(Player).bTempItem5.IsA('FoodMMRPG'))
						{
							winButton.SetButtonText("Deposit " $_MMRPGPlayer(Player).bTempItem5.ItemName$ "[" $FoodMMRPG(_MMRPGPlayer(Player).bTempItem5).NumCopies$ "]");
							winButton.SetSensitivity(True);		
						}
						if(_MMRPGPlayer(Player).bTempItem5.IsA('WeaponGasGrenade'))
						{
							winButton.SetButtonText("Deposit " $_MMRPGPlayer(Player).bTempItem5.ItemName$ "[" $WeaponGasGrenade(_MMRPGPlayer(Player).bTempItem5).AmmoType.AmmoAmount$ "]");
							winButton.SetSensitivity(True);		
						}
						if( (!_MMRPGPlayer(Player).bTempItem5.IsA('WeaponGasGrenade')) && (!_MMRPGPlayer(Player).bTempItem5.IsA('FoodMMRPG'))&& (!_MMRPGPlayer(Player).bTempItem5.IsA('MedkitMMRPG')) )
						{
							winButton.SetButtonText("Deposit " $_MMRPGPlayer(Player).bTempItem5.ItemName);
							winButton.SetSensitivity(True);
						}
					}
					else
					{
						winButton.SetButtonText("-EMPTY-");
						winButton.SetSensitivity(False);
					}
					btnDeposit5 = winButton;
				}
				if(specialIndex == 6)
				{
					if(_MMRPGPlayer(Player).bTempItem6 != None)
					{
						if(_MMRPGPlayer(Player).bTempItem6.IsA('FoodMMRPG'))
						{
							winButton.SetButtonText("Deposit " $_MMRPGPlayer(Player).bTempItem6.ItemName$ "[" $FoodMMRPG(_MMRPGPlayer(Player).bTempItem6).NumCopies$ "]");
							winButton.SetSensitivity(True);		
						}
						if(_MMRPGPlayer(Player).bTempItem6.IsA('WeaponGasGrenade'))
						{
							winButton.SetButtonText("Deposit " $_MMRPGPlayer(Player).bTempItem6.ItemName$ "[" $WeaponGasGrenade(_MMRPGPlayer(Player).bTempItem6).AmmoType.AmmoAmount$ "]");
							winButton.SetSensitivity(True);		
						}
						if( (!_MMRPGPlayer(Player).bTempItem6.IsA('WeaponGasGrenade')) && (!_MMRPGPlayer(Player).bTempItem6.IsA('FoodMMRPG'))&& (!_MMRPGPlayer(Player).bTempItem6.IsA('MedkitMMRPG')) )
						{
							winButton.SetButtonText("Deposit " $_MMRPGPlayer(Player).bTempItem6.ItemName);
							winButton.SetSensitivity(True);
						}
					}
					else
					{
						winButton.SetButtonText("-EMPTY-");
						winButton.SetSensitivity(False);
					}
					btnDeposit6 = winButton;
				}
				if(specialIndex == 7)
				{
					if(_MMRPGPlayer(Player).bTempItem7 != None)
					{
						if(_MMRPGPlayer(Player).bTempItem7.IsA('FoodMMRPG'))
						{
							winButton.SetButtonText("Deposit " $_MMRPGPlayer(Player).bTempItem7.ItemName$ "[" $FoodMMRPG(_MMRPGPlayer(Player).bTempItem7).NumCopies$ "]");
							winButton.SetSensitivity(True);		
						}
						if(_MMRPGPlayer(Player).bTempItem7.IsA('WeaponGasGrenade'))
						{
							winButton.SetButtonText("Deposit " $_MMRPGPlayer(Player).bTempItem7.ItemName$ "[" $WeaponGasGrenade(_MMRPGPlayer(Player).bTempItem7).AmmoType.AmmoAmount$ "]");
							winButton.SetSensitivity(True);		
						}
						if( (!_MMRPGPlayer(Player).bTempItem7.IsA('WeaponGasGrenade')) && (!_MMRPGPlayer(Player).bTempItem7.IsA('FoodMMRPG'))&& (!_MMRPGPlayer(Player).bTempItem7.IsA('MedkitMMRPG')) )
						{
							winButton.SetButtonText("Deposit " $_MMRPGPlayer(Player).bTempItem7.ItemName);
							winButton.SetSensitivity(True);
						}
					}
					else
					{
						winButton.SetButtonText("-EMPTY-");
						winButton.SetSensitivity(False);
					}
					btnDeposit7 = winButton;
				}

				if(specialIndex == 8)
				{
					if(_MMRPGPlayer(Player).bTempItem8 != None)
					{
						if(_MMRPGPlayer(Player).bTempItem8.IsA('FoodMMRPG'))
						{
							winButton.SetButtonText("Deposit " $_MMRPGPlayer(Player).bTempItem8.ItemName$ "[" $FoodMMRPG(_MMRPGPlayer(Player).bTempItem8).NumCopies$ "]");
							winButton.SetSensitivity(True);		
						}
						if(_MMRPGPlayer(Player).bTempItem8.IsA('WeaponGasGrenade'))
						{
							winButton.SetButtonText("Deposit " $_MMRPGPlayer(Player).bTempItem8.ItemName$ "[" $WeaponGasGrenade(_MMRPGPlayer(Player).bTempItem8).AmmoType.AmmoAmount$ "]");
							winButton.SetSensitivity(True);		
						}
						if( (!_MMRPGPlayer(Player).bTempItem8.IsA('WeaponGasGrenade')) && (!_MMRPGPlayer(Player).bTempItem8.IsA('FoodMMRPG')) && (!_MMRPGPlayer(Player).bTempItem8.IsA('MedkitMMRPG')))
						{
							winButton.SetButtonText("Deposit " $_MMRPGPlayer(Player).bTempItem8.ItemName);
							winButton.SetSensitivity(True);
						}
					}
					else
					{
						winButton.SetButtonText("-EMPTY-");
						winButton.SetSensitivity(False);
					}
					btnDeposit8 = winButton;
				}

				if(specialIndex == 9)
				{
					if(_MMRPGPlayer(Player).bTempItem9 != None)
					{
						if(_MMRPGPlayer(Player).bTempItem9.IsA('FoodMMRPG'))
						{
							winButton.SetButtonText("Deposit " $_MMRPGPlayer(Player).bTempItem9.ItemName$ "[" $FoodMMRPG(_MMRPGPlayer(Player).bTempItem9).NumCopies$ "]");
							winButton.SetSensitivity(True);		
						}
						if(_MMRPGPlayer(Player).bTempItem9.IsA('WeaponGasGrenade'))
						{
							winButton.SetButtonText("Deposit " $_MMRPGPlayer(Player).bTempItem9.ItemName$ "[" $WeaponGasGrenade(_MMRPGPlayer(Player).bTempItem9).AmmoType.AmmoAmount$ "]");
							winButton.SetSensitivity(True);		
						}
						if( (!_MMRPGPlayer(Player).bTempItem9.IsA('WeaponGasGrenade')) && (!_MMRPGPlayer(Player).bTempItem9.IsA('FoodMMRPG')) && (!_MMRPGPlayer(Player).bTempItem9.IsA('MedkitMMRPG')) )
						{
							winButton.SetButtonText("Deposit " $_MMRPGPlayer(Player).bTempItem9.ItemName);
							winButton.SetSensitivity(True);
						}
					}
					else
					{
						winButton.SetButtonText("-EMPTY-");
						winButton.SetSensitivity(False);
					}
					btnDeposit9 = winButton;
				}

				numOptions++;
				specialIndex++;

	if(specialIndex < 10)
	{
		Goto LAG;
	}



	numOptions = 0;
	specialIndex=1;
	for (specialIndex=1; specialIndex<11; specialIndex++)
	{
				// Create the button
				winButton = MenuUIChoiceButton(winClient.NewChild(Class'MenuUIChoiceButton'));
				winButton.SetPos(buttonLeftMargin, firstButtonPosY + (numOptions * MiddleTextureHeight));
				winButton.SetSensitivity(True);
				winButton.SetWidth(430);

				if(specialIndex == 1)
				{
					if(_MMRPGPlayer(Player).bBankItem1 != "")
					{
						aclass1 = class<Inventory>(DynamicLoadObject(_MMRPGPlayer(Player).bBankItem1, class'Class'));
						astr1 = aclass1.Default.ItemName;
						winButton.SetButtonText("Withdraw "$astr1);
						winButton.SetSensitivity(True);
					}
					if(_MMRPGPlayer(Player).bBankItem1 == "")
					{
						winButton.SetButtonText("-EMPTY-");
						winButton.SetSensitivity(False);
					}
					btnWithdraw1 = winButton;
				}
				if(specialIndex == 2)
				{
					if(_MMRPGPlayer(Player).bBankItem2 != "")
					{
						aclass2 = class<Inventory>(DynamicLoadObject(_MMRPGPlayer(Player).bBankItem2, class'Class'));
						astr2 = aclass2.Default.ItemName;
						winButton.SetButtonText("Withdraw "$astr2);
						winButton.SetSensitivity(True);
					}
					if(_MMRPGPlayer(Player).bBankItem2 == "")
					{
						winButton.SetButtonText("-EMPTY-");
						winButton.SetSensitivity(False);
					}
					btnWithdraw2 = winButton;
				}
				if(specialIndex == 3)
				{
					if(_MMRPGPlayer(Player).bBankItem3 != "")
					{
						aclass3 = class<Inventory>(DynamicLoadObject(_MMRPGPlayer(Player).bBankItem3, class'Class'));
						astr3 = aclass3.Default.ItemName;
						winButton.SetButtonText("Withdraw "$astr3);
						winButton.SetSensitivity(True);
					}
					if(_MMRPGPlayer(Player).bBankItem3 == "")
					{
						winButton.SetButtonText("-EMPTY-");
						winButton.SetSensitivity(False);
					}
					btnWithdraw3 = winButton;
				}
				if(specialIndex == 4)
				{
					if(_MMRPGPlayer(Player).bBankItem4 != "")
					{
						aclass4 = class<Inventory>(DynamicLoadObject(_MMRPGPlayer(Player).bBankItem4, class'Class'));
						astr4 = aclass4.Default.ItemName;
						winButton.SetButtonText("Withdraw "$astr4);
						winButton.SetSensitivity(True);
					}
					if(_MMRPGPlayer(Player).bBankItem4 == "")
					{
						winButton.SetButtonText("-EMPTY-");
						winButton.SetSensitivity(False);
					}
					btnWithdraw4 = winButton;
				}
				if(specialIndex == 5)
				{
					if(_MMRPGPlayer(Player).bBankItem5 != "")
					{
						aclass5 = class<Inventory>(DynamicLoadObject(_MMRPGPlayer(Player).bBankItem5, class'Class'));
						astr5 = aclass5.Default.ItemName;
						winButton.SetButtonText("Withdraw "$astr5);
						winButton.SetSensitivity(True);
					}
					if(_MMRPGPlayer(Player).bBankItem5 == "")
					{
						winButton.SetButtonText("-EMPTY-");
						winButton.SetSensitivity(False);
					}
					btnWithdraw5 = winButton;
				}
				if(specialIndex == 6)
				{
					if(_MMRPGPlayer(Player).bBankItem6 != "")
					{
						aclass6 = class<Inventory>(DynamicLoadObject(_MMRPGPlayer(Player).bBankItem6, class'Class'));
						astr6 = aclass6.Default.ItemName;
						winButton.SetButtonText("Withdraw "$astr6);
						winButton.SetSensitivity(True);
					}
					if(_MMRPGPlayer(Player).bBankItem6 == "")
					{
						winButton.SetButtonText("-EMPTY-");
						winButton.SetSensitivity(False);
					}
					btnWithdraw6 = winButton;
				}
				if(specialIndex == 7)
				{
					if(_MMRPGPlayer(Player).bBankItem7 != "")
					{
						aclass7 = class<Inventory>(DynamicLoadObject(_MMRPGPlayer(Player).bBankItem7, class'Class'));
						astr7 = aclass7.Default.ItemName;
						winButton.SetButtonText("Withdraw "$astr7);
						winButton.SetSensitivity(True);
					}
					if(_MMRPGPlayer(Player).bBankItem7 == "")
					{
						winButton.SetButtonText("-EMPTY-");
						winButton.SetSensitivity(False);
					}
					btnWithdraw7 = winButton;
				}
				if(specialIndex == 8)
				{
					if(_MMRPGPlayer(Player).bBankItem8 != "")
					{
						aclass8 = class<Inventory>(DynamicLoadObject(_MMRPGPlayer(Player).bBankItem8, class'Class'));
						astr8 = aclass8.Default.ItemName;
						winButton.SetButtonText("Withdraw "$astr8);
						winButton.SetSensitivity(True);
					}
					if(_MMRPGPlayer(Player).bBankItem8 == "")
					{
						winButton.SetButtonText("-EMPTY-");
						winButton.SetSensitivity(False);
					}
					btnWithdraw8 = winButton;
				}
				if(specialIndex == 9)
				{
					if(_MMRPGPlayer(Player).bBankItem9 != "")
					{
						aclass9 = class<Inventory>(DynamicLoadObject(_MMRPGPlayer(Player).bBankItem9, class'Class'));
						astr9 = aclass9.Default.ItemName;
						winButton.SetButtonText("Withdraw "$astr9);
						winButton.SetSensitivity(True);
					}
					if(_MMRPGPlayer(Player).bBankItem9 == "")
					{
						winButton.SetButtonText("-EMPTY-");
						winButton.SetSensitivity(False);
					}
					btnWithdraw9 = winButton;
				}
				if(specialIndex == 10)
				{
					if(_MMRPGPlayer(Player).bBankItem10 != "")
					{
						aclass10 = class<Inventory>(DynamicLoadObject(_MMRPGPlayer(Player).bBankItem10, class'Class'));
						astr10 = aclass10.Default.ItemName;
						winButton.SetButtonText("Withdraw "$astr10);
						winButton.SetSensitivity(True);
					}
					if(_MMRPGPlayer(Player).bBankItem10 == "")
					{
						winButton.SetButtonText("-EMPTY-");
						winButton.SetSensitivity(False);
					}
					btnWithdraw10 = winButton;
				}


				numOptions++;
	}



	numOptions = 10;

	ComputerUIScaleClientWindow(winClient).SetNumMiddleTextures(numOptions);

	// Update the location of the Special Info window and the Status window
	winSpecialInfo.SetPos(10, specialOffsetY + TopTextureHeight + (MiddleTextureHeight * numOptions));
	statusPosY = statusPosYOffset + TopTextureHeight + (MiddleTextureHeight * numOptions);
	AskParentForReconfigure();
}

// ----------------------------------------------------------------------
// UpdateOptionsButtons()
// ----------------------------------------------------------------------

function UpdateOptionsButtons()
{
	winTerm.ShowFirstScreen();
}



function int getfreeslot()
{
	if(_MMRPGPlayer(Player).bBankItem1 == "")
		return 1;

	if(_MMRPGPlayer(Player).bBankItem2 == "")
		return 2;

	if(_MMRPGPlayer(Player).bBankItem3 == "")
		return 3;

	if(_MMRPGPlayer(Player).bBankItem4 == "")
		return 4;

	if(_MMRPGPlayer(Player).bBankItem5 == "")
		return 5;

	if(_MMRPGPlayer(Player).bBankItem6 == "")
		return 6;

	if(_MMRPGPlayer(Player).bBankItem7 == "")
		return 7;

	if(_MMRPGPlayer(Player).bBankItem8 == "")
		return 8;

	if(_MMRPGPlayer(Player).bBankItem9 == "")
		return 9;

	if(_MMRPGPlayer(Player).bBankItem10 == "")
		return 10;

	else return 11;
}


Function DoRefresh1()
{
	local int i;

	btnDeposit1.SetSensitivity(False);
	btnDeposit2.SetSensitivity(False);
	btnDeposit3.SetSensitivity(False);
	btnDeposit4.SetSensitivity(False);
	btnDeposit5.SetSensitivity(False);
	btnDeposit6.SetSensitivity(False);
	btnDeposit7.SetSensitivity(False);
	btnDeposit8.SetSensitivity(False);
	btnDeposit9.SetSensitivity(False);
	btnWithdraw1.SetSensitivity(False);
	btnWithdraw2.SetSensitivity(False);
	btnWithdraw3.SetSensitivity(False);
	btnWithdraw4.SetSensitivity(False);
	btnWithdraw5.SetSensitivity(False);
	btnWithdraw6.SetSensitivity(False);
	btnWithdraw7.SetSensitivity(False);
	btnWithdraw8.SetSensitivity(False);
	btnWithdraw9.SetSensitivity(False);
	btnWithdraw10.SetSensitivity(False);

	i = AddTimer(1.2, False, 0, 'DoRefresh2');
	winStatus.SetText("|p2Bank Updating... 5");
}
Function DoRefresh2()
{
	local int i;
	i = AddTimer(1.2, False, 0, 'DoRefresh3');
	_MMRPGPlayer(Player).UpdBank();
	_MMRPGPlayer(Player).UpdTemp();
	winStatus.SetText("|p2Bank Updating... 4");
}
Function DoRefresh3()
{
	local int i;
	i = AddTimer(1.2, False, 0, 'DoRefresh4');
	winStatus.SetText("|p2Bank Updating... 3");
}
Function DoRefresh4()
{
	local int i;
	i = AddTimer(1.2, False, 0, 'DoRefresh5');
	winStatus.SetText("|p2Bank Updating... 2");
}
Function DoRefresh5()
{
	local int i;
	i = AddTimer(1.2, False, 0, 'DoRefresh6');
	winStatus.SetText("|p2Bank Updating... 1");
}
Function DoRefresh6()
{
	_MMRPGPlayer(Player).DepositEnd();
	bWaiting = False;
	winStatus.SetText("Daedalus:GlobalNode:" $ Computers(compOwner).GetNodeAddress() $ "/" $ ComputerNodeFunctionLabel);
	MMRPGATMTerminal(WinTerm).ShowScreen(Class'Contender.MMRPGATMScreen');
}



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

function bool ButtonActivated( Window buttonPressed )
{
	local bool bHandled;
	local int i;
	local class<Inventory> invclass;
	local bool bSwitch;

	if(bWaiting)
	{
		return false;
	}

	if(!bWaiting)
	{
	bWaiting = True;
	bSwitch = False;

		bHandled = True;
		switch( buttonPressed )
		{
			case btnDeposit1:
				btnDeposit1.SetSensitivity(False);
				_MMRPGPlayer(Player).Deposit(getfreeslot(), String(_MMRPGPlayer(Player).bTempItem1.Class));
				break;

			case btnDeposit2:
				btnDeposit2.SetSensitivity(False);
				_MMRPGPlayer(Player).Deposit(getfreeslot(), String(_MMRPGPlayer(Player).bTempItem2.Class));
				break;

			case btnDeposit3:
				btnDeposit3.SetSensitivity(False);
				_MMRPGPlayer(Player).Deposit(getfreeslot(), String(_MMRPGPlayer(Player).bTempItem3.Class));
				break;

			case btnDeposit4:
				btnDeposit4.SetSensitivity(False);
				_MMRPGPlayer(Player).Deposit(getfreeslot(), String(_MMRPGPlayer(Player).bTempItem4.Class));
				break;

			case btnDeposit5:
				btnDeposit5.SetSensitivity(False);
				_MMRPGPlayer(Player).Deposit(getfreeslot(), String(_MMRPGPlayer(Player).bTempItem5.Class));
				break;

			case btnDeposit6:
				btnDeposit6.SetSensitivity(False);
				_MMRPGPlayer(Player).Deposit(getfreeslot(), String(_MMRPGPlayer(Player).bTempItem6.Class));
				break;

			case btnDeposit7:
				btnDeposit7.SetSensitivity(False);
				_MMRPGPlayer(Player).Deposit(getfreeslot(), String(_MMRPGPlayer(Player).bTempItem7.Class));
				break;

			case btnDeposit8:
				btnDeposit8.SetSensitivity(False);
				_MMRPGPlayer(Player).Deposit(getfreeslot(), String(_MMRPGPlayer(Player).bTempItem8.Class));
				break;

			case btnDeposit9:
				btnDeposit9.SetSensitivity(False);
				_MMRPGPlayer(Player).Deposit(getfreeslot(), String(_MMRPGPlayer(Player).bTempItem9.Class));
				break;

			case btnWithdraw1:
				btnWithdraw1.SetSensitivity(False);
				_MMRPGPlayer(Player).WithDraw(1);
				break;

			case btnWithdraw2:
				btnWithdraw2.SetSensitivity(False);
				_MMRPGPlayer(Player).WithDraw(2);
				break;

			case btnWithdraw3:
				btnWithdraw3.SetSensitivity(False);
				_MMRPGPlayer(Player).WithDraw(3);
				break;

			case btnWithdraw4:
				btnWithdraw4.SetSensitivity(False);
				_MMRPGPlayer(Player).WithDraw(4);
				break;

			case btnWithdraw5:
				btnWithdraw5.SetSensitivity(False);
				_MMRPGPlayer(Player).WithDraw(5);
				break;

			case btnWithdraw6:
				btnWithdraw6.SetSensitivity(False);
				_MMRPGPlayer(Player).WithDraw(6);
				break;

			case btnWithdraw7:
				btnWithdraw7.SetSensitivity(False);
				_MMRPGPlayer(Player).WithDraw(7);
				break;

			case btnWithdraw8:
				btnWithdraw8.SetSensitivity(False);
				_MMRPGPlayer(Player).WithDraw(8);
				break;

			case btnWithdraw9:
				btnWithdraw9.SetSensitivity(False);
				_MMRPGPlayer(Player).WithDraw(9);
				break;

			case btnWithdraw10:
				btnWithdraw10.SetSensitivity(False);
				_MMRPGPlayer(Player).WithDraw(10);
				break;

			case btnMoney:
				MMRPGATMTerminal(WinTerm).ShowScreen(Class'Contender.MMRPGATMMoney');
				MMRPGATMTerminal(WinTerm).moneytime = 1;
				bSwitch = True;
				break;
				

			default:
				bHandled = False;
				break;
		}
	}
	if(!bSwitch)
	{
		DoRefresh1();
	}
	if (bHandled)
		return True;
	else
		return False;
}


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

defaultproperties
{
    backgroundStyle=DSTY_Translucent
    clientTextures(0)=Texture'NailageEffects.ATMTop1'
    clientTextures(1)=Texture'NailageEffects.ATMTop2'
    clientTextures(2)=Texture'NailageEffects.ATMMiddle1'
    clientTextures(3)=Texture'NailageEffects.ATMMiddle2'
    clientTextures(4)=Texture'NailageEffects.ATMBottom1'
    clientTextures(5)=Texture'NailageEffects.ATMBottom2'
    buttonLeftMargin=25
    ButtonLabelMoney="|&Money"
    buttonLeftMargin2=512
    firstButtonPosY=17
    specialOffsetY=16
    statusPosYOffset=50
    TopTextureHeight=12
    MiddleTextureHeight=30
    BottomTextureHeight=75
    classClient=Class'ComputerUIScaleClientWindowM'
    escapeAction="EXIT"
    Title="MainMan's City Banking System"
    ClientWidth=950
    textureCols=2
    bAlwaysCenter=True
    ComputerNodeFunctionLabel="MainMansCityBank/Items"
}
