Files
tbd-station-14/Content.Server/MachineLinking/System/SignalButtonSystem.cs
2021-10-10 12:43:50 +02:00

26 lines
744 B
C#

using Content.Server.MachineLinking.Components;
using Content.Server.MachineLinking.Events;
using Content.Shared.Interaction;
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
namespace Content.Server.MachineLinking.System
{
[UsedImplicitly]
public class SignalButtonSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<SignalButtonComponent, InteractHandEvent>(OnInteractHand);
}
private void OnInteractHand(EntityUid uid, SignalButtonComponent component, InteractHandEvent args)
{
RaiseLocalEvent(uid, new InvokePortEvent("pressed"), false);
args.Handled = true;
}
}
}