2023-04-29 11:09:11 +02:00
|
|
|
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
|
|
|
|
|
};
|
|
|
|
|
|
2025-05-18 21:09:47 -04:00
|
|
|
SpriteSystem.LayerSetRsiState((uid, args.Sprite), 0, state);
|
2023-04-29 11:09:11 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|