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

@@ -5,6 +5,7 @@ using Content.Shared.Chemistry;
using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.Notification.Managers;
using Content.Shared.Sound;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
@@ -27,6 +28,9 @@ namespace Content.Server.Chemistry.Components
[ViewVariables(VVAccess.ReadWrite)]
public ReagentUnit TransferAmount { get; set; } = ReagentUnit.New(5);
[DataField("InjectSound")]
private SoundSpecifier _injectSound = new SoundPathSpecifier("/Audio/Items/hypospray.ogg");
[ComponentDependency] private readonly SolutionContainerComponent? _solution = default!;
protected override void Initialize()
@@ -68,7 +72,8 @@ namespace Content.Server.Chemistry.Components
meleeSys.SendLunge(angle, user);
}
SoundSystem.Play(Filter.Pvs(user), "/Audio/Items/hypospray.ogg", user);
if(_injectSound.TryGetSound(out var injectSound))
SoundSystem.Play(Filter.Pvs(user), injectSound, user);
var targetSolution = target.GetComponent<SolutionContainerComponent>();