* Station AI overlay * implement * Bunch of ports * Fix a heap of bugs and basic scouting * helldivers * Shuffle interactions a bit * navmap stuff * Revert "navmap stuff" This reverts commit d1f89dd4be83233e22cf5dd062b2581f3c6da062. * AI wires implemented * Fix examines * Optimise the overlay significantly * Back to old static * BUI radial working * lots of work * Saving work * thanks fork * alright * pc * AI upload console * AI upload * stuff * Fix copy-paste shitcode * AI actions * navmap work * Fixes * first impressions * a * reh * Revert "navmap work" This reverts commit 6f63fea6e9245e189f368f97be3e32e9b210580e. # Conflicts: # Content.Client/Silicons/StationAi/StationAiOverlay.cs * OD * radar * weh * Fix examines * scoop mine eyes * fixes * reh * Optimise * Final round of optimisations * Fixes * fixes
35 lines
1.1 KiB
C#
35 lines
1.1 KiB
C#
using Content.Server.Power.Components;
|
|
using Content.Server.Power.EntitySystems;
|
|
using Content.Shared.Power;
|
|
using Content.Shared.Sound;
|
|
using Content.Shared.Sound.Components;
|
|
|
|
namespace Content.Server.Sound;
|
|
|
|
public sealed partial class SpamEmitSoundRequirePowerSystem : SharedSpamEmitSoundRequirePowerSystem
|
|
{
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<SpamEmitSoundRequirePowerComponent, PowerChangedEvent>(OnPowerChanged);
|
|
SubscribeLocalEvent<SpamEmitSoundRequirePowerComponent, PowerNetBatterySupplyEvent>(OnPowerSupply);
|
|
}
|
|
|
|
private void OnPowerChanged(Entity<SpamEmitSoundRequirePowerComponent> entity, ref PowerChangedEvent args)
|
|
{
|
|
if (TryComp<SpamEmitSoundComponent>(entity.Owner, out var comp))
|
|
{
|
|
EmitSound.SetEnabled((entity, comp), args.Powered);
|
|
}
|
|
}
|
|
|
|
private void OnPowerSupply(Entity<SpamEmitSoundRequirePowerComponent> entity, ref PowerNetBatterySupplyEvent args)
|
|
{
|
|
if (TryComp<SpamEmitSoundComponent>(entity.Owner, out var comp))
|
|
{
|
|
EmitSound.SetEnabled((entity, comp), args.Supply);
|
|
}
|
|
}
|
|
}
|