Cargo Console Limit (#1095)
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
This commit is contained in:
@@ -27,6 +27,8 @@ namespace Content.Client.GameObjects.Components.Cargo
|
||||
public string BankName { get; private set; }
|
||||
[ViewVariables]
|
||||
public int BankBalance { get; private set; }
|
||||
[ViewVariables]
|
||||
public (int CurrentCapacity, int MaxCapacity) ShuttleCapacity { get; private set; }
|
||||
|
||||
private CargoProductPrototype _product;
|
||||
|
||||
@@ -95,6 +97,8 @@ namespace Content.Client.GameObjects.Components.Cargo
|
||||
BankId = cstate.BankId;
|
||||
BankName = cstate.BankName;
|
||||
BankBalance = cstate.BankBalance;
|
||||
ShuttleCapacity = cstate.ShuttleCapacity;
|
||||
_menu.UpdateCargoCapacity();
|
||||
_menu.UpdateBankData();
|
||||
}
|
||||
|
||||
@@ -126,7 +130,10 @@ namespace Content.Client.GameObjects.Components.Cargo
|
||||
{
|
||||
if (!(args.Button.Parent.Parent is CargoOrderRow row))
|
||||
return;
|
||||
if (ShuttleCapacity.CurrentCapacity == ShuttleCapacity.MaxCapacity)
|
||||
return;
|
||||
SendMessage(new SharedCargoConsoleComponent.CargoConsoleApproveOrderMessage(row.Order.OrderNumber));
|
||||
_menu?.UpdateCargoCapacity();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ namespace Content.Client.UserInterface.Cargo
|
||||
private Label _accountNameLabel { get; set; }
|
||||
private Label _pointsLabel { get; set; }
|
||||
private Label _shuttleStatusLabel { get; set; }
|
||||
private Label _shuttleCapacityLabel { get; set; }
|
||||
private VBoxContainer _requests { get; set; }
|
||||
private VBoxContainer _orders { get; set; }
|
||||
private OptionButton _categories { get; set; }
|
||||
@@ -95,6 +96,20 @@ namespace Content.Client.UserInterface.Cargo
|
||||
shuttleStatus.AddChild(_shuttleStatusLabel);
|
||||
rows.AddChild(shuttleStatus);
|
||||
|
||||
var shuttleCapacity = new HBoxContainer();
|
||||
var shuttleCapacityLabel = new Label
|
||||
{
|
||||
Text = _loc.GetString("Order Capacity: "),
|
||||
StyleClasses = { StyleNano.StyleClassLabelKeyText }
|
||||
};
|
||||
_shuttleCapacityLabel = new Label
|
||||
{
|
||||
Text = "0/20"
|
||||
};
|
||||
shuttleCapacity.AddChild(shuttleCapacityLabel);
|
||||
shuttleCapacity.AddChild(_shuttleCapacityLabel);
|
||||
rows.AddChild(shuttleCapacity);
|
||||
|
||||
var buttons = new HBoxContainer();
|
||||
CallShuttleButton = new Button()
|
||||
{
|
||||
@@ -272,8 +287,7 @@ namespace Content.Client.UserInterface.Cargo
|
||||
public void PopulateOrders()
|
||||
{
|
||||
_orders.RemoveAllChildren();
|
||||
_requests.RemoveAllChildren();
|
||||
|
||||
_requests.RemoveAllChildren();
|
||||
foreach (var order in Owner.Orders.Orders)
|
||||
{
|
||||
var row = new CargoOrderRow();
|
||||
@@ -306,6 +320,11 @@ namespace Content.Client.UserInterface.Cargo
|
||||
PopulateOrders();
|
||||
}
|
||||
|
||||
public void UpdateCargoCapacity()
|
||||
{
|
||||
_shuttleCapacityLabel.Text = $"{Owner.ShuttleCapacity.CurrentCapacity}/{Owner.ShuttleCapacity.MaxCapacity}";
|
||||
}
|
||||
|
||||
public void UpdateBankData()
|
||||
{
|
||||
_accountNameLabel.Text = Owner.BankName;
|
||||
|
||||
Reference in New Issue
Block a user