Quieter bag sounds (#30225)
Co-authored-by: plykiya <plykiya@protonmail.com>
This commit is contained in:
@@ -22,6 +22,7 @@ using Content.Shared.Storage.Components;
|
|||||||
using Content.Shared.Timing;
|
using Content.Shared.Timing;
|
||||||
using Content.Shared.Verbs;
|
using Content.Shared.Verbs;
|
||||||
using Content.Shared.Whitelist;
|
using Content.Shared.Whitelist;
|
||||||
|
using Robust.Shared.Audio;
|
||||||
using Robust.Shared.Audio.Systems;
|
using Robust.Shared.Audio.Systems;
|
||||||
using Robust.Shared.Containers;
|
using Robust.Shared.Containers;
|
||||||
using Robust.Shared.GameStates;
|
using Robust.Shared.GameStates;
|
||||||
@@ -65,6 +66,9 @@ public abstract class SharedStorageSystem : EntitySystem
|
|||||||
public const string DefaultStorageMaxItemSize = "Normal";
|
public const string DefaultStorageMaxItemSize = "Normal";
|
||||||
|
|
||||||
public const float AreaInsertDelayPerItem = 0.075f;
|
public const float AreaInsertDelayPerItem = 0.075f;
|
||||||
|
private static AudioParams _audioParams = AudioParams.Default
|
||||||
|
.WithMaxDistance(7f)
|
||||||
|
.WithVolume(-2f);
|
||||||
|
|
||||||
private ItemSizePrototype _defaultStorageMaxItemSize = default!;
|
private ItemSizePrototype _defaultStorageMaxItemSize = default!;
|
||||||
|
|
||||||
@@ -542,7 +546,7 @@ public abstract class SharedStorageSystem : EntitySystem
|
|||||||
// If we picked up at least one thing, play a sound and do a cool animation!
|
// If we picked up at least one thing, play a sound and do a cool animation!
|
||||||
if (successfullyInserted.Count > 0)
|
if (successfullyInserted.Count > 0)
|
||||||
{
|
{
|
||||||
Audio.PlayPredicted(component.StorageInsertSound, uid, args.User);
|
Audio.PlayPredicted(component.StorageInsertSound, uid, args.User, _audioParams);
|
||||||
EntityManager.RaiseSharedEvent(new AnimateInsertingEntitiesEvent(
|
EntityManager.RaiseSharedEvent(new AnimateInsertingEntitiesEvent(
|
||||||
GetNetEntity(uid),
|
GetNetEntity(uid),
|
||||||
GetNetEntityList(successfullyInserted),
|
GetNetEntityList(successfullyInserted),
|
||||||
@@ -603,7 +607,7 @@ public abstract class SharedStorageSystem : EntitySystem
|
|||||||
{
|
{
|
||||||
if (_sharedHandsSystem.TryPickupAnyHand(player, entity, handsComp: hands)
|
if (_sharedHandsSystem.TryPickupAnyHand(player, entity, handsComp: hands)
|
||||||
&& storageComp.StorageRemoveSound != null)
|
&& storageComp.StorageRemoveSound != null)
|
||||||
Audio.PlayPredicted(storageComp.StorageRemoveSound, uid, player);
|
Audio.PlayPredicted(storageComp.StorageRemoveSound, uid, player, _audioParams);
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -663,7 +667,7 @@ public abstract class SharedStorageSystem : EntitySystem
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
TransformSystem.DropNextTo(itemEnt, player);
|
TransformSystem.DropNextTo(itemEnt, player);
|
||||||
Audio.PlayPredicted(storageComp.StorageRemoveSound, storageEnt, player);
|
Audio.PlayPredicted(storageComp.StorageRemoveSound, storageEnt, player, _audioParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnInsertItemIntoLocation(StorageInsertItemIntoLocationEvent msg, EntitySessionEventArgs args)
|
private void OnInsertItemIntoLocation(StorageInsertItemIntoLocationEvent msg, EntitySessionEventArgs args)
|
||||||
@@ -836,7 +840,7 @@ public abstract class SharedStorageSystem : EntitySystem
|
|||||||
Insert(target, entity, out _, user: user, targetComp, playSound: false);
|
Insert(target, entity, out _, user: user, targetComp, playSound: false);
|
||||||
}
|
}
|
||||||
|
|
||||||
Audio.PlayPredicted(sourceComp.StorageInsertSound, target, user);
|
Audio.PlayPredicted(sourceComp.StorageInsertSound, target, user, _audioParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -1015,7 +1019,7 @@ public abstract class SharedStorageSystem : EntitySystem
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (playSound)
|
if (playSound)
|
||||||
Audio.PlayPredicted(storageComp.StorageInsertSound, uid, user);
|
Audio.PlayPredicted(storageComp.StorageInsertSound, uid, user, _audioParams);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1045,7 +1049,7 @@ public abstract class SharedStorageSystem : EntitySystem
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (playSound)
|
if (playSound)
|
||||||
Audio.PlayPredicted(storageComp.StorageInsertSound, uid, user);
|
Audio.PlayPredicted(storageComp.StorageInsertSound, uid, user, _audioParams);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user