From: Kyle Tyo <36606155+VerinSenpai@users.noreply.github.com> Date: Thu, 26 Jun 2025 13:00:44 +0000 (-0400) Subject: Hide mechanism and show mechanism commands to LEC (#38587) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=4af6c8461fa55e368821bfbfb2198d4bc92e388f;p=space-station-14.git Hide mechanism and show mechanism commands to LEC (#38587) commit --- diff --git a/Content.Client/Commands/HideMechanismsCommand.cs b/Content.Client/Commands/HideMechanismsCommand.cs index db68a56257..00e024a72c 100644 --- a/Content.Client/Commands/HideMechanismsCommand.cs +++ b/Content.Client/Commands/HideMechanismsCommand.cs @@ -5,32 +5,27 @@ using Robust.Shared.Containers; namespace Content.Client.Commands; -public sealed class HideMechanismsCommand : LocalizedCommands +public sealed class HideMechanismsCommand : LocalizedEntityCommands { - [Dependency] private readonly IEntityManager _entityManager = default!; + [Dependency] private readonly SharedContainerSystem _containerSystem = default!; + [Dependency] private readonly SpriteSystem _spriteSystem = default!; public override string Command => "hidemechanisms"; - public override string Description => LocalizationManager.GetString($"cmd-{Command}-desc", ("showMechanismsCommand", ShowMechanismsCommand.CommandName)); - - public override string Help => LocalizationManager.GetString($"cmd-{Command}-help", ("command", Command)); - public override void Execute(IConsoleShell shell, string argStr, string[] args) { - var containerSys = _entityManager.System(); - var spriteSys = _entityManager.System(); - var query = _entityManager.AllEntityQueryEnumerator(); + var query = EntityManager.AllEntityQueryEnumerator(); while (query.MoveNext(out var uid, out _, out var sprite)) { - spriteSys.SetContainerOccluded((uid, sprite), false); + _spriteSystem.SetContainerOccluded((uid, sprite), false); var tempParent = uid; - while (containerSys.TryGetContainingContainer((tempParent, null, null), out var container)) + while (_containerSystem.TryGetContainingContainer((tempParent, null, null), out var container)) { if (!container.ShowContents) { - spriteSys.SetContainerOccluded((uid, sprite), true); + _spriteSystem.SetContainerOccluded((uid, sprite), true); break; } diff --git a/Content.Client/Commands/ShowMechanismsCommand.cs b/Content.Client/Commands/ShowMechanismsCommand.cs index 19305b207c..091fe05f89 100644 --- a/Content.Client/Commands/ShowMechanismsCommand.cs +++ b/Content.Client/Commands/ShowMechanismsCommand.cs @@ -4,24 +4,19 @@ using Robust.Shared.Console; namespace Content.Client.Commands; -public sealed class ShowMechanismsCommand : LocalizedCommands +public sealed class ShowMechanismsCommand : LocalizedEntityCommands { - [Dependency] private readonly IEntityManager _entManager = default!; + [Dependency] private readonly SpriteSystem _spriteSystem = default!; - public const string CommandName = "showmechanisms"; - - public override string Command => CommandName; - - public override string Help => LocalizationManager.GetString($"cmd-{Command}-help", ("command", Command)); + public override string Command => "showmechanisms"; public override void Execute(IConsoleShell shell, string argStr, string[] args) { - var spriteSys = _entManager.System(); - var query = _entManager.AllEntityQueryEnumerator(); + var query = EntityManager.AllEntityQueryEnumerator(); while (query.MoveNext(out var uid, out _, out var sprite)) { - spriteSys.SetContainerOccluded((uid, sprite), false); + _spriteSystem.SetContainerOccluded((uid, sprite), false); } } } diff --git a/Resources/Locale/en-US/commands/hide-mechanisms-command.ftl b/Resources/Locale/en-US/commands/hide-mechanisms-command.ftl index 75c9cbc815..db15e90aa4 100644 --- a/Resources/Locale/en-US/commands/hide-mechanisms-command.ftl +++ b/Resources/Locale/en-US/commands/hide-mechanisms-command.ftl @@ -1,2 +1,2 @@ -cmd-hidemechanisms-desc = Reverts the effects of {$showMechanismsCommand} -cmd-hidemechanisms-help = Usage: {$command} \ No newline at end of file +cmd-hidemechanisms-desc = Reverts the effects of showmechanisms command. +cmd-hidemechanisms-help = Usage: hidemechanisms diff --git a/Resources/Locale/en-US/commands/show-mechanisms-command.ftl b/Resources/Locale/en-US/commands/show-mechanisms-command.ftl index 0512381b63..0415482e8e 100644 --- a/Resources/Locale/en-US/commands/show-mechanisms-command.ftl +++ b/Resources/Locale/en-US/commands/show-mechanisms-command.ftl @@ -1,2 +1,2 @@ cmd-showmechanisms-desc = Makes mechanisms visible, even when they shouldn't be. -cmd-showmechanisms-help = Usage: {$command} \ No newline at end of file +cmd-showmechanisms-help = Usage: showmechanisms