CatStation/Content.Shared/Gatherable/Components/SoundOnGatherComponent.cs
Stanislav b22d38f9c0
Yaml audio params are often ignored (#36259)
* Replace WithVolume() with AddVolume(),
Remove AudioHelpers.WithVariation(),
Use specifier options for audio params

* Undo switching to AudioParams.AddVariation()

* Replace AudioHelpers.WithVariation with AudioParams.AddVariation()

* Test AudioParams.AddVariation() and change input parameters to sound like previous AudioHelpers.WithVariation()

* Fix build error

* Fix build error v2

* Remove DoAfter

* fixes

---------

Co-authored-by: AJCM-git <ajcm_mail@disroot.org>
2026-07-25 16:16:23 +00:00

21 lines
676 B
C#

using Content.Shared.Audio;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
namespace Content.Shared.Gatherable.Components;
/// <summary>
/// Plays the specified sound when this entity is gathered.
/// </summary>
[RegisterComponent, NetworkedComponent]
[Access(typeof(GatherableSystem))]
public sealed partial class SoundOnGatherComponent : Component
{
/// <summary>
/// Sound to play when this entity is gathered.
/// </summary>
[DataField]
public SoundSpecifier Sound = new SoundPathSpecifier("/Audio/Effects/break_stone.ogg", AudioParams.Default
.WithVariation(SharedContentAudioSystem.DefaultVariation)
.AddVolume(-3f));
}