Content audio (#20862)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using Content.Shared.Construction;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.Random;
|
||||
|
||||
namespace Content.Server.Construction.Completions
|
||||
|
||||
@@ -25,5 +25,5 @@ public sealed partial class PartExchangerComponent : Component
|
||||
[DataField("exchangeSound")]
|
||||
public SoundSpecifier ExchangeSound = new SoundPathSpecifier("/Audio/Items/rped.ogg");
|
||||
|
||||
public IPlayingAudioStream? AudioStream;
|
||||
public EntityUid? AudioStream;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@ using Content.Shared.Storage;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.Utility;
|
||||
using Content.Shared.Wires;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.Collections;
|
||||
|
||||
namespace Content.Server.Construction;
|
||||
@@ -34,7 +36,7 @@ public sealed class PartExchangerSystem : EntitySystem
|
||||
{
|
||||
if (args.Cancelled)
|
||||
{
|
||||
component.AudioStream?.Stop();
|
||||
component.AudioStream = _audio.Stop(component.AudioStream);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -168,7 +170,7 @@ public sealed class PartExchangerSystem : EntitySystem
|
||||
return;
|
||||
}
|
||||
|
||||
component.AudioStream = _audio.PlayPvs(component.ExchangeSound, uid);
|
||||
component.AudioStream = _audio.PlayPvs(component.ExchangeSound, uid).Value.Entity;
|
||||
|
||||
_doAfter.TryStartDoAfter(new DoAfterArgs(EntityManager, args.User, component.ExchangeDuration, new ExchangerDoAfterEvent(), uid, target: args.Target, used: uid)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user