Ambient music fixes (#17685)

This commit is contained in:
metalgearsloth
2023-06-27 21:28:51 +10:00
committed by GitHub
parent 46a0f178e5
commit 1485666a23
16 changed files with 456 additions and 362 deletions

View File

@@ -2,25 +2,24 @@ using Content.Server.Power.Components;
using Content.Server.Power.EntitySystems;
using Content.Shared.Audio;
namespace Content.Server.Audio
namespace Content.Server.Audio;
public sealed class AmbientSoundSystem : SharedAmbientSoundSystem
{
public sealed class AmbientSoundSystem : SharedAmbientSoundSystem
public override void Initialize()
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<AmbientOnPoweredComponent, PowerChangedEvent>(HandlePowerChange);
SubscribeLocalEvent<AmbientOnPoweredComponent, PowerNetBatterySupplyEvent>(HandlePowerSupply);
}
base.Initialize();
SubscribeLocalEvent<AmbientOnPoweredComponent, PowerChangedEvent>(HandlePowerChange);
SubscribeLocalEvent<AmbientOnPoweredComponent, PowerNetBatterySupplyEvent>(HandlePowerSupply);
}
private void HandlePowerSupply(EntityUid uid, AmbientOnPoweredComponent component, ref PowerNetBatterySupplyEvent args)
{
SetAmbience(uid, args.Supply);
}
private void HandlePowerSupply(EntityUid uid, AmbientOnPoweredComponent component, ref PowerNetBatterySupplyEvent args)
{
SetAmbience(uid, args.Supply);
}
private void HandlePowerChange(EntityUid uid, AmbientOnPoweredComponent component, ref PowerChangedEvent args)
{
SetAmbience(uid, args.Powered);
}
private void HandlePowerChange(EntityUid uid, AmbientOnPoweredComponent component, ref PowerChangedEvent args)
{
SetAmbience(uid, args.Powered);
}
}