2022-05-12 20:46:20 +12:00
|
|
|
using Content.Shared.MachineLinking;
|
2022-07-29 14:13:12 +12:00
|
|
|
using Robust.Shared.Audio;
|
2022-05-12 20:46:20 +12:00
|
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
2020-08-29 03:33:42 -07:00
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Server.MachineLinking.Components
|
2020-08-29 03:33:42 -07:00
|
|
|
{
|
2022-05-12 20:46:20 +12:00
|
|
|
/// <summary>
|
|
|
|
|
/// Simple switch that will fire ports when toggled on or off. A button is jsut a switch that signals on the
|
|
|
|
|
/// same port regardless of its state.
|
|
|
|
|
/// </summary>
|
2020-08-29 03:33:42 -07:00
|
|
|
[RegisterComponent]
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class SignalSwitchComponent : Component
|
2020-08-29 03:33:42 -07:00
|
|
|
{
|
2022-05-12 20:46:20 +12:00
|
|
|
/// <summary>
|
|
|
|
|
/// The port that gets signaled when the switch turns on.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField("onPort", customTypeSerializer: typeof(PrototypeIdSerializer<TransmitterPortPrototype>))]
|
|
|
|
|
public string OnPort = "On";
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The port that gets signaled when the switch turns off.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField("offPort", customTypeSerializer: typeof(PrototypeIdSerializer<TransmitterPortPrototype>))]
|
|
|
|
|
public string OffPort = "Off";
|
|
|
|
|
|
|
|
|
|
[DataField("state")]
|
2021-08-27 17:46:02 +02:00
|
|
|
public bool State;
|
2022-06-22 03:51:42 +03:00
|
|
|
|
|
|
|
|
[DataField("clickSound")]
|
|
|
|
|
public SoundSpecifier ClickSound { get; set; } = new SoundPathSpecifier("/Audio/Machines/lightswitch.ogg");
|
2020-08-29 03:33:42 -07:00
|
|
|
}
|
|
|
|
|
}
|