Minor changes to display of cargo order manifests (#12618)

Co-authored-by: Eoin Mcloughlin <helloworld@eoinrul.es>
This commit is contained in:
eoineoineoin
2023-01-15 01:49:00 +00:00
committed by GitHub
parent 5990393e31
commit cd10d6fb5e
8 changed files with 29 additions and 28 deletions

View File

@@ -115,7 +115,7 @@ namespace Content.Server.Cargo.Systems
}
// No order to approve?
if (!orderDatabase.Orders.TryGetValue(args.OrderNumber, out var order) ||
if (!orderDatabase.Orders.TryGetValue(args.OrderIndex, out var order) ||
order.Approved) return;
// Invalid order
@@ -163,7 +163,7 @@ namespace Content.Server.Cargo.Systems
// Log order approval
_adminLogger.Add(LogType.Action, LogImpact.Low,
$"{ToPrettyString(player):user} approved order [orderNum:{order.OrderNumber}, amount:{order.Amount}, product:{order.ProductId}, requester:{order.Requester}, reason:{order.Reason}] with balance at {bankAccount.Balance}");
$"{ToPrettyString(player):user} approved order [orderIdx:{order.OrderIndex}, amount:{order.Amount}, product:{order.ProductId}, requester:{order.Requester}, reason:{order.Reason}] with balance at {bankAccount.Balance}");
DeductFunds(bankAccount, cost);
UpdateOrders(orderDatabase);
@@ -173,7 +173,7 @@ namespace Content.Server.Cargo.Systems
{
var orderDatabase = GetOrderDatabase(component);
if (orderDatabase == null) return;
RemoveOrder(orderDatabase, args.OrderNumber);
RemoveOrder(orderDatabase, args.OrderIndex);
}
private void OnAddOrderMessage(EntityUid uid, CargoOrderConsoleComponent component, CargoConsoleAddOrderMessage args)
@@ -199,7 +199,7 @@ namespace Content.Server.Cargo.Systems
// Log order addition
_adminLogger.Add(LogType.Action, LogImpact.Low,
$"{ToPrettyString(player):user} added order [orderNum:{data.OrderNumber}, amount:{data.Amount}, product:{data.ProductId}, requester:{data.Requester}, reason:{data.Reason}]");
$"{ToPrettyString(player):user} added order [orderIdx:{data.OrderIndex}, amount:{data.Amount}, product:{data.ProductId}, requester:{data.Requester}, reason:{data.Reason}]");
}
@@ -278,7 +278,7 @@ namespace Content.Server.Cargo.Systems
public bool TryAddOrder(StationCargoOrderDatabaseComponent component, CargoOrderData data)
{
component.Orders.Add(data.OrderNumber, data);
component.Orders.Add(data.OrderIndex, data);
UpdateOrders(component);
return true;
}