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

@@ -24,6 +24,7 @@ using Content.Shared.Interaction;
using Content.Shared.Movement;
using Content.Shared.Notification;
using Content.Shared.Notification.Managers;
using Content.Shared.Sound;
using Content.Shared.Verbs;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
@@ -88,6 +89,9 @@ namespace Content.Server.Disposal.Mailing
[DataField("entryDelay")]
private float _entryDelay = 0.5f;
[DataField("receivedMessageSound")]
private SoundSpecifier _receivedMessageSound = new SoundPathSpecifier("/Audio/Machines/machine_switch.ogg");
/// <summary>
/// Token used to cancel the automatic engage of a disposal unit
/// after an entity enters it.
@@ -432,8 +436,8 @@ namespace Content.Server.Disposal.Mailing
break;
case UiButton.Power:
TogglePower();
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Machines/machine_switch.ogg", Owner, AudioParams.Default.WithVolume(-2f));
if(_receivedMessageSound.TryGetSound(out var sound))
SoundSystem.Play(Filter.Pvs(Owner), sound, Owner, AudioParams.Default.WithVolume(-2f));
break;
default:
throw new ArgumentOutOfRangeException();