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

@@ -7,6 +7,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;
@@ -54,7 +55,7 @@ namespace Content.Server.Fluids.Components
public ReagentUnit PickupAmount { get; } = ReagentUnit.New(5);
[DataField("pickup_sound")]
private string? _pickupSound = "/Audio/Effects/Fluids/slosh.ogg";
private SoundSpecifier _pickupSound = new SoundPathSpecifier("/Audio/Effects/Fluids/slosh.ogg");
/// <summary>
/// Multiplier for the do_after delay for how fast the mop works.
@@ -163,9 +164,9 @@ namespace Content.Server.Fluids.Components
contents.SplitSolution(transferAmount);
}
if (!string.IsNullOrWhiteSpace(_pickupSound))
if (_pickupSound.TryGetSound(out var pickupSound))
{
SoundSystem.Play(Filter.Pvs(Owner), _pickupSound, Owner);
SoundSystem.Play(Filter.Pvs(Owner), pickupSound, Owner);
}
return true;