EntityStorage ECS (#9291)

This commit is contained in:
Nemanja
2022-07-13 19:11:59 -04:00
committed by GitHub
parent a655891a8d
commit 5edf2ccad5
46 changed files with 1057 additions and 1126 deletions

View File

@@ -0,0 +1,36 @@
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);
}
}
}