CatStation/Content.Client/Chemistry/EntitySystems/PillSystem.cs
Pieter-Jan Briers 5168b5f3d4
IoC source gen compatibility (#43863)
* IoC source gen compatibility

Can be merged before or after https://github.com/space-wizards/RobustToolbox/pull/6549 doesn't really matter.

* Missed a spot
2026-05-09 03:29:58 +00:00

26 lines
774 B
C#

using Content.Shared.Chemistry.Components;
using Robust.Client.GameObjects;
namespace Content.Client.Chemistry.EntitySystems;
public sealed partial class PillSystem : EntitySystem
{
[Dependency] private SpriteSystem _sprite = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<PillComponent, AfterAutoHandleStateEvent>(OnHandleState);
}
private void OnHandleState(EntityUid uid, PillComponent component, ref AfterAutoHandleStateEvent args)
{
if (!TryComp(uid, out SpriteComponent? sprite))
return;
if (!_sprite.TryGetLayer((uid, sprite), 0, out var layer, false))
return;
_sprite.LayerSetRsiState(layer, $"pill{component.PillType + 1}");
}
}