air alarm signal ports and other stuff (#18642)

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas
2023-08-21 22:18:30 +01:00
committed by GitHub
parent 2cbe8609a3
commit e837f2fd85
12 changed files with 181 additions and 59 deletions

View File

@@ -30,15 +30,11 @@ public sealed class SignalSwitchSystem : EntitySystem
comp.State = !comp.State;
_deviceLink.InvokePort(uid, comp.State ? comp.OnPort : comp.OffPort);
var data = new NetworkPayload
{
[DeviceNetworkConstants.LogicState] = comp.State ? SignalState.High : SignalState.Low
};
// only send status if it's a toggle switch and not a button
if (comp.OnPort != comp.OffPort)
{
_deviceLink.InvokePort(uid, comp.StatusPort, data);
_deviceLink.SendSignal(uid, comp.StatusPort, comp.State);
}
_audio.PlayPvs(comp.ClickSound, uid, AudioParams.Default.WithVariation(0.125f).WithVolume(8f));