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

@@ -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);
}