Cleans up warnings in disposals (#17419)

This commit is contained in:
TemporalOroboros
2023-06-21 07:31:19 -07:00
committed by GitHub
parent f14f09cc90
commit 9849737e5a
17 changed files with 396 additions and 387 deletions

View File

@@ -58,7 +58,7 @@ public sealed class MailingUnitSystem : EntitySystem
case NetCmdResponse when args.Data.TryGetValue(NetTag, out string? tag):
//Add the received tag request response to the list of targets
component.TargetList.Add(tag);
UpdateUserInterface(component);
UpdateUserInterface(uid, component);
break;
}
}
@@ -146,7 +146,7 @@ public sealed class MailingUnitSystem : EntitySystem
}
component.Tag = configuration[TagConfigurationKey];
UpdateUserInterface(component);
UpdateUserInterface(uid, component);
}
private void HandleActivate(EntityUid uid, MailingUnitComponent component, ActivateInWorldEvent args)
@@ -158,7 +158,8 @@ public sealed class MailingUnitSystem : EntitySystem
args.Handled = true;
UpdateTargetList(uid, component);
_userInterfaceSystem.GetUiOrNull(uid, MailingUnitUiKey.Key)?.Open(actor.PlayerSession);
if (_userInterfaceSystem.TryGetUi(uid, MailingUnitUiKey.Key, out var bui))
_userInterfaceSystem.OpenUi(bui, actor.PlayerSession);
}
/// <summary>
@@ -167,28 +168,23 @@ public sealed class MailingUnitSystem : EntitySystem
private void OnDisposalUnitUIStateChange(EntityUid uid, MailingUnitComponent component, DisposalUnitUIStateUpdatedEvent args)
{
component.DisposalUnitInterfaceState = args.State;
UpdateUserInterface(component);
UpdateUserInterface(uid, component);
}
private void UpdateUserInterface(MailingUnitComponent component)
private void UpdateUserInterface(EntityUid uid, MailingUnitComponent component)
{
if (component.DisposalUnitInterfaceState == null)
return;
var state = new MailingUnitBoundUserInterfaceState(component.DisposalUnitInterfaceState, component.Target, component.TargetList, component.Tag);
component.Owner.GetUIOrNull(MailingUnitUiKey.Key)?.SetState(state);
if (_userInterfaceSystem.TryGetUi(uid, MailingUnitUiKey.Key, out var bui))
_userInterfaceSystem.SetUiState(bui, state);
}
private void OnTargetSelected(EntityUid uid, MailingUnitComponent component, TargetSelectedMessage args)
{
if (string.IsNullOrEmpty(args.target))
{
component.Target = null;
}
component.Target = args.target;
UpdateUserInterface(component);
component.Target = args.Target;
UpdateUserInterface(uid, component);
}
/// <summary>