From cd2fd77dbdd4f4189a8323f0b5a878dc1126792e Mon Sep 17 00:00:00 2001 From: Plykiya <58439124+Plykiya@users.noreply.github.com> Date: Mon, 22 Jul 2024 02:54:15 -0700 Subject: [PATCH] Quieter bag sounds (#30225) Co-authored-by: plykiya --- .../Storage/EntitySystems/SharedStorageSystem.cs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Content.Shared/Storage/EntitySystems/SharedStorageSystem.cs b/Content.Shared/Storage/EntitySystems/SharedStorageSystem.cs index 1343305a4bf..0af33cfcc8b 100644 --- a/Content.Shared/Storage/EntitySystems/SharedStorageSystem.cs +++ b/Content.Shared/Storage/EntitySystems/SharedStorageSystem.cs @@ -23,6 +23,7 @@ using Content.Shared.Storage.Components; using Content.Shared.Timing; using Content.Shared.Verbs; using Content.Shared.Whitelist; +using Robust.Shared.Audio; using Robust.Shared.Audio.Systems; using Robust.Shared.Containers; using Robust.Shared.GameStates; @@ -66,6 +67,9 @@ public abstract class SharedStorageSystem : EntitySystem public const string DefaultStorageMaxItemSize = "Normal"; public const float AreaInsertDelayPerItem = 0.075f; + private static AudioParams _audioParams = AudioParams.Default + .WithMaxDistance(7f) + .WithVolume(-2f); private ItemSizePrototype _defaultStorageMaxItemSize = default!; @@ -543,7 +547,7 @@ public abstract class SharedStorageSystem : EntitySystem // If we picked up at least one thing, play a sound and do a cool animation! if (successfullyInserted.Count > 0) { - Audio.PlayPredicted(component.StorageInsertSound, uid, args.User); + Audio.PlayPredicted(component.StorageInsertSound, uid, args.User, _audioParams); EntityManager.RaiseSharedEvent(new AnimateInsertingEntitiesEvent( GetNetEntity(uid), GetNetEntityList(successfullyInserted), @@ -604,7 +608,7 @@ public abstract class SharedStorageSystem : EntitySystem { if (_sharedHandsSystem.TryPickupAnyHand(player, entity, handsComp: hands) && storageComp.StorageRemoveSound != null) - Audio.PlayPredicted(storageComp.StorageRemoveSound, uid, player); + Audio.PlayPredicted(storageComp.StorageRemoveSound, uid, player, _audioParams); { return; } @@ -664,7 +668,7 @@ public abstract class SharedStorageSystem : EntitySystem return; TransformSystem.DropNextTo(itemEnt, player); - Audio.PlayPredicted(storageComp.StorageRemoveSound, storageEnt, player); + Audio.PlayPredicted(storageComp.StorageRemoveSound, storageEnt, player, _audioParams); } private void OnInsertItemIntoLocation(StorageInsertItemIntoLocationEvent msg, EntitySessionEventArgs args) @@ -840,7 +844,7 @@ public abstract class SharedStorageSystem : EntitySystem Insert(target, entity, out _, user: user, targetComp, playSound: false); } - Audio.PlayPredicted(sourceComp.StorageInsertSound, target, user); + Audio.PlayPredicted(sourceComp.StorageInsertSound, target, user, _audioParams); } /// @@ -1019,7 +1023,7 @@ public abstract class SharedStorageSystem : EntitySystem return false; if (playSound) - Audio.PlayPredicted(storageComp.StorageInsertSound, uid, user); + Audio.PlayPredicted(storageComp.StorageInsertSound, uid, user, _audioParams); return true; } @@ -1049,7 +1053,7 @@ public abstract class SharedStorageSystem : EntitySystem } if (playSound) - Audio.PlayPredicted(storageComp.StorageInsertSound, uid, user); + Audio.PlayPredicted(storageComp.StorageInsertSound, uid, user, _audioParams); return true; }