Content audio (#20862)
This commit is contained in:
@@ -39,7 +39,7 @@ public sealed partial class SalvageExpeditionComponent : SharedSalvageExpedition
|
||||
/// <summary>
|
||||
/// Countdown audio stream.
|
||||
/// </summary>
|
||||
public IPlayingAudioStream? Stream = null;
|
||||
public EntityUid? Stream = null;
|
||||
|
||||
/// <summary>
|
||||
/// Sound that plays when the mission end is imminent.
|
||||
|
||||
@@ -73,7 +73,7 @@ public sealed partial class SalvageSystem
|
||||
|
||||
private void OnExpeditionShutdown(EntityUid uid, SalvageExpeditionComponent component, ComponentShutdown args)
|
||||
{
|
||||
component.Stream?.Stop();
|
||||
component.Stream = _audio.Stop(component.Stream);
|
||||
|
||||
foreach (var (job, cancelToken) in _salvageJobs.ToArray())
|
||||
{
|
||||
|
||||
@@ -153,7 +153,7 @@ public sealed partial class SalvageSystem
|
||||
else if (comp.Stage < ExpeditionStage.MusicCountdown && remaining < TimeSpan.FromMinutes(2))
|
||||
{
|
||||
// TODO: Some way to play audio attached to a map for players.
|
||||
comp.Stream = _audio.PlayGlobal(comp.Sound, Filter.BroadcastMap(Comp<MapComponent>(uid).MapId), true);
|
||||
comp.Stream = _audio.PlayGlobal(comp.Sound, Filter.BroadcastMap(Comp<MapComponent>(uid).MapId), true).Value.Entity;
|
||||
comp.Stage = ExpeditionStage.MusicCountdown;
|
||||
Dirty(uid, comp);
|
||||
Announce(uid, Loc.GetString("salvage-expedition-announcement-countdown-minutes", ("duration", TimeSpan.FromMinutes(2).Minutes)));
|
||||
|
||||
@@ -27,6 +27,8 @@ using Content.Shared.Random;
|
||||
using Content.Shared.Random.Helpers;
|
||||
using Content.Shared.Tools.Components;
|
||||
using Robust.Server.Maps;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.Map.Components;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user