Add SignalSwitch sound (#9013)

This commit is contained in:
Morber
2022-06-22 03:51:42 +03:00
committed by GitHub
parent 78c9203975
commit d958ababb9
4 changed files with 12 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
using Content.Shared.MachineLinking; using Content.Shared.MachineLinking;
using Content.Shared.Sound;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.MachineLinking.Components namespace Content.Server.MachineLinking.Components
@@ -24,5 +25,8 @@ namespace Content.Server.MachineLinking.Components
[DataField("state")] [DataField("state")]
public bool State; public bool State;
[DataField("clickSound")]
public SoundSpecifier ClickSound { get; set; } = new SoundPathSpecifier("/Audio/Machines/lightswitch.ogg");
} }
} }

View File

@@ -1,5 +1,8 @@
using Content.Server.MachineLinking.Components; using Content.Server.MachineLinking.Components;
using Content.Shared.Audio;
using Content.Shared.Interaction; using Content.Shared.Interaction;
using Robust.Shared.Audio;
using Robust.Shared.Player;
namespace Content.Server.MachineLinking.System namespace Content.Server.MachineLinking.System
{ {
@@ -27,6 +30,8 @@ namespace Content.Server.MachineLinking.System
component.State = !component.State; component.State = !component.State;
_signalSystem.InvokePort(uid, component.State ? component.OnPort : component.OffPort); _signalSystem.InvokePort(uid, component.State ? component.OnPort : component.OffPort);
SoundSystem.Play(component.ClickSound.GetSound(), Filter.Pvs(component.Owner), component.Owner,
AudioHelpers.WithVariation(0.125f).WithVolume(8f));
args.Handled = true; args.Handled = true;
} }

View File

@@ -9,3 +9,5 @@ uniformprinter.ogg taken from https://freesound.org/people/sukaton/sounds/60640/
vaccinator_running.ogg taken from https://freesound.org/people/RutgerMuller/sounds/365413/ and edited vaccinator_running.ogg taken from https://freesound.org/people/RutgerMuller/sounds/365413/ and edited
vending_jingle.ogg made by github.com/hubismal licensed under CC-BY-3.0 vending_jingle.ogg made by github.com/hubismal licensed under CC-BY-3.0
lightswitch.ogg taken from https://github.com/Skyrat-SS13/Skyrat-tg/blob/3f6099bbc3c2afdc609bf1991c2f06297a0f13c2/modular_skyrat/modules/aesthetics/lightswitch/sound/lightswitch.ogg under CC-BY-SA 3.0

Binary file not shown.