void UpdateLabels() { inventoryAmount.Text = playerEntity.GetGoldAmount().ToString(); accountAmount.Text = DaggerfallBankManager.GetAccountTotal(regionIndex).ToString(); loanAmountDue.Text = DaggerfallBankManager.GetLoanedTotal(regionIndex).ToString(); loanDueBy.Text = DaggerfallBankManager.GetLoanDueDateString(regionIndex); }
void UpdateLabels() { inventoryAmount.Text = playerEntity.GetGoldAmount().ToString(); if (playerEntity.WagonItems.Contains(ItemGroups.Currency, (int)Currency.Gold_pieces)) { int wagonGold = playerEntity.WagonItems.GetItem(ItemGroups.Currency, (int)Currency.Gold_pieces).stackCount; inventoryAmount.Text += " (+" + wagonGold + ")"; } accountAmount.Text = DaggerfallBankManager.GetAccountTotal(regionIndex).ToString(); loanAmountDue.Text = DaggerfallBankManager.GetLoanedTotal(regionIndex).ToString(); loanDueBy.Text = DaggerfallBankManager.GetLoanDueDateString(regionIndex); }
public static DaggerfallMessageBox CreateBankingStatusBox(IUserInterfaceWindow previous = null) { const string textDatabase = "DaggerfallUI"; DaggerfallMessageBox bankingBox = new DaggerfallMessageBox(DaggerfallUI.Instance.UserInterfaceManager, previous); bankingBox.SetHighlightColor(DaggerfallUI.DaggerfallUnityStatDrainedTextColor); List <TextFile.Token> messages = new List <TextFile.Token>(); bool found = false; messages.AddRange(GetLoansLine( TextManager.Instance.GetText(textDatabase, "region"), TextManager.Instance.GetText(textDatabase, "account"), TextManager.Instance.GetText(textDatabase, "loan"), TextManager.Instance.GetText(textDatabase, "dueDate"))); messages.Add(TextFile.NewLineToken); for (int regionIndex = 0; regionIndex < DaggerfallBankManager.BankAccounts.Length; regionIndex++) { if (DaggerfallBankManager.GetAccountTotal(regionIndex) > 0 || DaggerfallBankManager.HasLoan(regionIndex)) { TextFile.Formatting formatting = DaggerfallBankManager.HasDefaulted(regionIndex) ? TextFile.Formatting.TextHighlight : TextFile.Formatting.Text; messages.AddRange(GetLoansLine(ShortenName(MapsFile.RegionNames[regionIndex], 12), DaggerfallBankManager.GetAccountTotal(regionIndex).ToString(), DaggerfallBankManager.GetLoanedTotal(regionIndex).ToString(), DaggerfallBankManager.GetLoanDueDateString(regionIndex), formatting)); found = true; } } if (!found) { TextFile.Token noneToken = TextFile.CreateTextToken(TextManager.Instance.GetText(textDatabase, "noAccount")); messages.Add(noneToken); messages.Add(TextFile.NewLineToken); } bankingBox.SetTextTokens(messages.ToArray()); bankingBox.ClickAnywhereToClose = true; return(bankingBox); }