using Robust.Client.GameObjects; using Content.Shared.Disease; namespace Content.Client.Disease { /// /// Controls client-side visuals for the /// disease machines. /// public sealed class DiseaseMachineSystem : VisualizerSystem { protected override void OnAppearanceChange(EntityUid uid, DiseaseMachineVisualsComponent component, ref AppearanceChangeEvent args) { if (args.Sprite == null) return; if (AppearanceSystem.TryGetData(uid, DiseaseMachineVisuals.IsOn, out var isOn, args.Component) && AppearanceSystem.TryGetData(uid, DiseaseMachineVisuals.IsRunning, out var isRunning, args.Component)) { var state = isRunning ? component.RunningState : component.IdleState; args.Sprite.LayerSetVisible(DiseaseMachineVisualLayers.IsOn, isOn); args.Sprite.LayerSetState(DiseaseMachineVisualLayers.IsRunning, state); } } } } public enum DiseaseMachineVisualLayers : byte { IsOn, IsRunning }