diff --git a/Content.Server/Storage/EntitySystems/StorageSystem.cs b/Content.Server/Storage/EntitySystems/StorageSystem.cs index 90d1c40815..41f42aa6b1 100644 --- a/Content.Server/Storage/EntitySystems/StorageSystem.cs +++ b/Content.Server/Storage/EntitySystems/StorageSystem.cs @@ -375,7 +375,7 @@ namespace Content.Server.Storage.EntitySystems UpdateStorageVisualization(uid, storageComp); if (storageComp.StorageCloseSound is not null) - SoundSystem.Play(Filter.Pvs(uid, entityManager: EntityManager), storageComp.StorageCloseSound.GetSound(), uid, AudioParams.Default); + SoundSystem.Play(Filter.Pvs(uid, entityManager: EntityManager), storageComp.StorageCloseSound.GetSound(), uid, storageComp.StorageCloseSound.Params); } } @@ -584,7 +584,7 @@ namespace Content.Server.Storage.EntitySystems return; if (storageComp.StorageOpenSound is not null) - SoundSystem.Play(Filter.Pvs(uid, entityManager: EntityManager), storageComp.StorageOpenSound.GetSound(), uid, AudioParams.Default); + SoundSystem.Play(Filter.Pvs(uid, entityManager: EntityManager), storageComp.StorageOpenSound.GetSound(), uid, storageComp.StorageOpenSound.Params); Logger.DebugS(storageComp.LoggerName, $"Storage (UID {uid}) \"used\" by player session (UID {player.PlayerSession.AttachedEntity})."); diff --git a/Content.Shared/Inventory/InventorySystem.Equip.cs b/Content.Shared/Inventory/InventorySystem.Equip.cs index bec9776089..e5259f1e20 100644 --- a/Content.Shared/Inventory/InventorySystem.Equip.cs +++ b/Content.Shared/Inventory/InventorySystem.Equip.cs @@ -199,7 +199,7 @@ public abstract partial class InventorySystem filter.RemoveWhereAttachedEntity(entity => entity == actor); } - SoundSystem.Play(filter, item.EquipSound.GetSound(), target, AudioParams.Default.WithVolume(-2f)); + SoundSystem.Play(filter, item.EquipSound.GetSound(), target, item.EquipSound.Params.WithVolume(-2f)); } inventory.Dirty(); @@ -378,7 +378,7 @@ public abstract partial class InventorySystem filter.RemoveWhereAttachedEntity(entity => entity == actor); } - SoundSystem.Play(filter, item.UnequipSound.GetSound(), target, AudioParams.Default.WithVolume(-2f)); + SoundSystem.Play(filter, item.UnequipSound.GetSound(), target, item.UnequipSound.Params.WithVolume(-2f)); } inventory.Dirty(); diff --git a/Content.Shared/Sound/SoundSpecifier.cs b/Content.Shared/Sound/SoundSpecifier.cs index 35b38e823d..730a316e44 100644 --- a/Content.Shared/Sound/SoundSpecifier.cs +++ b/Content.Shared/Sound/SoundSpecifier.cs @@ -1,4 +1,6 @@ using Content.Shared.Audio; +using JetBrains.Annotations; +using Robust.Shared.Audio; using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Serialization.TypeSerializers.Implementations; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; @@ -9,6 +11,9 @@ namespace Content.Shared.Sound [ImplicitDataDefinitionForInheritors] public abstract class SoundSpecifier { + [DataField("params")] + public AudioParams Params = AudioParams.Default; + public abstract string GetSound(); } @@ -19,6 +24,7 @@ namespace Content.Shared.Sound [DataField(Node, customTypeSerializer: typeof(ResourcePathSerializer), required: true)] public ResourcePath? Path { get; } + [UsedImplicitly] public SoundPathSpecifier() { } @@ -46,6 +52,7 @@ namespace Content.Shared.Sound [DataField(Node, customTypeSerializer: typeof(PrototypeIdSerializer), required: true)] public string? Collection { get; } + [UsedImplicitly] public SoundCollectionSpecifier() { }