From 9292e3a43c236fd300e22efaff003dfcbdc02be4 Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Fri, 21 Mar 2025 00:57:04 +1100 Subject: [PATCH] Sloth's subfloor vismask adventure (#35347) * Add a subfloor vismask Significantly cuts down on sent entity count. * More optimisations * Fix command * Fixes * namespace cleanup * Review * Vismasks * Content update * Bandaid * awewa * Revert these * reh * Update Content.Shared/SubFloor/TrayScannerComponent.cs --------- Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com> --- Content.Client/SubFloor/SubFloorHideSystem.cs | 26 +++++++- .../Systems/Sandbox/SandboxUIController.cs | 16 ++++- .../Sandbox/Windows/SandboxWindow.xaml.cs | 13 +++- .../Tests/PrototypeSaveTest.cs | 1 - Content.Server/Ghost/GhostSystem.cs | 27 ++++----- .../Revenant/EntitySystems/RevenantSystem.cs | 12 ++-- Content.Server/SubFloor/SubFloorHideSystem.cs | 60 +++++++++++++++++++ Content.Shared/Eye/VisibilityFlags.cs | 1 + Content.Shared/Ghost/GhostComponent.cs | 4 +- .../SubFloor/SharedSubFloorHideSystem.cs | 37 +++++++++--- .../SubFloor/SharedTrayScannerSystem.cs | 53 ++++++++++++++-- .../SubFloor/SubFloorHideComponent.cs | 10 ++-- .../SubFloor/TrayScannerComponent.cs | 5 +- .../SubFloor/TrayScannerUserComponent.cs | 8 +++ .../Objects/Devices/station_beacon.yml | 2 + .../Structures/Piping/Atmospherics/binary.yml | 24 ++++++++ .../Structures/Piping/Atmospherics/pipes.yml | 2 + .../Piping/Atmospherics/trinary.yml | 6 ++ .../Structures/Piping/Atmospherics/unary.yml | 9 +++ .../Structures/Piping/Disposal/pipes.yml | 2 + .../Structures/Power/cable_terminal.yml | 4 +- .../Entities/Structures/Power/cables.yml | 2 + 22 files changed, 277 insertions(+), 47 deletions(-) create mode 100644 Content.Shared/SubFloor/TrayScannerUserComponent.cs diff --git a/Content.Client/SubFloor/SubFloorHideSystem.cs b/Content.Client/SubFloor/SubFloorHideSystem.cs index df65717c40..997d375fbe 100644 --- a/Content.Client/SubFloor/SubFloorHideSystem.cs +++ b/Content.Client/SubFloor/SubFloorHideSystem.cs @@ -1,12 +1,15 @@ -using Content.Shared.DrawDepth; +using Content.Client.UserInterface.Systems.Sandbox; using Content.Shared.SubFloor; using Robust.Client.GameObjects; +using Robust.Client.UserInterface; +using Robust.Shared.Player; namespace Content.Client.SubFloor; public sealed class SubFloorHideSystem : SharedSubFloorHideSystem { [Dependency] private readonly SharedAppearanceSystem _appearance = default!; + [Dependency] private readonly IUserInterfaceManager _ui = default!; private bool _showAll; @@ -18,8 +21,13 @@ public sealed class SubFloorHideSystem : SharedSubFloorHideSystem { if (_showAll == value) return; _showAll = value; + _ui.GetUIController().SetToggleSubfloors(value); - UpdateAll(); + var ev = new ShowSubfloorRequestEvent() + { + Value = value, + }; + RaiseNetworkEvent(ev); } } @@ -28,6 +36,20 @@ public sealed class SubFloorHideSystem : SharedSubFloorHideSystem base.Initialize(); SubscribeLocalEvent(OnAppearanceChanged); + SubscribeNetworkEvent(OnRequestReceived); + SubscribeLocalEvent(OnPlayerDetached); + } + + private void OnPlayerDetached(LocalPlayerDetachedEvent ev) + { + // Vismask resets so need to reset this. + ShowAll = false; + } + + private void OnRequestReceived(ShowSubfloorRequestEvent ev) + { + // When client receives request Queue an update on all vis. + UpdateAll(); } private void OnAppearanceChanged(EntityUid uid, SubFloorHideComponent component, ref AppearanceChangeEvent args) diff --git a/Content.Client/UserInterface/Systems/Sandbox/SandboxUIController.cs b/Content.Client/UserInterface/Systems/Sandbox/SandboxUIController.cs index 1924bf2b24..037cc99754 100644 --- a/Content.Client/UserInterface/Systems/Sandbox/SandboxUIController.cs +++ b/Content.Client/UserInterface/Systems/Sandbox/SandboxUIController.cs @@ -39,7 +39,6 @@ public sealed class SandboxUIController : UIController, IOnStateChanged { SandboxButton!.Pressed = true; }; _window.OnClose += () => { SandboxButton!.Pressed = false; }; + + // TODO: These need moving to opened so at least if they're not synced properly on open they work. _window.ToggleLightButton.Pressed = !_light.Enabled; _window.ToggleFovButton.Pressed = !_eye.CurrentEye.DrawFov; _window.ToggleShadowsButton.Pressed = !_light.DrawShadows; - _window.ToggleSubfloorButton.Pressed = _subfloorHide.ShowAll; _window.ShowMarkersButton.Pressed = _marker.MarkersVisible; _window.ShowBbButton.Pressed = (_debugPhysics.Flags & PhysicsDebugFlags.Shapes) != 0x0; @@ -219,4 +219,16 @@ public sealed class SandboxUIController : UIController, IOnStateChanged().ShowAll; } } diff --git a/Content.IntegrationTests/Tests/PrototypeSaveTest.cs b/Content.IntegrationTests/Tests/PrototypeSaveTest.cs index 1ef34365ea..9ff8ca2900 100644 --- a/Content.IntegrationTests/Tests/PrototypeSaveTest.cs +++ b/Content.IntegrationTests/Tests/PrototypeSaveTest.cs @@ -35,7 +35,6 @@ public sealed class PrototypeSaveTest await using var pair = await PoolManager.GetServerClient(); var server = pair.Server; - var mapManager = server.ResolveDependency(); var entityMan = server.ResolveDependency(); var prototypeMan = server.ResolveDependency(); var seriMan = server.ResolveDependency(); diff --git a/Content.Server/Ghost/GhostSystem.cs b/Content.Server/Ghost/GhostSystem.cs index 5bfa208b1c..1ca96889cf 100644 --- a/Content.Server/Ghost/GhostSystem.cs +++ b/Content.Server/Ghost/GhostSystem.cs @@ -100,6 +100,17 @@ namespace Content.Server.Ghost SubscribeLocalEvent(_ => MakeVisible(true)); SubscribeLocalEvent(OnToggleGhostVisibilityToAll); + + SubscribeLocalEvent(OnGhostVis); + } + + private void OnGhostVis(Entity ent, ref GetVisMaskEvent args) + { + // If component not deleting they can see ghosts. + if (ent.Comp.LifeStage <= ComponentLifeStage.Running) + { + args.VisibilityMask |= (int)VisibilityFlags.Ghost; + } } private void OnGhostHearingAction(EntityUid uid, GhostComponent component, ToggleGhostHearingActionEvent args) @@ -186,8 +197,7 @@ namespace Content.Server.Ghost _visibilitySystem.RefreshVisibility(uid, visibilityComponent: visibility); } - SetCanSeeGhosts(uid, true); - + _eye.RefreshVisibilityMask(uid); var time = _gameTiming.CurTime; component.TimeOfDeath = time; } @@ -207,21 +217,10 @@ namespace Content.Server.Ghost } // Entity can't see ghosts anymore. - SetCanSeeGhosts(uid, false); + _eye.RefreshVisibilityMask(uid); _actions.RemoveAction(uid, component.BooActionEntity); } - private void SetCanSeeGhosts(EntityUid uid, bool canSee, EyeComponent? eyeComponent = null) - { - if (!Resolve(uid, ref eyeComponent, false)) - return; - - if (canSee) - _eye.SetVisibilityMask(uid, eyeComponent.VisibilityMask | (int) VisibilityFlags.Ghost, eyeComponent); - else - _eye.SetVisibilityMask(uid, eyeComponent.VisibilityMask & ~(int) VisibilityFlags.Ghost, eyeComponent); - } - private void OnMapInit(EntityUid uid, GhostComponent component, MapInitEvent args) { _actions.AddAction(uid, ref component.BooActionEntity, component.BooAction); diff --git a/Content.Server/Revenant/EntitySystems/RevenantSystem.cs b/Content.Server/Revenant/EntitySystems/RevenantSystem.cs index 4cfceaf297..b319db09e0 100644 --- a/Content.Server/Revenant/EntitySystems/RevenantSystem.cs +++ b/Content.Server/Revenant/EntitySystems/RevenantSystem.cs @@ -63,9 +63,16 @@ public sealed partial class RevenantSystem : EntitySystem SubscribeLocalEvent(OnStatusEnded); SubscribeLocalEvent(_ => MakeVisible(true)); + SubscribeLocalEvent(OnRevenantGetVis); + InitializeAbilities(); } + private void OnRevenantGetVis(Entity ent, ref GetVisMaskEvent args) + { + args.VisibilityMask |= (int)VisibilityFlags.Ghost; + } + private void OnStartup(EntityUid uid, RevenantComponent component, ComponentStartup args) { //update the icon @@ -84,10 +91,7 @@ public sealed partial class RevenantSystem : EntitySystem } //ghost vision - if (TryComp(uid, out EyeComponent? eye)) - { - _eye.SetVisibilityMask(uid, eye.VisibilityMask | (int) (VisibilityFlags.Ghost), eye); - } + _eye.RefreshVisibilityMask(uid); } private void OnMapInit(EntityUid uid, RevenantComponent component, MapInitEvent args) diff --git a/Content.Server/SubFloor/SubFloorHideSystem.cs b/Content.Server/SubFloor/SubFloorHideSystem.cs index 497d7788d7..54f4be86a0 100644 --- a/Content.Server/SubFloor/SubFloorHideSystem.cs +++ b/Content.Server/SubFloor/SubFloorHideSystem.cs @@ -1,16 +1,76 @@ using Content.Shared.Construction.Components; +using Content.Shared.Eye; using Content.Shared.SubFloor; +using Robust.Server.Player; +using Robust.Shared.Enums; using Robust.Shared.Map.Components; +using Robust.Shared.Player; namespace Content.Server.SubFloor; public sealed class SubFloorHideSystem : SharedSubFloorHideSystem { + [Dependency] private readonly IPlayerManager _player = default!; + [Dependency] private readonly SharedEyeSystem _eye = default!; + + private HashSet _showFloors = new(); + public override void Initialize() { base.Initialize(); SubscribeLocalEvent(OnAnchorAttempt); SubscribeLocalEvent(OnUnanchorAttempt); + SubscribeNetworkEvent(OnShowSubfloor); + SubscribeLocalEvent(OnGetVisibility); + + _player.PlayerStatusChanged += OnPlayerStatus; + } + + private void OnPlayerStatus(object? sender, SessionStatusEventArgs e) + { + if (e.NewStatus == SessionStatus.Connected) + return; + + _showFloors.Remove(e.Session); + + if (e.Session.AttachedEntity != null) + _eye.RefreshVisibilityMask(e.Session.AttachedEntity.Value); + } + + private void OnGetVisibility(ref GetVisMaskEvent ev) + { + if (!TryComp(ev.Entity, out ActorComponent? actor)) + return; + + if (_showFloors.Contains(actor.PlayerSession)) + { + ev.VisibilityMask |= (int)VisibilityFlags.Subfloor; + } + } + + private void OnShowSubfloor(ShowSubfloorRequestEvent ev, EntitySessionEventArgs args) + { + // TODO: Commands are a bit of an eh? for client-only but checking shared perms + var ent = args.SenderSession.AttachedEntity; + + if (!TryComp(ent, out EyeComponent? eyeComp)) + return; + + if (ev.Value) + { + _showFloors.Add(args.SenderSession); + } + else + { + _showFloors.Remove(args.SenderSession); + } + + _eye.RefreshVisibilityMask((ent.Value, eyeComp)); + + RaiseNetworkEvent(new ShowSubfloorRequestEvent() + { + Value = ev.Value, + }, args.SenderSession); } private void OnAnchorAttempt(EntityUid uid, SubFloorHideComponent component, AnchorAttemptEvent args) diff --git a/Content.Shared/Eye/VisibilityFlags.cs b/Content.Shared/Eye/VisibilityFlags.cs index a4037f2bd7..432e80dd58 100644 --- a/Content.Shared/Eye/VisibilityFlags.cs +++ b/Content.Shared/Eye/VisibilityFlags.cs @@ -9,5 +9,6 @@ namespace Content.Shared.Eye None = 0, Normal = 1 << 0, Ghost = 1 << 1, + Subfloor = 1 << 2, } } diff --git a/Content.Shared/Ghost/GhostComponent.cs b/Content.Shared/Ghost/GhostComponent.cs index 56eee1881c..6fbb59a711 100644 --- a/Content.Shared/Ghost/GhostComponent.cs +++ b/Content.Shared/Ghost/GhostComponent.cs @@ -5,7 +5,7 @@ using Robust.Shared.Prototypes; namespace Content.Shared.Ghost; [RegisterComponent, NetworkedComponent, Access(typeof(SharedGhostSystem))] -[AutoGenerateComponentState(true)] +[AutoGenerateComponentState(true), AutoGenerateComponentPause] public sealed partial class GhostComponent : Component { // Actions @@ -41,7 +41,7 @@ public sealed partial class GhostComponent : Component // End actions - [ViewVariables(VVAccess.ReadWrite), DataField] + [ViewVariables(VVAccess.ReadWrite), DataField, AutoPausedField] public TimeSpan TimeOfDeath = TimeSpan.Zero; [DataField("booRadius"), ViewVariables(VVAccess.ReadWrite)] diff --git a/Content.Shared/SubFloor/SharedSubFloorHideSystem.cs b/Content.Shared/SubFloor/SharedSubFloorHideSystem.cs index c90a28a513..d15055875a 100644 --- a/Content.Shared/SubFloor/SharedSubFloorHideSystem.cs +++ b/Content.Shared/SubFloor/SharedSubFloorHideSystem.cs @@ -1,5 +1,6 @@ using Content.Shared.Audio; using Content.Shared.Explosion; +using Content.Shared.Eye; using Content.Shared.Interaction.Events; using Content.Shared.Maps; using JetBrains.Annotations; @@ -19,11 +20,16 @@ namespace Content.Shared.SubFloor [Dependency] private readonly SharedAmbientSoundSystem _ambientSoundSystem = default!; [Dependency] protected readonly SharedMapSystem Map = default!; [Dependency] protected readonly SharedAppearanceSystem Appearance = default!; + [Dependency] private readonly SharedVisibilitySystem _visibility = default!; + + private EntityQuery _hideQuery; public override void Initialize() { base.Initialize(); + _hideQuery = GetEntityQuery(); + SubscribeLocalEvent(OnTileChanged); SubscribeLocalEvent(OnSubFloorStarted); SubscribeLocalEvent(OnSubFloorTerminating); @@ -67,7 +73,7 @@ namespace Content.Shared.SubFloor return; // Regardless of whether we're on a subfloor or not, unhide. - component.IsUnderCover = false; + SetUnderCover((uid, component), false); UpdateAppearance(uid, component); } @@ -80,7 +86,7 @@ namespace Content.Shared.SubFloor } else if (component.IsUnderCover) { - component.IsUnderCover = false; + SetUnderCover((uid, component), false); UpdateAppearance(uid, component); } } @@ -93,7 +99,7 @@ namespace Content.Shared.SubFloor if (args.NewTile.Tile.IsEmpty) return; // Anything that was here will be unanchored anyways. - UpdateTile(args.NewTile.GridUid, Comp(args.NewTile.GridUid), args.NewTile.GridIndices); + UpdateTile(args.NewTile.GridUid, args.Entity.Comp, args.NewTile.GridIndices); } /// @@ -105,13 +111,24 @@ namespace Content.Shared.SubFloor return; if (xform.Anchored && TryComp(xform.GridUid, out var grid)) - component.IsUnderCover = HasFloorCover(xform.GridUid.Value, grid, Map.TileIndicesFor(xform.GridUid.Value, grid, xform.Coordinates)); + SetUnderCover((uid, component), HasFloorCover(xform.GridUid.Value, grid, Map.TileIndicesFor(xform.GridUid.Value, grid, xform.Coordinates))); else - component.IsUnderCover = false; + SetUnderCover((uid, component), false); UpdateAppearance(uid, component); } + private void SetUnderCover(Entity entity, bool value) + { + // If it's not undercover or it always has visible layers then normal visibility. + _visibility.SetLayer(entity.Owner, value && entity.Comp.VisibleLayers.Count == 0 ? (ushort) VisibilityFlags.Subfloor : (ushort) VisibilityFlags.Normal); + + if (entity.Comp.IsUnderCover == value) + return; + + entity.Comp.IsUnderCover = value; + } + public bool HasFloorCover(EntityUid gridUid, MapGridComponent grid, Vector2i position) { // TODO Redo this function. Currently wires on an asteroid are always "below the floor" @@ -125,13 +142,13 @@ namespace Content.Shared.SubFloor foreach (var uid in Map.GetAnchoredEntities(gridUid, grid, position)) { - if (!TryComp(uid, out SubFloorHideComponent? hideComp)) + if (!_hideQuery.TryComp(uid, out var hideComp)) continue; if (hideComp.IsUnderCover == covered) continue; - hideComp.IsUnderCover = covered; + SetUnderCover((uid, hideComp), covered); UpdateAppearance(uid, hideComp); } } @@ -154,6 +171,12 @@ namespace Content.Shared.SubFloor Appearance.SetData(uid, SubFloorVisuals.Covered, hideComp.IsUnderCover, appearance); } } + + [Serializable, NetSerializable] + protected sealed class ShowSubfloorRequestEvent : EntityEventArgs + { + public bool Value; + } } [Serializable, NetSerializable] diff --git a/Content.Shared/SubFloor/SharedTrayScannerSystem.cs b/Content.Shared/SubFloor/SharedTrayScannerSystem.cs index 8903747e43..79bfddeccd 100644 --- a/Content.Shared/SubFloor/SharedTrayScannerSystem.cs +++ b/Content.Shared/SubFloor/SharedTrayScannerSystem.cs @@ -1,17 +1,16 @@ +using Content.Shared.Eye; +using Content.Shared.Hands; using Content.Shared.Interaction; -using Robust.Shared.Containers; +using Content.Shared.Inventory.Events; using Robust.Shared.GameStates; -using Robust.Shared.Map; using Robust.Shared.Serialization; -using Robust.Shared.Timing; -using Robust.Shared.Utility; -using System.Linq; namespace Content.Shared.SubFloor; public abstract class SharedTrayScannerSystem : EntitySystem { [Dependency] private readonly SharedAppearanceSystem _appearance = default!; + [Dependency] private readonly SharedEyeSystem _eye = default!; public const float SubfloorRevealAlpha = 0.8f; @@ -22,6 +21,50 @@ public abstract class SharedTrayScannerSystem : EntitySystem SubscribeLocalEvent(OnTrayScannerGetState); SubscribeLocalEvent(OnTrayScannerHandleState); SubscribeLocalEvent(OnTrayScannerActivate); + + SubscribeLocalEvent(OnTrayHandEquipped); + SubscribeLocalEvent(OnTrayHandUnequipped); + SubscribeLocalEvent(OnTrayEquipped); + SubscribeLocalEvent(OnTrayUnequipped); + + SubscribeLocalEvent(OnUserGetVis); + } + + private void OnUserGetVis(Entity ent, ref GetVisMaskEvent args) + { + args.VisibilityMask |= (int)VisibilityFlags.Subfloor; + } + + private void OnEquip(EntityUid user) + { + EnsureComp(user); + _eye.RefreshVisibilityMask(user); + } + + private void OnUnequip(EntityUid user) + { + RemComp(user); + _eye.RefreshVisibilityMask(user); + } + + private void OnTrayHandUnequipped(Entity ent, ref GotUnequippedHandEvent args) + { + OnUnequip(args.User); + } + + private void OnTrayHandEquipped(Entity ent, ref GotEquippedHandEvent args) + { + OnEquip(args.User); + } + + private void OnTrayUnequipped(Entity ent, ref GotUnequippedEvent args) + { + OnUnequip(args.Equipee); + } + + private void OnTrayEquipped(Entity ent, ref GotEquippedEvent args) + { + OnEquip(args.Equipee); } private void OnTrayScannerActivate(EntityUid uid, TrayScannerComponent scanner, ActivateInWorldEvent args) diff --git a/Content.Shared/SubFloor/SubFloorHideComponent.cs b/Content.Shared/SubFloor/SubFloorHideComponent.cs index 3b29388fa8..21cf1f4b03 100644 --- a/Content.Shared/SubFloor/SubFloorHideComponent.cs +++ b/Content.Shared/SubFloor/SubFloorHideComponent.cs @@ -1,6 +1,4 @@ using Robust.Shared.GameStates; -using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; -using Robust.Shared.Serialization.TypeSerializers.Implementations.Generic; namespace Content.Shared.SubFloor { @@ -27,7 +25,7 @@ namespace Content.Shared.SubFloor /// /// Useful for entities like vents, which are only partially hidden. Anchor attempts will still be blocked. /// - [DataField("blockInteractions")] + [DataField] public bool BlockInteractions { get; set; } = true; /// @@ -36,15 +34,15 @@ namespace Content.Shared.SubFloor /// /// Useful for cables and piping, gives maint it's distinct noise. /// - [DataField("blockAmbience")] + [DataField] public bool BlockAmbience { get; set; } = true; /// /// 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")] - public HashSet VisibleLayers = new() { SubfloorLayers.FirstLayer }; + [DataField] + public HashSet VisibleLayers = new(); /// /// This is used for storing the original draw depth of a t-ray revealed entity. diff --git a/Content.Shared/SubFloor/TrayScannerComponent.cs b/Content.Shared/SubFloor/TrayScannerComponent.cs index acde11ff50..52c950e108 100644 --- a/Content.Shared/SubFloor/TrayScannerComponent.cs +++ b/Content.Shared/SubFloor/TrayScannerComponent.cs @@ -9,12 +9,13 @@ public sealed partial class TrayScannerComponent : Component /// /// Whether the scanner is currently on. /// - [ViewVariables, DataField("enabled")] public bool Enabled; + [DataField] + public bool Enabled; /// /// Radius in which the scanner will reveal entities. Centered on the . /// - [ViewVariables(VVAccess.ReadWrite), DataField("range")] + [DataField] public float Range = 4f; } diff --git a/Content.Shared/SubFloor/TrayScannerUserComponent.cs b/Content.Shared/SubFloor/TrayScannerUserComponent.cs new file mode 100644 index 0000000000..f97046c03a --- /dev/null +++ b/Content.Shared/SubFloor/TrayScannerUserComponent.cs @@ -0,0 +1,8 @@ +namespace Content.Shared.SubFloor; + +// Don't need to network +/// +/// Added to anyone using to handle the vismask changes. +/// +[RegisterComponent] +public sealed partial class TrayScannerUserComponent : Component; diff --git a/Resources/Prototypes/Entities/Objects/Devices/station_beacon.yml b/Resources/Prototypes/Entities/Objects/Devices/station_beacon.yml index 4e6650aaaa..3d5b78397e 100644 --- a/Resources/Prototypes/Entities/Objects/Devices/station_beacon.yml +++ b/Resources/Prototypes/Entities/Objects/Devices/station_beacon.yml @@ -34,6 +34,8 @@ type: NavMapBeaconBoundUserInterface - type: Item size: Small + - type: Visibility + layer: 1 - type: SubFloorHide - type: Anchorable - type: Construction diff --git a/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/binary.yml b/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/binary.yml index 99fb34bd9a..71c0da2736 100644 --- a/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/binary.yml +++ b/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/binary.yml @@ -39,6 +39,9 @@ - type: Rotatable - type: Transform noRot: false + - type: SubFloorHide + visibleLayers: + - enum.SubfloorLayers.FirstLayer - type: Sprite sprite: Structures/Piping/Atmospherics/pump.rsi layers: @@ -95,6 +98,9 @@ - type: Rotatable - type: Transform noRot: false + - type: SubFloorHide + visibleLayers: + - enum.SubfloorLayers.FirstLayer - type: Sprite sprite: Structures/Piping/Atmospherics/pump.rsi layers: @@ -149,6 +155,9 @@ placement: mode: SnapgridCenter components: + - type: SubFloorHide + visibleLayers: + - enum.SubfloorLayers.FirstLayer - type: Sprite sprite: Structures/Piping/Atmospherics/pump.rsi layers: @@ -184,6 +193,9 @@ mode: SnapgridCenter components: # TODO ATMOS: Give unique sprite. + - type: SubFloorHide + visibleLayers: + - enum.SubfloorLayers.FirstLayer - type: Sprite sprite: Structures/Piping/Atmospherics/pump.rsi layers: @@ -237,6 +249,9 @@ mode: SnapgridCenter components: - type: StationAiWhitelist + - type: SubFloorHide + visibleLayers: + - enum.SubfloorLayers.FirstLayer - type: Sprite sprite: Structures/Piping/Atmospherics/pump.rsi layers: @@ -300,6 +315,9 @@ placement: mode: SnapgridCenter components: + - type: SubFloorHide + visibleLayers: + - enum.SubfloorLayers.FirstLayer - type: Sprite sprite: Structures/Piping/Atmospherics/gascanisterport.rsi layers: @@ -334,6 +352,9 @@ placement: mode: SnapgridCenter components: + - type: SubFloorHide + visibleLayers: + - enum.SubfloorLayers.FirstLayer - type: Sprite drawdepth: FloorObjects sprite: Structures/Piping/Atmospherics/vent.rsi @@ -501,6 +522,9 @@ id: HeatExchangerBend suffix: Bend components: + - type: SubFloorHide + visibleLayers: + - enum.SubfloorLayers.FirstLayer - type: Sprite layers: - sprite: Structures/Piping/Atmospherics/pipe.rsi diff --git a/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/pipes.yml b/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/pipes.yml index a6c322189b..92d0006841 100644 --- a/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/pipes.yml +++ b/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/pipes.yml @@ -7,6 +7,8 @@ placement: mode: SnapgridCenter components: + - type: Visibility + layer: 1 - type: Item size: Normal - type: Transform diff --git a/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/trinary.yml b/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/trinary.yml index 06656d0177..c44f700e7f 100644 --- a/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/trinary.yml +++ b/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/trinary.yml @@ -35,6 +35,9 @@ placement: mode: SnapgridCenter components: + - type: SubFloorHide + visibleLayers: + - enum.SubfloorLayers.FirstLayer - type: Sprite sprite: Structures/Piping/Atmospherics/gasfilter.rsi layers: @@ -84,6 +87,9 @@ placement: mode: SnapgridCenter components: + - type: SubFloorHide + visibleLayers: + - enum.SubfloorLayers.FirstLayer - type: Sprite sprite: Structures/Piping/Atmospherics/gasfilter.rsi layers: diff --git a/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/unary.yml b/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/unary.yml index 1b738dedfd..abb0ead4a0 100644 --- a/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/unary.yml +++ b/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/unary.yml @@ -36,6 +36,9 @@ tags: - GasVent - Unstackable + - type: SubFloorHide + visibleLayers: + - enum.SubfloorLayers.FirstLayer - type: Sprite drawdepth: FloorObjects sprite: Structures/Piping/Atmospherics/vent.rsi @@ -83,6 +86,9 @@ placement: mode: SnapgridCenter components: + - type: SubFloorHide + visibleLayers: + - enum.SubfloorLayers.FirstLayer - type: Sprite drawdepth: FloorObjects sprite: Structures/Piping/Atmospherics/vent.rsi @@ -120,6 +126,9 @@ tags: - GasScrubber - Unstackable + - type: SubFloorHide + visibleLayers: + - enum.SubfloorLayers.FirstLayer - type: Sprite drawdepth: FloorObjects sprite: Structures/Piping/Atmospherics/scrubber.rsi diff --git a/Resources/Prototypes/Entities/Structures/Piping/Disposal/pipes.yml b/Resources/Prototypes/Entities/Structures/Piping/Disposal/pipes.yml index fca28e99a6..d6d5454384 100644 --- a/Resources/Prototypes/Entities/Structures/Piping/Disposal/pipes.yml +++ b/Resources/Prototypes/Entities/Structures/Piping/Disposal/pipes.yml @@ -13,6 +13,8 @@ sprite: Structures/Piping/disposal.rsi visible: false - type: Appearance + - type: Visibility + layer: 1 - type: SubFloorHide - type: Clickable - type: InteractionOutline diff --git a/Resources/Prototypes/Entities/Structures/Power/cable_terminal.yml b/Resources/Prototypes/Entities/Structures/Power/cable_terminal.yml index cc6abce25e..fc0ec95d4d 100644 --- a/Resources/Prototypes/Entities/Structures/Power/cable_terminal.yml +++ b/Resources/Prototypes/Entities/Structures/Power/cable_terminal.yml @@ -29,6 +29,8 @@ behaviors: - !type:DoActsBehavior acts: ["Destruction"] + - type: Visibility + layer: 1 - type: SubFloorHide blockAmbience: false blockInteractions: false @@ -52,4 +54,4 @@ suffix: uncuttable components: - type: Cable - cuttingQuality: null \ No newline at end of file + cuttingQuality: null diff --git a/Resources/Prototypes/Entities/Structures/Power/cables.yml b/Resources/Prototypes/Entities/Structures/Power/cables.yml index f1ae038bc1..6cb9e3d138 100644 --- a/Resources/Prototypes/Entities/Structures/Power/cables.yml +++ b/Resources/Prototypes/Entities/Structures/Power/cables.yml @@ -4,6 +4,8 @@ placement: mode: SnapgridCenter components: + - type: Visibility + layer: 1 - type: Cable cuttingDelay: 1 - type: Clickable