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

@@ -8,12 +8,14 @@ using Content.Shared.Doors;
using Content.Shared.Interaction;
using Content.Shared.Notification;
using Content.Shared.Notification.Managers;
using Content.Shared.Sound;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Maths;
using Robust.Shared.Player;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
using static Content.Shared.Wires.SharedWiresComponent;
using static Content.Shared.Wires.SharedWiresComponent.WiresAction;
@@ -92,6 +94,10 @@ namespace Content.Server.Doors.Components
}
}
[DataField("setBoltsDownSound")] private SoundSpecifier _setBoltsDownSound = new SoundPathSpecifier("/Audio/Machines/boltsdown.ogg");
[DataField("setBoltsUpSound")] private SoundSpecifier _setBoltsUpSound = new SoundPathSpecifier("/Audio/Machines/boltsup.ogg");
private static readonly TimeSpan AutoCloseDelayFast = TimeSpan.FromSeconds(1);
[ViewVariables(VVAccess.ReadWrite)]
@@ -456,7 +462,16 @@ namespace Content.Server.Doors.Components
BoltsDown = newBolts;
SoundSystem.Play(Filter.Broadcast(), newBolts ? "/Audio/Machines/boltsdown.ogg" : "/Audio/Machines/boltsup.ogg", Owner);
if (newBolts)
{
if (_setBoltsDownSound.TryGetSound(out var boltsDownSound))
SoundSystem.Play(Filter.Broadcast(), boltsDownSound, Owner);
}
else
{
if (_setBoltsUpSound.TryGetSound(out var boltsUpSound))
SoundSystem.Play(Filter.Broadcast(), boltsUpSound, Owner);
}
}
}
}