mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
32 lines
891 B
C#
32 lines
891 B
C#
using Content.Shared.Beam;
|
|
using Content.Shared.Beam.Components;
|
|
using Robust.Client.GameObjects;
|
|
|
|
namespace Content.Client.Beam;
|
|
|
|
public sealed partial class BeamSystem : SharedBeamSystem
|
|
{
|
|
[Dependency] private SpriteSystem _sprite = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeNetworkEvent<BeamVisualizerEvent>(BeamVisualizerMessage);
|
|
}
|
|
|
|
//TODO: Sometime in the future this needs to be replaced with tiled sprites
|
|
private void BeamVisualizerMessage(BeamVisualizerEvent args)
|
|
{
|
|
var beam = GetEntity(args.Beam);
|
|
|
|
if (TryComp<SpriteComponent>(beam, out var sprites))
|
|
{
|
|
if (args.BodyState != null)
|
|
{
|
|
_sprite.LayerSetRsiState((beam, sprites), 0, args.BodyState);
|
|
sprites.LayerSetShader(0, args.Shader);
|
|
}
|
|
}
|
|
}
|
|
}
|