6
StarHorizon_Public/Content.Client/Smoking/BurnStateVisualizerSystem.cs
2025-12-18 02:55:17 +03:00

26 lines
775 B
C#

using Robust.Client.GameObjects;
using Content.Shared.Smoking;
namespace Content.Client.Smoking;
public sealed class BurnStateVisualizerSystem : VisualizerSystem<BurnStateVisualsComponent>
{
protected override void OnAppearanceChange(EntityUid uid, BurnStateVisualsComponent component, ref AppearanceChangeEvent args)
{
if (args.Sprite == null)
return;
if (!args.AppearanceData.TryGetValue(SmokingVisuals.Smoking, out var burnState))
return;
var state = burnState switch
{
SmokableState.Lit => component.LitIcon,
SmokableState.Burnt => component.BurntIcon,
_ => component.UnlitIcon
};
SpriteSystem.LayerSetRsiState((uid, args.Sprite), 0, state);
}
}