CatStation/Content.Client/Beam/BeamSystem.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

35 lines
996 B
C#

using Content.Client.Beam.Components;
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))
{
_sprite.SetRotation((beam, sprites), args.UserAngle);
if (args.BodyState != null)
{
_sprite.LayerSetRsiState((beam, sprites), 0, args.BodyState);
sprites.LayerSetShader(0, args.Shader);
}
}
}
}