replacing sound (collection) names with SoundSpecifier - part 1
This commit is contained in:
@@ -13,6 +13,7 @@ using Content.Shared.Hands.Components;
|
||||
using Content.Shared.Notification.Managers;
|
||||
using Content.Shared.Physics.Pull;
|
||||
using Content.Shared.Pulling.Components;
|
||||
using Content.Shared.Sound;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Containers;
|
||||
@@ -23,6 +24,7 @@ using Robust.Shared.Map;
|
||||
using Robust.Shared.Network;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Players;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
|
||||
namespace Content.Server.Hands.Components
|
||||
{
|
||||
@@ -34,6 +36,8 @@ namespace Content.Server.Hands.Components
|
||||
{
|
||||
[Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
|
||||
|
||||
[DataField("disarmedSound")] SoundSpecifier _disarmedSound = new SoundPathSpecifier("/Audio/Effects/thudswoosh.ogg");
|
||||
|
||||
int IDisarmedAct.Priority => int.MaxValue; // We want this to be the last disarm act to run.
|
||||
|
||||
public override void HandleMessage(ComponentMessage message, IComponent? component)
|
||||
@@ -175,8 +179,8 @@ namespace Content.Server.Hands.Components
|
||||
|
||||
if (source != null)
|
||||
{
|
||||
SoundSystem.Play(Filter.Pvs(source), "/Audio/Effects/thudswoosh.ogg", source,
|
||||
AudioHelpers.WithVariation(0.025f));
|
||||
if(_disarmedSound.TryGetSound(out var disarmedSound))
|
||||
SoundSystem.Play(Filter.Pvs(source), disarmedSound, source, AudioHelpers.WithVariation(0.025f));
|
||||
|
||||
if (target != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user