diff --git a/Content.Client/SubFloor/SubFloorHideSystem.cs b/Content.Client/SubFloor/SubFloorHideSystem.cs
index 81e476b0c4..8f1f505cee 100644
--- a/Content.Client/SubFloor/SubFloorHideSystem.cs
+++ b/Content.Client/SubFloor/SubFloorHideSystem.cs
@@ -53,16 +53,19 @@ public sealed class SubFloorHideSystem : SharedSubFloorHideSystem
}
// Is there some layer that is always visible?
- if (args.Sprite.LayerMapTryGet(SubfloorLayers.FirstLayer, out var firstLayer))
+ var hasVisibleLayer = false;
+ foreach (var layerKey in component.VisibleLayers)
{
- var layer = args.Sprite[firstLayer];
+ if (!args.Sprite.LayerMapTryGet(layerKey, out var layerIndex))
+ continue;
+
+ var layer = args.Sprite[layerIndex];
layer.Visible = true;
layer.Color = layer.Color.WithAlpha(1f);
- args.Sprite.Visible = true;
- return;
+ hasVisibleLayer = true;
}
- args.Sprite.Visible = revealed;
+ args.Sprite.Visible = hasVisibleLayer || revealed;
}
private void UpdateAll()
@@ -73,8 +76,3 @@ public sealed class SubFloorHideSystem : SharedSubFloorHideSystem
}
}
}
-
-public enum SubfloorLayers : byte
-{
- FirstLayer, // always visible. E.g. vent part of a vent..
-}
diff --git a/Content.Shared/SubFloor/SharedSubFloorHideSystem.cs b/Content.Shared/SubFloor/SharedSubFloorHideSystem.cs
index 527e7b8ad4..77c76bec88 100644
--- a/Content.Shared/SubFloor/SharedSubFloorHideSystem.cs
+++ b/Content.Shared/SubFloor/SharedSubFloorHideSystem.cs
@@ -184,4 +184,9 @@ namespace Content.Shared.SubFloor
Covered, // is there a floor tile over this entity
ScannerRevealed, // is this entity revealed by a scanner or some other entity?
}
+
+ public enum SubfloorLayers : byte
+ {
+ FirstLayer
+ }
}
diff --git a/Content.Shared/SubFloor/SubFloorHideComponent.cs b/Content.Shared/SubFloor/SubFloorHideComponent.cs
index 585c998a98..b9c581d4e4 100644
--- a/Content.Shared/SubFloor/SubFloorHideComponent.cs
+++ b/Content.Shared/SubFloor/SubFloorHideComponent.cs
@@ -1,4 +1,6 @@
using Robust.Shared.GameStates;
+using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
+using Robust.Shared.Serialization.TypeSerializers.Implementations.Generic;
namespace Content.Shared.SubFloor
{
@@ -43,6 +45,13 @@ namespace Content.Shared.SubFloor
[DataField("scannerTransparency")]
public float ScannerTransparency = 0.8f;
+ ///
+ /// Sprite layer keys for the layers that are always visible, even if the entity is below a floor tile. E.g.,
+ /// the vent part of a vent is always visible, even though the piping is hidden.
+ ///
+ [DataField("visibleLayers", customTypeSerializer:typeof(CustomHashSetSerializer