replacing sound (collection) names with SoundSpecifier - part 1
This commit is contained in:
@@ -6,6 +6,7 @@ using Content.Server.UserInterface;
|
||||
using Content.Shared.APC;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Notification.Managers;
|
||||
using Content.Shared.Sound;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.GameObjects;
|
||||
@@ -13,6 +14,7 @@ using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Timing;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
@@ -28,6 +30,8 @@ namespace Content.Server.Power.Components
|
||||
|
||||
public bool MainBreakerEnabled { get; private set; } = true;
|
||||
|
||||
[DataField("onReceiveMessageSound")] private SoundSpecifier _onReceiveMessageSound = new SoundPathSpecifier("/Audio/Machines/machine_switch.ogg");
|
||||
|
||||
private ApcChargeState _lastChargeState;
|
||||
|
||||
private TimeSpan _lastChargeStateChange;
|
||||
@@ -90,7 +94,8 @@ namespace Content.Server.Power.Components
|
||||
Owner.GetComponent<PowerNetworkBatteryComponent>().CanDischarge = MainBreakerEnabled;
|
||||
|
||||
_uiDirty = true;
|
||||
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Machines/machine_switch.ogg", Owner, AudioParams.Default.WithVolume(-2f));
|
||||
if(_onReceiveMessageSound.TryGetSound(out var onReceiveMessageSound))
|
||||
SoundSystem.Play(Filter.Pvs(Owner), onReceiveMessageSound, Owner, AudioParams.Default.WithVolume(-2f));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user