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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user