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

@@ -4,10 +4,12 @@ using Content.Shared.Audio;
using Content.Shared.Interaction;
using Content.Shared.Notification;
using Content.Shared.Notification.Managers;
using Content.Shared.Sound;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Player;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
namespace Content.Server.Plants.Components
@@ -18,6 +20,7 @@ namespace Content.Server.Plants.Components
public override string Name => "PottedPlantHide";
[ViewVariables] private SecretStashComponent _secretStash = default!;
[DataField("rustleSound")] private SoundSpecifier _rustleSound = new SoundPathSpecifier("/Audio/Effects/plant_rustle.ogg");
protected override void Initialize()
{
@@ -46,7 +49,8 @@ namespace Content.Server.Plants.Components
private void Rustle()
{
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Effects/plant_rustle.ogg", Owner, AudioHelpers.WithVariation(0.25f));
if(_rustleSound.TryGetSound(out var rustleSound))
SoundSystem.Play(Filter.Pvs(Owner), rustleSound, Owner, AudioHelpers.WithVariation(0.25f));
}
}
}