Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Up120824 #17

Merged
merged 16 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Content.Client/Bank/UI/BankATMMenu.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* See AGPLv3.txt for details.
*/
using Content.Client.UserInterface.Controls;
using Content.Shared._NF.Bank;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
Expand All @@ -27,14 +28,14 @@ public BankATMMenu()

public void SetBalance(int amount)
{
BalanceLabel.Text = Loc.GetString("bank-atm-menu-cash-amount", ("amount", amount.ToString()));
BalanceLabel.Text = BankSystemExtensions.ToSpesoString(amount);
}

public void SetDeposit(int amount)
{
DepositButton.Disabled = amount <= 0;
if (amount >= 0) // Valid
DepositLabel.Text = Loc.GetString("bank-atm-menu-cash-amount", ("amount", amount.ToString()));
DepositLabel.Text = BankSystemExtensions.ToSpesoString(amount);
else
DepositLabel.Text = Loc.GetString("bank-atm-menu-cash-error");
}
Expand All @@ -59,6 +60,6 @@ private void OnAmountChanged(LineEdit.LineEditEventArgs args)
if (int.TryParse(args.Text, out var amount))
{
Amount = amount;
}
}
}
}
7 changes: 4 additions & 3 deletions Content.Client/Bank/UI/StationBankATMMenu.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* See AGPLv3.txt for details.
*/
using Content.Client.UserInterface.Controls;
using Content.Shared._NF.Bank;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
Expand Down Expand Up @@ -41,14 +42,14 @@ private void OnReasonSelected(OptionButton.ItemSelectedEventArgs args)
}
public void SetBalance(int amount)
{
BalanceLabel.Text = Loc.GetString("bank-atm-menu-cash-amount", ("amount", amount.ToString()));
BalanceLabel.Text = BankSystemExtensions.ToSpesoString(amount);
}

public void SetDeposit(int amount)
{
DepositButton.Disabled = amount <= 0;
if (amount >= 0) // Valid
DepositLabel.Text = Loc.GetString("bank-atm-menu-cash-amount", ("amount", amount.ToString()));
DepositLabel.Text = BankSystemExtensions.ToSpesoString(amount);
else
DepositLabel.Text = Loc.GetString("bank-atm-menu-cash-error");
}
Expand All @@ -74,7 +75,7 @@ private void OnAmountChanged(LineEdit.LineEditEventArgs args)
if (int.TryParse(args.Text, out var amount))
{
Amount = amount;
}
}
}

private void OnDescChanged(LineEdit.LineEditEventArgs args)
Expand Down
5 changes: 3 additions & 2 deletions Content.Client/Bank/UI/WithdrawBankATMMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* See AGPLv3.txt for details.
*/
using Content.Client.UserInterface.Controls;
using Content.Shared._NF.Bank;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
Expand All @@ -26,7 +27,7 @@ public WithdrawBankATMMenu()

public void SetBalance(int amount)
{
BalanceLabel.Text = Loc.GetString("bank-atm-menu-cash-amount", ("amount", amount.ToString()));
BalanceLabel.Text = BankSystemExtensions.ToSpesoString(amount);
}

public void SetEnabled(bool enabled)
Expand All @@ -44,6 +45,6 @@ private void OnAmountChanged(LineEdit.LineEditEventArgs args)
if (int.TryParse(args.Text, out var amount))
{
Amount = amount;
}
}
}
}
3 changes: 2 additions & 1 deletion Content.Client/Cargo/UI/BountyEntry.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Content.Client.Message;
using Content.Shared._NF.Bank;
using Content.Shared.Cargo;
using Content.Shared.Cargo.Prototypes;
using Content.Shared.Random;
Expand Down Expand Up @@ -40,7 +41,7 @@ public BountyEntry(CargoBountyData bounty, TimeSpan untilNextSkip)
("item", Loc.GetString(entry.Name))));
}
ManifestLabel.SetMarkup(Loc.GetString("bounty-console-manifest-label", ("item", string.Join(", ", items))));
RewardLabel.SetMarkup(Loc.GetString("bounty-console-reward-label", ("reward", bountyPrototype.Reward)));
RewardLabel.SetMarkup(Loc.GetString("bounty-console-reward-label", ("reward", BankSystemExtensions.ToSpesoString(bountyPrototype.Reward)))); // Frontier: bountyPrototype.Reward<BankSystemExtensions.ToSpesoString(bountyPrototype.Reward)
DescriptionLabel.SetMarkup(Loc.GetString("bounty-console-description-label", ("description", Loc.GetString(bountyPrototype.Description))));
IdLabel.SetMarkup(Loc.GetString("bounty-console-id-label", ("id", bounty.Id)));

Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Cargo/UI/CargoConsoleMenu.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<Label Text="{Loc 'cargo-console-menu-points-label'}"
StyleClasses="LabelKeyText" />
<Label Name="PointsLabel"
Text="$0" />
Text="-" /> <!-- Frontier: "$0"<"-" -->
</BoxContainer>
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc 'cargo-console-menu-order-capacity-label'}"
Expand Down
7 changes: 4 additions & 3 deletions Content.Client/Cargo/UI/CargoConsoleMenu.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Linq;
using Content.Client.UserInterface.Controls;
using Content.Shared._NF.Bank;
using Content.Shared.Cargo;
using Content.Shared.Cargo.Components;
using Content.Shared.Cargo.Prototypes;
Expand Down Expand Up @@ -100,7 +101,7 @@ public void PopulateProducts()
Product = prototype,
ProductName = { Text = prototype.Name },
MainButton = { ToolTip = prototype.Description },
PointCost = { Text = Loc.GetString("cargo-console-menu-points-amount", ("amount", prototype.Cost.ToString())) },
PointCost = { Text = BankSystemExtensions.ToSpesoString(prototype.Cost) }, // Frontier:
Icon = { Texture = _spriteSystem.Frame0(prototype.Icon) },
};
button.MainButton.OnPressed += args =>
Expand Down Expand Up @@ -189,10 +190,10 @@ public void UpdateCargoCapacity(int count, int capacity)
ShuttleCapacityLabel.Text = $"{count}/{capacity}";
}

public void UpdateBankData(string name, int points)
public void UpdateBankData(string name, int bankBalance)
{
AccountNameLabel.Text = name;
PointsLabel.Text = Loc.GetString("cargo-console-menu-points-amount", ("amount", points.ToString()));
PointsLabel.Text = BankSystemExtensions.ToSpesoString(bankBalance);
}
}
}
3 changes: 2 additions & 1 deletion Content.Client/Cargo/UI/CargoPalletMenu.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Content.Client.UserInterface.Controls;
using Content.Shared._NF.Bank;
using Content.Shared.Cargo;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
Expand All @@ -21,7 +22,7 @@ public CargoPalletMenu()

public void SetAppraisal(int amount)
{
AppraisalLabel.Text = Loc.GetString("cargo-console-menu-points-amount", ("amount", amount.ToString()));
AppraisalLabel.Text = BankSystemExtensions.ToSpesoString(amount);
}

public void SetCount(int count)
Expand Down
6 changes: 4 additions & 2 deletions Content.Client/Lobby/UI/Loadouts/LoadoutWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Content.Client.UserInterface.Controls;
using Content.Shared._NF.Bank;
using Content.Shared.Preferences;
using Content.Shared.Preferences.Loadouts;
using Robust.Client.AutoGenerated;
Expand Down Expand Up @@ -51,7 +52,7 @@ public LoadoutWindow(HumanoidCharacterProfile profile, RoleLoadout loadout, Role
CalculateLoadoutCost(loadout, collection);
// Frontier - update bank balance label text - value should not change.
Balance.Margin = new Thickness(5, 2, 5, 5);
Balance.Text = Loc.GetString("frontier-loadout-balance", ("balance", Profile.BankBalance));
Balance.Text = Loc.GetString("frontier-loadout-balance", ("balance", BankSystemExtensions.ToSpesoString(Profile.BankBalance)));
}

public void RefreshLoadouts(RoleLoadout loadout, ICommonSession session, IDependencyCollection collection)
Expand Down Expand Up @@ -85,6 +86,7 @@ private void CalculateLoadoutCost(RoleLoadout loadout, IDependencyCollection col
}

Cost.Margin = new Thickness(5, 2, 5, 5);
Cost.Text = Loc.GetString("frontier-loadout-cost", ("cost", cost));
Cost.Text = Loc.GetString("frontier-loadout-cost", ("cost", BankSystemExtensions.ToSpesoString(cost)));
}
// End Frontier
}
5 changes: 3 additions & 2 deletions Content.Client/PDA/PdaMenu.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Robust.Shared.Utility;
using Content.Shared.CartridgeLoader;
using Content.Client.Message;
using Content.Shared._NF.Bank;
using Robust.Client.UserInterface;
using Robust.Client.AutoGenerated;
using Robust.Client.Graphics;
Expand Down Expand Up @@ -139,7 +140,7 @@ public PdaMenu()
_clipboard.SetText(_instructions);
};




HideAllViews();
Expand Down Expand Up @@ -175,7 +176,7 @@ public void UpdateState(PdaUpdateState state)
StationNameLabel.SetMarkup(Loc.GetString("comp-pda-ui-station",
("station", _stationName)));

_balance = state.Balance.ToString(); // Frontier
_balance = BankSystemExtensions.ToSpesoString(state.Balance); // Frontier
BalanceLabel.SetMarkup(Loc.GetString("comp-pda-ui-balance", ("balance", _balance))); // Frontier

_shuttleDeed = state.OwnedShipName ?? ""; // Frontier
Expand Down
9 changes: 5 additions & 4 deletions Content.Client/Shipyard/UI/ShipyardConsoleMenu.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Linq;
using Content.Client.UserInterface.Controls;
using Content.Client.Shipyard.BUI;
using Content.Shared._NF.Bank;
using Content.Shared.Shipyard.BUI;
using Content.Shared.Shipyard.Prototypes;
using Robust.Client.AutoGenerated;
Expand Down Expand Up @@ -85,7 +86,7 @@ public void PopulateProducts(List<string> prototypes, string type, bool free)
if (_freeListings)
priceText = Loc.GetString("shipyard-console-menu-listing-free");
else
priceText = Loc.GetString("shipyard-console-menu-listing-amount", ("amount", prototype!.Price.ToString()));
priceText = BankSystemExtensions.ToSpesoString(prototype!.Price);

var vesselEntry = new VesselRow
{
Expand Down Expand Up @@ -132,12 +133,12 @@ public void PopulateCategories()

public void UpdateState(ShipyardConsoleInterfaceState state)
{
BalanceLabel.Text = Loc.GetString("shipyard-console-menu-listing-amount", ("amount", state.Balance.ToString()));
int shipPrice = 0;
BalanceLabel.Text = BankSystemExtensions.ToSpesoString(state.Balance);
var shipPrice = 0;
if (!state.FreeListings)
shipPrice = state.ShipSellValue;

ShipAppraisalLabel.Text = Loc.GetString("shipyard-console-menu-listing-amount", ("amount", shipPrice.ToString()));
ShipAppraisalLabel.Text = BankSystemExtensions.ToSpesoString(shipPrice);
SellShipButton.Disabled = state.ShipDeedTitle == null;
TargetIdButton.Text = state.IsTargetIdPresent
? Loc.GetString("id-card-console-window-eject-button")
Expand Down
3 changes: 2 additions & 1 deletion Content.Client/Store/Ui/StoreMenu.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Linq;
using Content.Client.Actions;
using Content.Client.Message;
using Content.Shared._NF.Bank;
using Content.Shared.FixedPoint;
using Content.Shared.Store;
using Robust.Client.AutoGenerated;
Expand Down Expand Up @@ -52,7 +53,7 @@ public void UpdateBalance(Dictionary<ProtoId<CurrencyPrototype>, FixedPoint2> ba
var balanceStr = string.Empty;
foreach (var ((_, amount), proto) in currency)
{
balanceStr += Loc.GetString("store-ui-balance-display", ("amount", amount),
balanceStr += Loc.GetString("store-ui-balance-display", ("amount", BankSystemExtensions.ToIndependentString((int) amount)), // Frontier: amount<BankSystemExtensions.GetIndependentString((int)amount)
("currency", Loc.GetString(proto.DisplayName, ("amount", 1))));
}

Expand Down
3 changes: 2 additions & 1 deletion Content.Client/Store/Ui/StoreWithdrawWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
using Content.Shared._NF.Bank; // Frontier
using Content.Shared.FixedPoint;
using Content.Shared.Store;
using Robust.Client.UserInterface.Controls;
Expand Down Expand Up @@ -52,7 +53,7 @@ public void CreateCurrencyButtons(Dictionary<ProtoId<CurrencyPrototype>, FixedPo
Id = currency.Value.ID,
Amount = currency.Key,
MinHeight = 20,
Text = Loc.GetString("store-withdraw-button-ui", ("currency",Loc.GetString(currency.Value.DisplayName, ("amount", currency.Key)))),
Text = Loc.GetString("store-withdraw-button-ui", ("currency",Loc.GetString(currency.Value.DisplayName, ("amount", BankSystemExtensions.ToIndependentString((int) currency.Key))))), // Frontier: currency.Key -> BankSystemExtensions.GetIndendependentString((int) currency.Key)
};
button.Disabled = false;
button.OnPressed += args =>
Expand Down
9 changes: 6 additions & 3 deletions Content.Client/VendingMachines/UI/VendingMachineMenu.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.UserInterface.Controls;
using Content.Shared._NF.Bank; // Frontier
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Prototypes;
using Content.Shared.Chemistry.Components.SolutionManager;
Expand Down Expand Up @@ -198,9 +199,9 @@ public void Populate(List<VendingMachineInventoryEntry> inventory, float priceMo
// New Frontiers - Unlimited vending - support items with unlimited vending stock.
// This code is licensed under AGPLv3. See AGPLv3.txt
if (entry.Amount != uint.MaxValue)
vendingItem.Text = $"[${cost}] {itemName} [{entry.Amount}]";
vendingItem.Text = $"[{BankSystemExtensions.ToSpesoString(cost)}] {itemName} [{entry.Amount}]";
else
vendingItem.Text = $"[${cost}] {itemName}";
vendingItem.Text = $"[{BankSystemExtensions.ToSpesoString(cost)}] {itemName}";
// End of modified code
vendingItem.Icon = icon;
filteredInventory.Add(i);
Expand All @@ -209,10 +210,12 @@ public void Populate(List<VendingMachineInventoryEntry> inventory, float priceMo
SetSizeAfterUpdate(longestEntry.Length, inventory.Count);
}

// Frontier
public void UpdateBalance(int balance)
{
BalanceLabel.Text = Loc.GetString("cargo-console-menu-points-amount", ("amount", balance.ToString()));
BalanceLabel.Text = BankSystemExtensions.ToSpesoString(balance);
}
// End Frontier

private void SetSizeAfterUpdate(int longestEntryLength, int contentCount)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Content.Shared._NF.Bank;
using Content.Shared._NF.BountyContracts;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
Expand Down Expand Up @@ -33,8 +34,7 @@ public BountyContractUiFragmentListEntry(BountyContract contract, bool canRemove
}

// bounty reward
BountyReward.Text = Loc.GetString("cargo-console-menu-points-amount",
("amount", contract.Reward.ToString()));
BountyReward.Text = BankSystemExtensions.ToSpesoString(contract.Reward);

// remove button
RemoveButton.OnPressed += _ => OnRemoveButtonPressed?.Invoke(contract);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Content.Client.UserInterface.Controls;
using Content.Shared._NF.Bank;
using Content.Shared._NF.Contraband.Components;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
Expand Down Expand Up @@ -37,7 +38,8 @@ public ContrabandPalletMenu(string locPrefix)

public void SetAppraisal(int amount)
{
AppraisalLabel.Text = Loc.GetString($"{_locPrefix}contraband-console-menu-points-amount", ("amount", amount.ToString()));
// TODO: switch currency function by currency in component
AppraisalLabel.Text = Loc.GetString($"{_locPrefix}contraband-console-menu-points-amount", ("amount", BankSystemExtensions.ToIndependentString(amount)));
}

public void SetCount(int count)
Expand Down
3 changes: 2 additions & 1 deletion Content.Client/_NF/Pirate/UI/PirateBountyEntry.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Robust.Client.AutoGenerated;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;
using Content.Shared._NF.Bank;

namespace Content.Client._NF.Pirate.UI;

Expand Down Expand Up @@ -46,7 +47,7 @@ public PirateBountyEntry(PirateBountyData bounty, TimeSpan untilNextSkip)
("item", Loc.GetString(entry.Name))));
}
ManifestLabel.SetMarkup(Loc.GetString("pirate-bounty-console-manifest-label", ("item", string.Join(", ", items))));
RewardLabel.SetMarkup(Loc.GetString("pirate-bounty-console-reward-label", ("reward", bountyPrototype.Reward)));
RewardLabel.SetMarkup(Loc.GetString("pirate-bounty-console-reward-label", ("reward", BankSystemExtensions.ToIndependentString(bountyPrototype.Reward))));
DescriptionLabel.SetMarkup(Loc.GetString("pirate-bounty-console-description-label", ("description", Loc.GetString(bountyPrototype.Description))));
IdLabel.SetMarkup(Loc.GetString("pirate-bounty-console-id-label", ("id", bounty.Id)));

Expand Down
3 changes: 2 additions & 1 deletion Content.Server/Cargo/Systems/CargoSystem.Bounty.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Content.Server.Labels;
using Content.Server.NameIdentifier;
using Content.Server.Paper;
using Content.Shared._NF.Bank;
using Content.Shared.Access.Components;
using Content.Shared.Cargo;
using Content.Shared.Cargo.Components;
Expand Down Expand Up @@ -124,7 +125,7 @@ public void SetupBountyLabel(EntityUid uid, EntityUid stationId, CargoBountyData
("item", Loc.GetString(entry.Name)))}");
msg.PushNewline();
}
msg.AddMarkup(Loc.GetString("bounty-console-manifest-reward", ("reward", prototype.Reward)));
msg.AddMarkup(Loc.GetString("bounty-console-manifest-reward", ("reward", BankSystemExtensions.ToSpesoString(prototype.Reward))));
_paperSystem.SetContent(uid, msg.ToMarkup(), paper);
}

Expand Down
Loading
Loading