CatStation/Content.Client/Sprite/SimpleSpriteOverlaySystem.cs
August Sun 3b1997d9c0
Adds the Xenoborg Heavy Radioactive module (#43126)
* Added radioactive prototype and audio

* value changes, pointlight removal

* Added XenoborgVisualsComp and System, added visuals sprite for radioactive layer

* Fixed XenoborgVisualsComp to show on sprite

* Removed action button

* Fixes

* fixes

* cleanup

* make sprite brighter

* why was this removed?

* just remove the diff

* fix test fail

---------

Co-authored-by: august-sun <45527070+august.sun@users.noreply.github.com>
Co-authored-by: beck-thompson <beck314159@hotmail.com>
Co-authored-by: Samuel-C <samuelcamilo8@gmail.com>
2026-08-04 15:46:41 +00:00

32 lines
1.1 KiB
C#

using Content.Shared.Sprite;
using Robust.Client.GameObjects;
namespace Content.Client.Sprite;
public sealed partial class SimpleSpriteOverlaySystem : EntitySystem
{
[Dependency] private SpriteSystem _sprite = default!;
[SubscribeLocalEvent]
private void OnAfterHandleState(Entity<SimpleSpriteOverlayComponent> ent, ref AfterAutoHandleStateEvent args)
{
var sprite = Comp<SpriteComponent>(ent);
var index = _sprite.LayerMapReserve((ent.Owner, sprite), ent.Comp.LayerMap);
_sprite.LayerSetSprite((ent.Owner, sprite), index, ent.Comp.OverlaySprite);
_sprite.LayerSetVisible((ent.Owner, sprite), index, true);
if (ent.Comp.Shader is not null)
sprite.LayerSetShader(index, ent.Comp.Shader);
}
[SubscribeLocalEvent]
private void OnCompShutdown(Entity<SimpleSpriteOverlayComponent> ent, ref ComponentShutdown args)
{
var sprite = Comp<SpriteComponent>(ent);
if (_sprite.LayerMapTryGet((ent.Owner, sprite), ent.Comp.LayerMap, out var index, true))
_sprite.LayerSetVisible((ent.Owner, sprite), index, false);
}
}