Fix bug with pipe color (#30645)

Co-authored-by: ArtisticRoomba <145879011+ArtisticRoomba@users.noreply.github.com>
This commit is contained in:
IgorAnt028
2025-07-20 01:10:38 +03:00
committed by GitHub
parent f21803bfd8
commit 41a175636b
7 changed files with 105 additions and 59 deletions

View File

@@ -0,0 +1,27 @@
using Content.Shared.Atmos.EntitySystems;
using Robust.Shared.GameStates;
using JetBrains.Annotations;
namespace Content.Shared.Atmos.Components;
[RegisterComponent, NetworkedComponent]
[AutoGenerateComponentState]
public sealed partial class AtmosPipeColorComponent : Component
{
[DataField]
[AutoNetworkedField]
public Color Color { get; set; } = Color.White;
[ViewVariables(VVAccess.ReadWrite), UsedImplicitly]
public Color ColorVV
{
get => Color;
set => IoCManager.Resolve<IEntityManager>().System<AtmosPipeColorSystem>().SetColor((Owner, this), value);
}
}
[ByRefEvent]
public record struct AtmosPipeColorChangedEvent(Color color)
{
public Color Color = color;
}