using Content.Shared.Smoking;
using Robust.Client.GameObjects;
namespace Content.Client.Chemistry.Visualizers;
///
/// Ensures entities with have a color corresponding with their contained reagents.
///
public sealed class SmokeVisualizerSystem : VisualizerSystem
{
///
/// Syncs the color of the smoke with the color of its contained reagents.
///
protected override void OnAppearanceChange(EntityUid uid, SmokeVisualsComponent comp, ref AppearanceChangeEvent args)
{
if (args.Sprite == null)
return;
if (!AppearanceSystem.TryGetData(uid, SmokeVisuals.Color, out var color))
return;
SpriteSystem.SetColor((uid, args.Sprite), color);
}
}