replacing sound (collection) names with SoundSpecifier - part 1
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user