Replace IClickAlert with events (#30728)

* Replace IAlertClick with events

* whoop

* eek!
This commit is contained in:
Nemanja
2024-08-07 01:15:35 -04:00
committed by GitHub
parent 2dabf33d46
commit ce97225c2d
33 changed files with 177 additions and 270 deletions

View File

@@ -71,6 +71,7 @@ public sealed partial class ShuttleConsoleSystem : SharedShuttleConsoleSystem
SubscribeLocalEvent<UndockEvent>(OnUndock);
SubscribeLocalEvent<PilotComponent, ComponentGetState>(OnGetState);
SubscribeLocalEvent<PilotComponent, StopPilotingAlertEvent>(OnStopPilotingAlert);
SubscribeLocalEvent<FTLDestinationComponent, ComponentStartup>(OnFtlDestStartup);
SubscribeLocalEvent<FTLDestinationComponent, ComponentShutdown>(OnFtlDestShutdown);
@@ -196,6 +197,14 @@ public sealed partial class ShuttleConsoleSystem : SharedShuttleConsoleSystem
args.State = new PilotComponentState(GetNetEntity(component.Console));
}
private void OnStopPilotingAlert(Entity<PilotComponent> ent, ref StopPilotingAlertEvent args)
{
if (ent.Comp.Console != null)
{
RemovePilot(ent, ent);
}
}
/// <summary>
/// Returns the position and angle of all dockingcomponents.
/// </summary>