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

@@ -5,6 +5,7 @@ using Content.Shared.Interaction;
using Content.Shared.Inventory.Events;
using Content.Shared.Radiation.Components;
using Content.Shared.Radiation.Systems;
using Robust.Server.Audio;
using Robust.Server.GameObjects;
using Robust.Server.Player;
@@ -149,7 +150,7 @@ public sealed class GeigerSystem : SharedGeigerSystem
if (!Resolve(uid, ref component, false))
return;
component.Stream?.Stop();
component.Stream = _audio.Stop(component.Stream);
if (!component.Sounds.TryGetValue(component.DangerLevel, out var sounds))
return;
@@ -163,7 +164,7 @@ public sealed class GeigerSystem : SharedGeigerSystem
var sound = _audio.GetSound(sounds);
var param = sounds.Params.WithLoop(true).WithVolume(-4f);
component.Stream = _audio.PlayGlobal(sound, session, param);
component.Stream = _audio.PlayGlobal(sound, session, param)?.Entity;
}
public static GeigerDangerLevel RadsToLevel(float rads)