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

@@ -3,6 +3,7 @@ using System.Threading.Tasks;
using Content.Shared.Audio;
using Content.Shared.Interaction;
using Content.Shared.Smoking;
using Content.Shared.Sound;
using Content.Shared.Temperature;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
@@ -30,7 +31,7 @@ namespace Content.Server.Light.Components
/// <summary>
/// Sound played when you ignite the matchstick.
/// </summary>
[DataField("igniteSound")] private string? _igniteSound;
[DataField("igniteSound")] private SoundSpecifier _igniteSound = default!;
/// <summary>
/// Point light component. Gives matches a glow in dark effect.
@@ -69,9 +70,9 @@ namespace Content.Server.Light.Components
public void Ignite(IEntity user)
{
// Play Sound
if (!string.IsNullOrEmpty(_igniteSound))
if (_igniteSound.TryGetSound(out var igniteSound))
{
SoundSystem.Play(Filter.Pvs(Owner), _igniteSound, Owner,
SoundSystem.Play(Filter.Pvs(Owner), igniteSound, Owner,
AudioHelpers.WithVariation(0.125f).WithVolume(-0.125f));
}