replacing sound (collection) names with SoundSpecifier - part 1
This commit is contained in:
@@ -14,6 +14,7 @@ using Content.Shared.Item;
|
||||
using Content.Shared.Movement;
|
||||
using Content.Shared.Notification.Managers;
|
||||
using Content.Shared.Physics;
|
||||
using Content.Shared.Sound;
|
||||
using Content.Shared.Storage;
|
||||
using Content.Shared.Tool;
|
||||
using Content.Shared.Verbs;
|
||||
@@ -76,10 +77,10 @@ namespace Content.Server.Storage.Components
|
||||
private bool _isWeldedShut;
|
||||
|
||||
[DataField("closeSound")]
|
||||
private string _closeSound = "/Audio/Machines/closetclose.ogg";
|
||||
private SoundSpecifier _closeSound = new SoundPathSpecifier("/Audio/Machines/closetclose.ogg");
|
||||
|
||||
[DataField("openSound")]
|
||||
private string _openSound = "/Audio/Machines/closetopen.ogg";
|
||||
private SoundSpecifier _openSound = new SoundPathSpecifier("/Audio/Machines/closetopen.ogg");
|
||||
|
||||
[ViewVariables]
|
||||
protected Container Contents = default!;
|
||||
@@ -219,7 +220,8 @@ namespace Content.Server.Storage.Components
|
||||
}
|
||||
|
||||
ModifyComponents();
|
||||
SoundSystem.Play(Filter.Pvs(Owner), _closeSound, Owner);
|
||||
if(_closeSound.TryGetSound(out var closeSound))
|
||||
SoundSystem.Play(Filter.Pvs(Owner), closeSound, Owner);
|
||||
_lastInternalOpenAttempt = default;
|
||||
}
|
||||
|
||||
@@ -228,7 +230,8 @@ namespace Content.Server.Storage.Components
|
||||
Open = true;
|
||||
EmptyContents();
|
||||
ModifyComponents();
|
||||
SoundSystem.Play(Filter.Pvs(Owner), _openSound, Owner);
|
||||
if(_openSound.TryGetSound(out var openSound))
|
||||
SoundSystem.Play(Filter.Pvs(Owner), openSound, Owner);
|
||||
}
|
||||
|
||||
private void UpdateAppearance()
|
||||
|
||||
Reference in New Issue
Block a user