* Cleanup warnings in ClickableSystem * Cleanup warnings in FultonSystem * Cleanup warning in HolidaySystem * Cleanup warning in DoAfterOverlay * Cleanup warning in EntityHealthBarOverlay * Cleanup warning in SmokeVisualizerSystem * Cleanup warning in VaporVisualizerSystem * Cleanup warning in ColorFlashEffectSystem * Cleanup warnings in StealthSystem * Cleanup warnings in TrayScannerSystem * Cleanup warnings in InventoryUIController * Cleanup warnings in HideMechanismsCommand * Cleanup warning in ShowMechanismsCommand * Cleanup warnings in EntityPickupAnimationSystem * Cleanup warnings in PointingSystem * Cleanup warning in StickyVisualizerSystem * Cleanup warnings in TabletopSystem * Cleanup warnings in PillSystem * Cleanup warnings in DiceSystem * Cleanup warnings in ProjectileSystem
23 lines
823 B
C#
23 lines
823 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 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 (!AppearanceSystem.TryGetData<Color>(uid, SmokeVisuals.Color, out var color))
|
|
return;
|
|
SpriteSystem.SetColor((uid, args.Sprite), color);
|
|
}
|
|
}
|