cleaning up more stuff with crematoriums and morgues (#11384)
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
namespace Content.Client.Morgue.Visualizers;
|
||||
public enum CrematoriumVisualLayers : byte
|
||||
{
|
||||
Base,
|
||||
LightBurning,
|
||||
LightContent
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
using Content.Shared.Morgue;
|
||||
using Content.Shared.Storage;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
|
||||
namespace Content.Client.Morgue.Visualizers;
|
||||
|
||||
public sealed class CrematoriumVisualizerSystem : VisualizerSystem<CrematoriumVisualsComponent>
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
}
|
||||
|
||||
protected override void OnAppearanceChange(EntityUid uid, CrematoriumVisualsComponent component, ref AppearanceChangeEvent args)
|
||||
{
|
||||
if (args.Sprite == null)
|
||||
return;
|
||||
|
||||
string? lightState = null;
|
||||
if (args.Component.TryGetData(CrematoriumVisuals.Burning, out bool isBurning) && isBurning)
|
||||
lightState = component.LightBurning;
|
||||
else if (args.Component.TryGetData(StorageVisuals.HasContents, out bool hasContents) && hasContents)
|
||||
lightState = component.LightContents;
|
||||
|
||||
if (lightState != null)
|
||||
{
|
||||
args.Sprite.LayerSetState(CrematoriumVisualLayers.Light, lightState);
|
||||
args.Sprite.LayerSetVisible(CrematoriumVisualLayers.Light, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
args.Sprite.LayerSetVisible(CrematoriumVisualLayers.Light, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
namespace Content.Client.Morgue.Visualizers;
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed class CrematoriumVisualsComponent : Component
|
||||
{
|
||||
[DataField("lightContents", required: true)]
|
||||
public string LightContents = default!;
|
||||
[DataField("lightBurning", required: true)]
|
||||
public string LightBurning = default!;
|
||||
}
|
||||
|
||||
public enum CrematoriumVisualLayers : byte
|
||||
{
|
||||
Base,
|
||||
Light,
|
||||
}
|
||||
Reference in New Issue
Block a user