CatStation/Content.Client/Chemistry/Visualizers/SmokeVisualizerSystem.cs
Whatstone d9ffbf1d03
Cleanup: AppearanceSystem.TryGetData to AppearanceChangeEvent.TryGetData (#45373)
* First impl. of appearance TryGetData cleanup

* Handful of fixes

* DamageVisuals: fix HandleDamage call, inheritdoc

* bunch of unused AppearanceSystem instances

* Handful more unused appearance systems, inheritdoc

* JetpackSystem: Ent<T>

* cleanup roundup, more Ent<T>

* a few lingering AppearanceSystem.TryGetData calls

* more lingering AppearanceData access

* Remove unnecessary inheritdoc

* once again, with feeling
2026-10-05 00:45:37 +00:00

22 lines
811 B
C#

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