mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* 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>
32 lines
1.1 KiB
C#
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);
|
|
}
|
|
}
|