Machine Linking Overhaul (#7160)
This commit is contained in:
@@ -12,13 +12,20 @@ namespace Content.Server.MachineLinking.System
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<SignalButtonComponent, ComponentInit>(OnInit);
|
||||
SubscribeLocalEvent<SignalButtonComponent, InteractHandEvent>(OnInteractHand);
|
||||
}
|
||||
|
||||
private void OnInit(EntityUid uid, SignalButtonComponent component, ComponentInit args)
|
||||
{
|
||||
var transmitter = EnsureComp<SignalTransmitterComponent>(uid);
|
||||
if (!transmitter.Outputs.ContainsKey("Pressed"))
|
||||
transmitter.AddPort("Pressed");
|
||||
}
|
||||
|
||||
private void OnInteractHand(EntityUid uid, SignalButtonComponent component, InteractHandEvent args)
|
||||
{
|
||||
RaiseLocalEvent(uid, new InvokePortEvent("pressed"), false);
|
||||
RaiseLocalEvent(uid, new InvokePortEvent("Pressed"), false);
|
||||
args.Handled = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user