replacing sound (collection) names with SoundSpecifier - part 1

This commit is contained in:
Galactic Chimp
2021-07-10 17:35:33 +02:00
parent 4500b66f28
commit ce3c59e0e6
131 changed files with 934 additions and 587 deletions

View File

@@ -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
{