ECSatize AlertsSystem (#5559)

This commit is contained in:
Acruid
2022-01-05 00:19:23 -08:00
committed by GitHub
parent 36d4de5e61
commit 5b1cd2dd96
59 changed files with 1069 additions and 1038 deletions

View File

@@ -25,6 +25,7 @@ namespace Content.Shared.Pulling
public abstract partial class SharedPullingSystem : EntitySystem
{
[Dependency] private readonly SharedPullingStateManagementSystem _pullSm = default!;
[Dependency] private readonly AlertsSystem _alertsSystem = default!;
/// <summary>
/// A mapping of pullers to the entity that they are pulling.
@@ -105,9 +106,8 @@ namespace Content.Shared.Pulling
{
if (args.Pulled.Owner != uid)
return;
if (EntityManager.TryGetComponent(component.Owner, out SharedAlertsComponent? alerts))
alerts.ShowAlert(AlertType.Pulled);
_alertsSystem.ShowAlert(component.Owner, AlertType.Pulled);
}
private void PullableHandlePullStopped(EntityUid uid, SharedPullableComponent component, PullStoppedMessage args)
@@ -115,8 +115,7 @@ namespace Content.Shared.Pulling
if (args.Pulled.Owner != uid)
return;
if (EntityManager.TryGetComponent(component.Owner, out SharedAlertsComponent? alerts))
alerts.ClearAlert(AlertType.Pulled);
_alertsSystem.ClearAlert(component.Owner, AlertType.Pulled);
}
public override void Update(float frameTime)