Cleaner BoundUserInterfaces (#17736)

This commit is contained in:
TemporalOroboros
2023-07-08 09:02:17 -07:00
committed by GitHub
parent 55b4fb1649
commit 3ac4cf85db
137 changed files with 1069 additions and 972 deletions

View File

@@ -11,9 +11,8 @@ public sealed class CargoBountyConsoleBoundUserInterface : BoundUserInterface
[ViewVariables]
private CargoBountyMenu? _menu;
public CargoBountyConsoleBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
public CargoBountyConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}
protected override void Open()

View File

@@ -38,9 +38,10 @@ namespace Content.Client.Cargo.BUI
/// <summary>
/// Currently selected product
/// </summary>
[ViewVariables]
private CargoProductPrototype? _product;
public CargoOrderConsoleBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
public CargoOrderConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}
@@ -48,17 +49,15 @@ namespace Content.Client.Cargo.BUI
{
base.Open();
var entityManager = IoCManager.Resolve<IEntityManager>();
var sysManager = entityManager.EntitySysManager;
var spriteSystem = sysManager.GetEntitySystem<SpriteSystem>();
var spriteSystem = EntMan.System<SpriteSystem>();
_menu = new CargoConsoleMenu(IoCManager.Resolve<IPrototypeManager>(), spriteSystem);
var localPlayer = IoCManager.Resolve<IPlayerManager>()?.LocalPlayer?.ControlledEntity;
var description = new FormattedMessage();
string orderRequester;
if (entityManager.TryGetComponent<MetaDataComponent>(localPlayer, out var metadata))
orderRequester = Identity.Name(localPlayer.Value, entityManager);
if (EntMan.TryGetComponent<MetaDataComponent>(localPlayer, out var metadata))
orderRequester = Identity.Name(localPlayer.Value, EntMan);
else
orderRequester = string.Empty;
@@ -138,7 +137,7 @@ namespace Content.Client.Cargo.BUI
private bool AddOrder()
{
int orderAmt = _orderMenu?.Amount.Value ?? 0;
var orderAmt = _orderMenu?.Amount.Value ?? 0;
if (orderAmt < 1 || orderAmt > OrderCapacity)
{
return false;

View File

@@ -7,9 +7,12 @@ namespace Content.Client.Cargo.BUI;
public sealed class CargoPalletConsoleBoundUserInterface : BoundUserInterface
{
[ViewVariables]
private CargoPalletMenu? _menu;
public CargoPalletConsoleBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey) {}
public CargoPalletConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}
protected override void Open()
{

View File

@@ -9,9 +9,12 @@ namespace Content.Client.Cargo.BUI;
[UsedImplicitly]
public sealed class CargoShuttleConsoleBoundUserInterface : BoundUserInterface
{
[ViewVariables]
private CargoShuttleMenu? _menu;
public CargoShuttleConsoleBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey) {}
public CargoShuttleConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}
protected override void Open()
{