replacing sound (collection) names with SoundSpecifier - part 1

This commit is contained in:
Galactic Chimp
2021-07-10 17:35:33 +02:00
parent 4500b66f28
commit ce3c59e0e6
131 changed files with 934 additions and 587 deletions

View File

@@ -14,6 +14,7 @@ using Content.Shared.Damage;
using Content.Shared.Damage.Components;
using Content.Shared.Doors;
using Content.Shared.Interaction;
using Content.Shared.Sound;
using Content.Shared.Tool;
using Robust.Shared.Audio;
using Robust.Shared.Containers;
@@ -43,6 +44,9 @@ namespace Content.Server.Doors.Components
[DataField("board")]
private string? _boardPrototype;
[DataField("tryOpenDoorSound")]
private SoundSpecifier _tryOpenDoorSound = new SoundPathSpecifier("/Audio/Effects/bang.ogg");
public override DoorState State
{
get => base.State;
@@ -235,10 +239,10 @@ namespace Content.Server.Doors.Components
{
Open();
if (user.TryGetComponent(out HandsComponent? hands) && hands.Count == 0)
if (user.TryGetComponent(out HandsComponent? hands) && hands.Count == 0
&& _tryOpenDoorSound.TryGetSound(out var tryOpenDoorSound))
{
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Effects/bang.ogg", Owner,
AudioParams.Default.WithVolume(-2));
SoundSystem.Play(Filter.Pvs(Owner), tryOpenDoorSound, Owner, AudioParams.Default.WithVolume(-2));
}
}
else