Nuke Music start adjusted for duration (#25946)

The exact time when the Nuke Music starts is now derived from the music's duration
This commit is contained in:
Errant
2024-03-12 19:50:34 +01:00
committed by GitHub
parent b0c65a03d5
commit 680cf5fec1
2 changed files with 16 additions and 5 deletions

View File

@@ -1,6 +1,7 @@
using Content.Server.Station.Systems;
using Content.Shared.Audio;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Console;
using Robust.Shared.Player;
@@ -10,6 +11,7 @@ public sealed class ServerGlobalSoundSystem : SharedGlobalSoundSystem
{
[Dependency] private readonly IConsoleHost _conHost = default!;
[Dependency] private readonly StationSystem _stationSystem = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
public override void Shutdown()
{
@@ -49,10 +51,14 @@ public sealed class ServerGlobalSoundSystem : SharedGlobalSoundSystem
}
public void DispatchStationEventMusic(EntityUid source, SoundSpecifier sound, StationEventMusicType type)
{
DispatchStationEventMusic(source, _audio.GetSound(sound), type);
}
public void DispatchStationEventMusic(EntityUid source, string sound, StationEventMusicType type)
{
var audio = AudioParams.Default.WithVolume(-8);
var soundFile = sound.GetSound();
var msg = new StationEventMusicEvent(soundFile, type, audio);
var msg = new StationEventMusicEvent(sound, type, audio);
var filter = GetStationAndPvs(source);
RaiseNetworkEvent(msg, filter);