Convert piped atmos entity visualizers (#9200)
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
using Content.Client.Atmos.Components;
|
||||
using Robust.Client.GameObjects;
|
||||
using Content.Shared.Atmos.Piping;
|
||||
|
||||
namespace Content.Client.Atmos.EntitySystems;
|
||||
|
||||
public sealed class PipeColorVisualizerSystem : VisualizerSystem<PipeColorVisualsComponent>
|
||||
{
|
||||
protected override void OnAppearanceChange(EntityUid uid, PipeColorVisualsComponent component, ref AppearanceChangeEvent args)
|
||||
{
|
||||
if(TryComp<SpriteComponent>(uid, out var sprite)
|
||||
&& args.Component.TryGetData<Color>(PipeColorVisuals.Color, out var color))
|
||||
{
|
||||
// T-ray scanner / sub floor runs after this visualizer. Lets not bulldoze transparency.
|
||||
var layer = sprite[PipeVisualLayers.Pipe];
|
||||
layer.Color = color.WithAlpha(layer.Color.A);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public enum PipeVisualLayers : byte
|
||||
{
|
||||
Pipe,
|
||||
}
|
||||
Reference in New Issue
Block a user