* optimize appearance updating for subfloor entities * sprite event args * a * stop double appearance update.
23 lines
645 B
C#
23 lines
645 B
C#
using Content.Shared.Bed;
|
|
using Robust.Client.GameObjects;
|
|
|
|
namespace Content.Client.Bed
|
|
{
|
|
public sealed class StasisBedSystem : VisualizerSystem<StasisBedVisualsComponent>
|
|
{
|
|
protected override void OnAppearanceChange(EntityUid uid, StasisBedVisualsComponent component, ref AppearanceChangeEvent args)
|
|
{
|
|
if (args.Sprite != null
|
|
&& args.Component.TryGetData(StasisBedVisuals.IsOn, out bool isOn))
|
|
{
|
|
args.Sprite.LayerSetVisible(StasisBedVisualLayers.IsOn, isOn);
|
|
}
|
|
}
|
|
}
|
|
|
|
public enum StasisBedVisualLayers : byte
|
|
{
|
|
IsOn,
|
|
}
|
|
}
|