Cleanup: Use `SoundCollectionSpecifier instead of string literals in PowerGridCheckRule` (#35449)

* Cleanup

* Update

* .

* Volume
This commit is contained in:
Winkarst
2025-02-25 00:16:10 +03:00
committed by GitHub
parent c899ae7649
commit ebc1bff4cb
3 changed files with 19 additions and 1 deletions

View File

@@ -1,11 +1,24 @@
using System.Threading;
using Content.Server.StationEvents.Events;
using Robust.Shared.Audio;
using Robust.Shared.Prototypes;
namespace Content.Server.StationEvents.Components;
[RegisterComponent, Access(typeof(PowerGridCheckRule))]
public sealed partial class PowerGridCheckRuleComponent : Component
{
/// <summary>
/// Default sound of the announcement when power is back on.
/// </summary>
private static readonly ProtoId<SoundCollectionPrototype> DefaultPowerOn = new("PowerOn");
/// <summary>
/// Sound of the announcement to play when power is back on.
/// </summary>
[DataField]
public SoundSpecifier PowerOnSound = new SoundCollectionSpecifier(DefaultPowerOn, AudioParams.Default.WithVolume(-4f));
public CancellationTokenSource? AnnounceCancelToken;
public EntityUid AffectedStation;