replacing sound (collection) names with SoundSpecifier - part 1
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user