CatStation/Content.Client/Atmos/EntitySystems/GasCanisterAppearanceSystem.cs
Whatstone f42f8df6d1
Cleanup: ProtoMan Part 2 - remove Client and Server EntitySystem IPrototypeManager instances (#44416)
* Remove all IPrototypeManager instances

* Remove redundant IComponentFactory instances too

* Found some stragglers

* DestructibleSystem.PrototypeManager: no dependency

* not based
2026-06-29 21:33:56 +00:00

25 lines
952 B
C#

using Content.Shared.Atmos.Piping.Unary.Components;
using Content.Shared.SprayPainter.Prototypes;
using Robust.Client.GameObjects;
namespace Content.Client.Atmos.EntitySystems;
/// <summary>
/// Used to change the appearance of gas canisters.
/// </summary>
public sealed partial class GasCanisterAppearanceSystem : VisualizerSystem<GasCanisterComponent>
{
protected override void OnAppearanceChange(EntityUid uid, GasCanisterComponent component, ref AppearanceChangeEvent args)
{
if (!AppearanceSystem.TryGetData<string>(uid, PaintableVisuals.Prototype, out var protoName, args.Component) || args.Sprite is not { } old)
return;
if (!ProtoMan.HasIndex(protoName))
return;
// Create the given prototype and get its first layer.
var tempUid = Spawn(protoName);
SpriteSystem.LayerSetRsiState(uid, 0, SpriteSystem.LayerGetRsiState(tempUid, 0));
QueueDel(tempUid);
}
}