replacing sound (collection) names with SoundSpecifier - part 1
This commit is contained in:
@@ -5,10 +5,12 @@ using Content.Shared.Chemistry.Solution.Components;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Notification;
|
||||
using Content.Shared.Notification.Managers;
|
||||
using Content.Shared.Sound;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
|
||||
#nullable enable
|
||||
|
||||
@@ -19,6 +21,8 @@ namespace Content.Server.Extinguisher
|
||||
{
|
||||
public override string Name => "FireExtinguisher";
|
||||
|
||||
[DataField("refillSound")] SoundSpecifier _refillSound = new SoundPathSpecifier("/Audio/Effects/refill.ogg");
|
||||
|
||||
// Higher priority than sprays.
|
||||
int IAfterInteract.Priority => 1;
|
||||
|
||||
@@ -40,7 +44,8 @@ namespace Content.Server.Extinguisher
|
||||
var drained = targetSolution.Drain(trans);
|
||||
container.TryAddSolution(drained);
|
||||
|
||||
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Effects/refill.ogg", Owner);
|
||||
if(_refillSound.TryGetSound(out var sound))
|
||||
SoundSystem.Play(Filter.Pvs(Owner), sound, Owner);
|
||||
eventArgs.Target.PopupMessage(eventArgs.User, Loc.GetString("fire-extinguisher-component-after-interact-refilled-message",("owner", Owner)));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user