diff --git a/Content.Client/Commands/DebugCommands.cs b/Content.Client/Commands/DebugCommands.cs index 6ffac303f7..8fb0e75bb4 100644 --- a/Content.Client/Commands/DebugCommands.cs +++ b/Content.Client/Commands/DebugCommands.cs @@ -1,3 +1,4 @@ +using Content.Client.GameObjects.EntitySystems; using Content.Client.Interfaces; using Content.Shared.GameObjects.Components.Markers; using Robust.Client.Interfaces.Console; @@ -38,6 +39,24 @@ namespace Content.Client.Commands } } + internal sealed class ShowWiresCommand : IConsoleCommand + { + // ReSharper disable once StringLiteralTypo + public string Command => "showwires"; + public string Description => "Makes wires always visible."; + public string Help => ""; + + public bool Execute(IDebugConsole console, params string[] args) + { + IoCManager.Resolve() + .GetEntitySystem() + .EnableAll ^= true; + + return false; + } + } + + internal sealed class NotifyCommand : IConsoleCommand { public string Command => "notify"; diff --git a/Content.Client/GameObjects/EntitySystems/SubFloorHideSystem.cs b/Content.Client/GameObjects/EntitySystems/SubFloorHideSystem.cs index ebcd847818..0551de45de 100644 --- a/Content.Client/GameObjects/EntitySystems/SubFloorHideSystem.cs +++ b/Content.Client/GameObjects/EntitySystems/SubFloorHideSystem.cs @@ -6,6 +6,7 @@ using Robust.Shared.GameObjects.Systems; using Robust.Shared.Interfaces.Map; using Robust.Shared.IoC; using Robust.Shared.Map; +using Robust.Shared.ViewVariables; namespace Content.Client.GameObjects.EntitySystems { @@ -14,11 +15,37 @@ namespace Content.Client.GameObjects.EntitySystems /// internal sealed class SubFloorHideSystem : EntitySystem { + private bool _enableAll; + #pragma warning disable 649 [Dependency] private readonly IMapManager _mapManager; [Dependency] private readonly ITileDefinitionManager _tileDefinitionManager; #pragma warning restore 649 + [ViewVariables(VVAccess.ReadWrite)] + public bool EnableAll + { + get => _enableAll; + set + { + _enableAll = value; + + UpdateAll(); + } + } + + private void UpdateAll() + { + foreach (var comp in EntityManager.ComponentManager.GetAllComponents()) + { + var gridId = comp.Owner.Transform.GridID; + var grid = _mapManager.GetGrid(gridId); + + var snapPos = comp.Owner.GetComponent(); + UpdateTile(grid, snapPos.Position); + } + } + public override void Initialize() { base.Initialize(); @@ -64,7 +91,7 @@ namespace Content.Client.GameObjects.EntitySystems continue; } - spriteComponent.Visible = !subFloorComponent.Running || tileDef.IsSubFloor; + spriteComponent.Visible = EnableAll || !subFloorComponent.Running || tileDef.IsSubFloor; } } }