Add disposal signalers (#37535)
* Add disposal signalers * Sprite changes * Some requested changes * Requested changes + change spelling to be with two l's to be consistent with the remote signaller
This commit is contained in:
committed by
GitHub
parent
5a93099509
commit
e72e25aba1
25
Content.Server/Disposal/Tube/DisposalSignallerSystem.cs
Normal file
25
Content.Server/Disposal/Tube/DisposalSignallerSystem.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using Content.Server.DeviceLinking.Systems;
|
||||
|
||||
namespace Content.Server.Disposal.Tube;
|
||||
|
||||
public sealed class DisposalSignallerSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly DeviceLinkSystem _link = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<DisposalSignallerComponent, ComponentInit>(OnInit);
|
||||
SubscribeLocalEvent<DisposalSignallerComponent, GetDisposalsNextDirectionEvent>(OnGetNextDirection, after: new[] { typeof(DisposalTubeSystem) });
|
||||
}
|
||||
|
||||
private void OnInit(EntityUid uid, DisposalSignallerComponent comp, ComponentInit args)
|
||||
{
|
||||
_link.EnsureSourcePorts(uid, comp.Port);
|
||||
}
|
||||
|
||||
private void OnGetNextDirection(EntityUid uid, DisposalSignallerComponent comp, ref GetDisposalsNextDirectionEvent args)
|
||||
{
|
||||
_link.InvokePort(uid, comp.Port);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user