Content audio (#20862)

This commit is contained in:
metalgearsloth
2023-10-29 14:58:23 +11:00
committed by GitHub
parent cd280eef6b
commit 9b1b3e03ed
326 changed files with 890 additions and 436 deletions

View File

@@ -8,6 +8,8 @@ using Content.Shared.Emag.Systems;
using Content.Shared.Examine;
using Content.Shared.Mobs.Components;
using Content.Shared.Stacks;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Containers;
using Robust.Shared.Physics.Events;
using Robust.Shared.Timing;
@@ -48,7 +50,7 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem
private void OnShutdown(EntityUid uid, MaterialReclaimerComponent component, ComponentShutdown args)
{
component.Stream?.Stop();
_audio.Stop(component.Stream);
}
private void OnUnpaused(EntityUid uid, MaterialReclaimerComponent component, ref EntityUnpausedEvent args)
@@ -116,8 +118,7 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem
if (Timing.CurTime > component.NextSound)
{
component.Stream = _audio.PlayPredicted(component.Sound, uid, user);
component.Stream = _audio.PlayPredicted(component.Sound, uid, user)?.Entity;
component.NextSound = Timing.CurTime + component.SoundCooldown;
}
@@ -167,9 +168,11 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem
component.ItemsProcessed++;
if (component.CutOffSound)
component.Stream?.Stop();
{
_audio.Stop(component.Stream);
}
Dirty(component);
Dirty(uid, component);
}
/// <summary>
@@ -181,7 +184,7 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem
return;
component.Enabled = enabled;
AmbientSound.SetAmbience(uid, enabled && component.Powered);
Dirty(component);
Dirty(uid, component);
}
/// <summary>