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

@@ -8,6 +8,7 @@ using Content.Shared.Disposal.Components;
using Content.Shared.Movement;
using Content.Shared.Notification;
using Content.Shared.Notification.Managers;
using Content.Shared.Sound;
using Content.Shared.Verbs;
using Robust.Server.Console;
using Robust.Server.GameObjects;
@@ -37,7 +38,7 @@ namespace Content.Server.Disposal.Tube.Components
private bool _connected;
private bool _broken;
[DataField("clangSound")]
private string _clangSound = "/Audio/Effects/clang.ogg";
private SoundSpecifier _clangSound = new SoundPathSpecifier("/Audio/Effects/clang.ogg");
/// <summary>
/// Container of entities that are currently inside this tube
@@ -266,7 +267,8 @@ namespace Content.Server.Disposal.Tube.Components
}
_lastClang = _gameTiming.CurTime;
SoundSystem.Play(Filter.Pvs(Owner), _clangSound, Owner.Transform.Coordinates);
if(_clangSound.TryGetSound(out var clangSound))
SoundSystem.Play(Filter.Pvs(Owner), clangSound, Owner.Transform.Coordinates);
break;
}
}