Alerts Cleanup and API (#39544)

* alert cleanup and API

* I expect update loops to be at the top.

* Address review

* Address review x 2

* Merg my PR

* Fix

* Update Content.Shared/Alert/AlertsSystem.cs

webedit

Co-authored-by: Perry Fraser <perryprog@users.noreply.github.com>

* FIX THAT TEST FAIL!!!!

* Me when I forget to actually give you alerts

* Hammedborgar

---------

Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
Co-authored-by: Perry Fraser <perryprog@users.noreply.github.com>
This commit is contained in:
Princess Cheeseballs
2025-09-05 02:45:48 -07:00
committed by GitHub
parent 5e0e5e045a
commit d488ca96b2
18 changed files with 213 additions and 196 deletions

View File

@@ -83,7 +83,7 @@ public abstract class SharedRootableSystem : EntitySystem
var actions = new Entity<ActionsComponent?>(entity, comp);
_actions.RemoveAction(actions, entity.Comp.ActionEntity);
_alerts.ClearAlert(entity, entity.Comp.RootedAlert);
_alerts.ClearAlert(entity.Owner, entity.Comp.RootedAlert);
}
private void OnRootableToggle(Entity<RootableComponent> entity, ref ToggleActionEvent args)
@@ -109,7 +109,7 @@ public abstract class SharedRootableSystem : EntitySystem
if (entity.Comp.Rooted)
{
_alerts.ShowAlert(entity, entity.Comp.RootedAlert);
_alerts.ShowAlert(entity.Owner, entity.Comp.RootedAlert);
var curTime = _timing.CurTime;
if (curTime > entity.Comp.NextUpdate)
{
@@ -118,7 +118,7 @@ public abstract class SharedRootableSystem : EntitySystem
}
else
{
_alerts.ClearAlert(entity, entity.Comp.RootedAlert);
_alerts.ClearAlert(entity.Owner, entity.Comp.RootedAlert);
}
_audio.PlayPredicted(entity.Comp.RootSound, entity.Owner.ToCoordinates(), entity);