replacing sound (collection) names with SoundSpecifier - part 1
This commit is contained in:
@@ -12,6 +12,7 @@ using Content.Shared.Interaction;
|
||||
using Content.Shared.Interaction.Events;
|
||||
using Content.Shared.Morgue;
|
||||
using Content.Shared.Notification.Managers;
|
||||
using Content.Shared.Sound;
|
||||
using Content.Shared.Standing;
|
||||
using Content.Shared.Verbs;
|
||||
using Robust.Server.Player;
|
||||
@@ -20,6 +21,7 @@ using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Utility;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
@@ -34,6 +36,8 @@ namespace Content.Server.Morgue.Components
|
||||
{
|
||||
public override string Name => "CrematoriumEntityStorage";
|
||||
|
||||
[DataField("cremateFinishSound")] private SoundSpecifier _cremateFinishSound = new SoundPathSpecifier("/Audio/Machines/ding.ogg");
|
||||
|
||||
[ViewVariables]
|
||||
public bool Cooking { get; private set; }
|
||||
|
||||
@@ -50,7 +54,7 @@ namespace Content.Server.Morgue.Components
|
||||
{
|
||||
if (Appearance.TryGetData(CrematoriumVisuals.Burning, out bool isBurning) && isBurning)
|
||||
{
|
||||
message.AddMarkup(Loc.GetString("crematorium-entity-storage-component-on-examine-details-is-burning",("owner", Owner)) + "\n");
|
||||
message.AddMarkup(Loc.GetString("crematorium-entity-storage-component-on-examine-details-is-burning", ("owner", Owner)) + "\n");
|
||||
}
|
||||
|
||||
if (Appearance.TryGetData(MorgueVisuals.HasContents, out bool hasContents) && hasContents)
|
||||
@@ -68,7 +72,8 @@ namespace Content.Server.Morgue.Components
|
||||
{
|
||||
if (Cooking)
|
||||
{
|
||||
if (!silent) Owner.PopupMessage(user, Loc.GetString("crematorium-entity-storage-component-is-cooking-safety-message"));
|
||||
if (!silent)
|
||||
Owner.PopupMessage(user, Loc.GetString("crematorium-entity-storage-component-is-cooking-safety-message"));
|
||||
return false;
|
||||
}
|
||||
return base.CanOpen(user, silent);
|
||||
@@ -116,7 +121,9 @@ namespace Content.Server.Morgue.Components
|
||||
|
||||
TryOpenStorage(Owner);
|
||||
|
||||
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Machines/ding.ogg", Owner);
|
||||
if (_cremateFinishSound.TryGetSound(out var cremateFinishSound))
|
||||
SoundSystem.Play(Filter.Pvs(Owner), cremateFinishSound, Owner);
|
||||
|
||||
}, _cremateCancelToken.Token);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user