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);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ using Content.Shared.Interaction.Helpers;
|
||||
using Content.Shared.Morgue;
|
||||
using Content.Shared.Notification.Managers;
|
||||
using Content.Shared.Physics;
|
||||
using Content.Shared.Sound;
|
||||
using Content.Shared.Standing;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Audio;
|
||||
@@ -44,6 +45,9 @@ namespace Content.Server.Morgue.Components
|
||||
[DataField("doSoulBeep")]
|
||||
public bool DoSoulBeep = true;
|
||||
|
||||
[DataField("occupantHasSoulAlarmSound")]
|
||||
private SoundSpecifier _occupantHasSoulAlarmSound = new SoundPathSpecifier("/Audio/Weapons/Guns/EmptyAlarm/smg_empty_alarm.ogg");
|
||||
|
||||
[ViewVariables]
|
||||
[ComponentDependency] protected readonly AppearanceComponent? Appearance = null;
|
||||
|
||||
@@ -56,13 +60,15 @@ namespace Content.Server.Morgue.Components
|
||||
|
||||
public override Vector2 ContentsDumpPosition()
|
||||
{
|
||||
if (_tray != null) return _tray.Transform.WorldPosition;
|
||||
if (_tray != null)
|
||||
return _tray.Transform.WorldPosition;
|
||||
return base.ContentsDumpPosition();
|
||||
}
|
||||
|
||||
protected override bool AddToContents(IEntity entity)
|
||||
{
|
||||
if (entity.HasComponent<SharedBodyComponent>() && !EntitySystem.Get<StandingStateSystem>().IsDown(entity)) return false;
|
||||
if (entity.HasComponent<SharedBodyComponent>() && !EntitySystem.Get<StandingStateSystem>().IsDown(entity))
|
||||
return false;
|
||||
return base.AddToContents(entity);
|
||||
}
|
||||
|
||||
@@ -73,7 +79,8 @@ namespace Content.Server.Morgue.Components
|
||||
collisionMask: CollisionGroup.Impassable | CollisionGroup.VaultImpassable
|
||||
))
|
||||
{
|
||||
if(!silent) Owner.PopupMessage(user, Loc.GetString("morgue-entity-storage-component-cannot-open-no-space"));
|
||||
if (!silent)
|
||||
Owner.PopupMessage(user, Loc.GetString("morgue-entity-storage-component-cannot-open-no-space"));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -112,8 +119,10 @@ namespace Content.Server.Morgue.Components
|
||||
foreach (var entity in Contents.ContainedEntities)
|
||||
{
|
||||
count++;
|
||||
if (!hasMob && entity.HasComponent<SharedBodyComponent>()) hasMob = true;
|
||||
if (!hasSoul && entity.TryGetComponent<ActorComponent>(out var actor) && actor.PlayerSession != null) hasSoul = true;
|
||||
if (!hasMob && entity.HasComponent<SharedBodyComponent>())
|
||||
hasMob = true;
|
||||
if (!hasSoul && entity.TryGetComponent<ActorComponent>(out var actor) && actor.PlayerSession != null)
|
||||
hasSoul = true;
|
||||
}
|
||||
Appearance?.SetData(MorgueVisuals.HasContents, count > 0);
|
||||
Appearance?.SetData(MorgueVisuals.HasMob, hasMob);
|
||||
@@ -138,8 +147,11 @@ namespace Content.Server.Morgue.Components
|
||||
{
|
||||
CheckContents();
|
||||
|
||||
if(DoSoulBeep && Appearance !=null && Appearance.TryGetData(MorgueVisuals.HasSoul, out bool hasSoul) && hasSoul)
|
||||
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Weapons/Guns/EmptyAlarm/smg_empty_alarm.ogg", Owner);
|
||||
if (DoSoulBeep && Appearance != null && Appearance.TryGetData(MorgueVisuals.HasSoul, out bool hasSoul) && hasSoul &&
|
||||
_occupantHasSoulAlarmSound.TryGetSound(out var occupantHasSoulAlarmSound))
|
||||
{
|
||||
SoundSystem.Play(Filter.Pvs(Owner), occupantHasSoulAlarmSound, Owner);
|
||||
}
|
||||
}
|
||||
|
||||
void IExamine.Examine(FormattedMessage message, bool inDetailsRange)
|
||||
@@ -159,7 +171,8 @@ namespace Content.Server.Morgue.Components
|
||||
else if (Appearance.TryGetData(MorgueVisuals.HasContents, out bool hasContents) && hasContents)
|
||||
{
|
||||
message.AddMarkup(Loc.GetString("morgue-entity-storage-component-on-examine-details-has-contents"));
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
message.AddMarkup(Loc.GetString("morgue-entity-storage-component-on-examine-details-empty"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user