replacing sound (collection) names with SoundSpecifier - part 1
This commit is contained in:
@@ -4,8 +4,8 @@ using System.Threading.Tasks;
|
||||
using Content.Server.Hands.Components;
|
||||
using Content.Server.Tools.Components;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Notification;
|
||||
using Content.Shared.Notification.Managers;
|
||||
using Content.Shared.Sound;
|
||||
using Content.Shared.Tool;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Audio;
|
||||
@@ -14,6 +14,7 @@ using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
|
||||
namespace Content.Server.AME.Components
|
||||
{
|
||||
@@ -25,7 +26,7 @@ namespace Content.Server.AME.Components
|
||||
[Dependency] private readonly IServerEntityManager _serverEntityManager = default!;
|
||||
|
||||
public override string Name => "AMEPart";
|
||||
private string _unwrap = "/Audio/Effects/unwrap.ogg";
|
||||
[DataField("unwrapSound")] private SoundSpecifier _unwrapSound = new SoundPathSpecifier("/Audio/Effects/unwrap.ogg");
|
||||
|
||||
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs args)
|
||||
{
|
||||
@@ -51,7 +52,8 @@ namespace Content.Server.AME.Components
|
||||
var ent = _serverEntityManager.SpawnEntity("AMEShielding", mapGrid.GridTileToLocal(snapPos));
|
||||
ent.Transform.LocalRotation = Owner.Transform.LocalRotation;
|
||||
|
||||
SoundSystem.Play(Filter.Pvs(Owner), _unwrap, Owner);
|
||||
if(_unwrapSound.TryGetSound(out var unwrapSound))
|
||||
SoundSystem.Play(Filter.Pvs(Owner), unwrapSound, Owner);
|
||||
|
||||
Owner.Delete();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user