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

@@ -8,6 +8,7 @@ using Content.Shared.Interaction;
using Content.Shared.Interaction.Helpers;
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;
@@ -43,7 +44,7 @@ namespace Content.Server.Fluids.Components
: ReagentUnit.Zero;
[DataField("sound")]
private string? _sound = "/Audio/Effects/Fluids/watersplash.ogg";
private SoundSpecifier _sound = new SoundPathSpecifier("/Audio/Effects/Fluids/watersplash.ogg");
/// <inheritdoc />
protected override void Initialize()
@@ -114,9 +115,9 @@ namespace Content.Server.Fluids.Components
return false;
}
if (_sound != null)
if (_sound.TryGetSound(out var sound))
{
SoundSystem.Play(Filter.Pvs(Owner), _sound, Owner);
SoundSystem.Play(Filter.Pvs(Owner), sound, Owner);
}
return true;