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

@@ -20,6 +20,7 @@ using Content.Shared.DragDrop;
using Content.Shared.Interaction;
using Content.Shared.Movement;
using Content.Shared.Notification.Managers;
using Content.Shared.Sound;
using Content.Shared.Throwing;
using Content.Shared.Verbs;
using Robust.Server.GameObjects;
@@ -78,6 +79,8 @@ namespace Content.Server.Disposal.Unit.Components
[DataField("flushDelay")]
private readonly TimeSpan _flushDelay = TimeSpan.FromSeconds(3);
[DataField("clickSound")] private SoundSpecifier _clickSound = new SoundPathSpecifier("/Audio/Machines/machine_switch.ogg");
/// <summary>
/// Delay from trying to enter disposals ourselves.
/// </summary>
@@ -377,7 +380,8 @@ namespace Content.Server.Disposal.Unit.Components
break;
case UiButton.Power:
TogglePower();
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Machines/machine_switch.ogg", Owner, AudioParams.Default.WithVolume(-2f));
if(_clickSound.TryGetSound(out var clickSound))
SoundSystem.Play(Filter.Pvs(Owner), clickSound, Owner, AudioParams.Default.WithVolume(-2f));
break;
default:
throw new ArgumentOutOfRangeException();