Add use-delay to signal transmitters (#7703)

This commit is contained in:
Leon Friedrich
2022-04-24 11:45:37 +12:00
committed by GitHub
parent 68e3a49219
commit 1974060172
5 changed files with 16 additions and 9 deletions

View File

@@ -11,7 +11,7 @@ namespace Content.Server.MachineLinking.System
{
base.Initialize();
SubscribeLocalEvent<SignalSwitchComponent, ComponentInit>(OnInit);
SubscribeLocalEvent<SignalSwitchComponent, InteractHandEvent>(OnInteracted);
SubscribeLocalEvent<SignalSwitchComponent, ActivateInWorldEvent>(OnActivated);
}
private void OnInit(EntityUid uid, SignalSwitchComponent component, ComponentInit args)
@@ -23,7 +23,7 @@ namespace Content.Server.MachineLinking.System
}
private void OnInteracted(EntityUid uid, SignalSwitchComponent component, InteractHandEvent args)
private void OnActivated(EntityUid uid, SignalSwitchComponent component, ActivateInWorldEvent args)
{
component.State = !component.State;
RaiseLocalEvent(uid, new InvokePortEvent(component.State ? "On" : "Off"), false);