]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Command resolve killing, LEC conversions, and general cleanup. (#38338)
authorKyle Tyo <36606155+VerinSenpai@users.noreply.github.com>
Tue, 17 Jun 2025 18:08:12 +0000 (14:08 -0400)
committerGitHub <noreply@github.com>
Tue, 17 Jun 2025 18:08:12 +0000 (20:08 +0200)
* i'm just gonna put this here.

* I'm just gonna do it.

* Update ShowHTNCommand.cs

* I feel dumb.

* may as well with this too.

* this does in fact not work

* :/

20 files changed:
Content.Client/Audio/AmbientOverlayCommand.cs
Content.Client/Changelog/ChangelogWindow.xaml.cs
Content.Client/Decals/ToggleDecalCommand.cs
Content.Client/Ghost/Commands/ToggleGhostVisibilityCommand.cs
Content.Client/Ghost/GhostToggleSelfVisibility.cs
Content.Client/NPC/ShowHTNCommand.cs
Content.Client/NetworkConfigurator/Systems/NetworkConfiguratorSystem.cs
Content.Client/NodeContainer/NodeVisCommand.cs
Content.Client/Voting/UI/VoteCallMenu.xaml.cs
Content.Client/Weapons/Ranged/Commands/ShowSpreadCommand.cs
Resources/Locale/en-US/changelog/changelog-window.ftl
Resources/Locale/en-US/commands/ghost-visibility-commands.ftl [new file with mode: 0644]
Resources/Locale/en-US/commands/node-vis-commands.ftl [new file with mode: 0644]
Resources/Locale/en-US/commands/show-ambient-command.ftl [new file with mode: 0644]
Resources/Locale/en-US/commands/show-gun-spread-command.ftl [new file with mode: 0644]
Resources/Locale/en-US/commands/show-htn-command.ftl [new file with mode: 0644]
Resources/Locale/en-US/commands/toggle-decals-command.ftl [new file with mode: 0644]
Resources/Locale/en-US/devices/network-configurator.ftl
Resources/Locale/en-US/shell.ftl
Resources/Locale/en-US/voting/ui/vote-call-menu.ftl

index 909353cd24bbf745f1afcb942d9bcc465870717d..7bbc6c6cbfec63d81fc48c301e79caac28345c99 100644 (file)
@@ -2,16 +2,16 @@ using Robust.Shared.Console;
 
 namespace Content.Client.Audio;
 
-public sealed class AmbientOverlayCommand : IConsoleCommand
+public sealed class AmbientOverlayCommand : LocalizedEntityCommands
 {
-    public string Command => "showambient";
-    public string Description => "Shows all AmbientSoundComponents in the viewport";
-    public string Help => $"{Command}";
-    public void Execute(IConsoleShell shell, string argStr, string[] args)
+    [Dependency] private readonly AmbientSoundSystem _ambient = default!;
+
+    public override string Command => "showambient";
+
+    public override void Execute(IConsoleShell shell, string argStr, string[] args)
     {
-        var system = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<AmbientSoundSystem>();
-        system.OverlayEnabled ^= true;
+        _ambient.OverlayEnabled ^= true;
 
-        shell.WriteLine($"Ambient sound overlay set to {system.OverlayEnabled}");
+        shell.WriteLine(Loc.GetString($"cmd-showambient-status", ("status", _ambient.OverlayEnabled)));
     }
 }
index f46ffa7b918089f5e6fea8c0dd1824e89edc0342..d82c34254c5143dd51b7a1abef86fcb36628dcc1 100644 (file)
@@ -15,8 +15,8 @@ namespace Content.Client.Changelog
     [GenerateTypedNameReferences]
     public sealed partial class ChangelogWindow : FancyWindow
     {
-        [Dependency] private readonly ChangelogManager _changelog = default!;
         [Dependency] private readonly IClientAdminManager _adminManager = default!;
+        [Dependency] private readonly ChangelogManager _changelog = default!;
 
         public ChangelogWindow()
         {
@@ -112,15 +112,15 @@ namespace Content.Client.Changelog
     }
 
     [UsedImplicitly, AnyCommand]
-    public sealed class ChangelogCommand : IConsoleCommand
+    public sealed class ChangelogCommand : LocalizedCommands
     {
-        public string Command => "changelog";
-        public string Description => "Opens the changelog";
-        public string Help => "Usage: changelog";
+        [Dependency] private readonly IUserInterfaceManager _uiManager = default!;
+
+        public override string Command => "changelog";
 
-        public void Execute(IConsoleShell shell, string argStr, string[] args)
+        public override void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            IoCManager.Resolve<IUserInterfaceManager>().GetUIController<ChangelogUIController>().OpenWindow();
+            _uiManager.GetUIController<ChangelogUIController>().OpenWindow();
         }
     }
 }
index 025ed1299d1f05645dfcb7e8cbff3b364fa1ae64..cf7113cb5035b986b7b1ba6aa6539cf8651834fd 100644 (file)
@@ -1,17 +1,15 @@
 using Robust.Shared.Console;
-using Robust.Shared.GameObjects;
 
 namespace Content.Client.Decals;
 
-public sealed class ToggleDecalCommand : IConsoleCommand
+public sealed class ToggleDecalCommand : LocalizedEntityCommands
 {
-    [Dependency] private readonly IEntityManager _e = default!;
+    [Dependency] private readonly DecalSystem _decal = default!;
 
-    public string Command => "toggledecals";
-    public string Description => "Toggles decaloverlay";
-    public string Help => $"{Command}";
-    public void Execute(IConsoleShell shell, string argStr, string[] args)
+    public override string Command => "toggledecals";
+
+    public override void Execute(IConsoleShell shell, string argStr, string[] args)
     {
-        _e.System<DecalSystem>().ToggleOverlay();
+        _decal.ToggleOverlay();
     }
 }
index 480da6ad8d9b537d8570635cf8905e0e70f09991..3dacc81f219cdaf05d82ad46add61247bd6650d2 100644 (file)
@@ -2,25 +2,17 @@
 
 namespace Content.Client.Ghost.Commands;
 
-public sealed class ToggleGhostVisibilityCommand : IConsoleCommand
+public sealed class ToggleGhostVisibilityCommand : LocalizedEntityCommands
 {
-    [Dependency] private readonly IEntitySystemManager _entSysMan = default!;
+    [Dependency] private readonly GhostSystem _ghost = default!;
 
-    public string Command => "toggleghostvisibility";
-    public string Description => "Toggles ghost visibility on the client.";
-    public string Help => "toggleghostvisibility [bool]";
+    public override string Command => "toggleghostvisibility";
 
-    public void Execute(IConsoleShell shell, string argStr, string[] args)
+    public override void Execute(IConsoleShell shell, string argStr, string[] args)
     {
-        var ghostSystem = _entSysMan.GetEntitySystem<GhostSystem>();
-
         if (args.Length != 0 && bool.TryParse(args[0], out var visibility))
-        {
-            ghostSystem.ToggleGhostVisibility(visibility);
-        }
+            _ghost.ToggleGhostVisibility(visibility);
         else
-        {
-            ghostSystem.ToggleGhostVisibility();
-        }
+            _ghost.ToggleGhostVisibility();
     }
 }
index bc4531ce92d39e6c84ad56b465b7820b7843ae86..fea9a2fc0d6e9f255de060f8a6c8bce9cef5aed1 100644 (file)
@@ -4,28 +4,27 @@ using Robust.Shared.Console;
 
 namespace Content.Client.Ghost;
 
-public sealed class GhostToggleSelfVisibility : IConsoleCommand
+public sealed class GhostToggleSelfVisibility : LocalizedEntityCommands
 {
-    public string Command => "toggleselfghost";
-    public string Description => "Toggles seeing your own ghost.";
-    public string Help => "toggleselfghost";
-    public void Execute(IConsoleShell shell, string argStr, string[] args)
+    [Dependency] private readonly SpriteSystem _sprite = default!;
+
+    public override string Command => "toggleselfghost";
+
+    public override void Execute(IConsoleShell shell, string argStr, string[] args)
     {
         var attachedEntity = shell.Player?.AttachedEntity;
         if (!attachedEntity.HasValue)
             return;
 
-        var entityManager = IoCManager.Resolve<IEntityManager>();
-        if (!entityManager.HasComponent<GhostComponent>(attachedEntity))
+        if (!EntityManager.HasComponent<GhostComponent>(attachedEntity))
         {
-            shell.WriteError("Entity must be a ghost.");
+            shell.WriteError(Loc.GetString($"cmd-toggleselfghost-must-be-ghost"));
             return;
         }
 
-        if (!entityManager.TryGetComponent(attachedEntity, out SpriteComponent? spriteComponent))
+        if (!EntityManager.TryGetComponent(attachedEntity, out SpriteComponent? spriteComponent))
             return;
 
-        var spriteSys = entityManager.System<SpriteSystem>();
-        spriteSys.SetVisible((attachedEntity.Value, spriteComponent), !spriteComponent.Visible);
+        _sprite.SetVisible((attachedEntity.Value, spriteComponent), !spriteComponent.Visible);
     }
 }
index b6adc0759fa6c70bc647829271e294af98282e67..c1f00270877ea8f6537469c29db5537d69361225 100644 (file)
@@ -3,14 +3,14 @@ using Robust.Shared.Console;
 
 namespace Content.Client.NPC;
 
-public sealed class ShowHTNCommand : IConsoleCommand
+public sealed class ShowHtnCommand : LocalizedEntityCommands
 {
-    public string Command => "showhtn";
-    public string Description => "Shows the current status for HTN NPCs";
-    public string Help => $"{Command}";
-    public void Execute(IConsoleShell shell, string argStr, string[] args)
+    [Dependency] private readonly HTNSystem _htnSystem = default!;
+
+    public override string Command => "showhtn";
+
+    public override void Execute(IConsoleShell shell, string argStr, string[] args)
     {
-        var npcs = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<HTNSystem>();
-        npcs.EnableOverlay ^= true;
+        _htnSystem.EnableOverlay ^= true;
     }
 }
index 2d561ba5f21c9679cd80af0cd23fc4207ddc4fec..8f519e61ac1c6dfb26f0eea1d6d52041687a03b5 100644 (file)
@@ -137,15 +137,14 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem
     }
 }
 
-public sealed class ClearAllNetworkLinkOverlays : IConsoleCommand
+public sealed class ClearAllNetworkLinkOverlays : LocalizedEntityCommands
 {
-    [Dependency] private readonly IEntityManager _e = default!;
+    [Dependency] private readonly NetworkConfiguratorSystem _network = default!;
 
-    public string Command => "clearnetworklinkoverlays";
-    public string Description => "Clear all network link overlays.";
-    public string Help => Command;
-    public void Execute(IConsoleShell shell, string argStr, string[] args)
+    public override string Command => "clearnetworklinkoverlays";
+
+    public override void Execute(IConsoleShell shell, string argStr, string[] args)
     {
-        _e.System<NetworkConfiguratorSystem>().ClearAllOverlays();
+        _network.ClearAllOverlays();
     }
 }
index 249c0d942721a7a9605dcc8bcbb4f6deefef9d89..e5f0f8f5fabef64e543346b46f2f8e2e9e27a651 100644 (file)
@@ -1,48 +1,39 @@
 using Content.Client.Administration.Managers;
 using Content.Shared.Administration;
 using Robust.Shared.Console;
-using Robust.Shared.GameObjects;
-using Robust.Shared.IoC;
 
 namespace Content.Client.NodeContainer
 {
-    public sealed class NodeVisCommand : IConsoleCommand
+    public sealed class NodeVisCommand : LocalizedEntityCommands
     {
-        [Dependency] private readonly IEntityManager _e = default!;
+        [Dependency] private readonly IClientAdminManager _adminManager = default!;
+        [Dependency] private readonly NodeGroupSystem _nodeSystem = default!;
 
-        public string Command => "nodevis";
-        public string Description => "Toggles node group visualization";
-        public string Help => "";
+        public override string Command => "nodevis";
 
-        public void Execute(IConsoleShell shell, string argStr, string[] args)
+        public override void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            var adminMan = IoCManager.Resolve<IClientAdminManager>();
-            if (!adminMan.HasFlag(AdminFlags.Debug))
+            if (!_adminManager.HasFlag(AdminFlags.Debug))
             {
-                shell.WriteError("You need +DEBUG for this command");
+                shell.WriteError(Loc.GetString($"shell-missing-required-permission", ("perm", "+DEBUG")));
                 return;
             }
 
-            var sys = _e.System<NodeGroupSystem>();
-            sys.SetVisEnabled(!sys.VisEnabled);
+            _nodeSystem.SetVisEnabled(!_nodeSystem.VisEnabled);
         }
     }
 
-    public sealed class NodeVisFilterCommand : IConsoleCommand
+    public sealed class NodeVisFilterCommand : LocalizedEntityCommands
     {
-        [Dependency] private readonly IEntityManager _e = default!;
+        [Dependency] private readonly NodeGroupSystem _nodeSystem = default!;
 
-        public string Command => "nodevisfilter";
-        public string Description => "Toggles showing a specific group on nodevis";
-        public string Help => "Usage: nodevis [filter]\nOmit filter to list currently masked-off";
+        public override string Command => "nodevisfilter";
 
-        public void Execute(IConsoleShell shell, string argStr, string[] args)
+        public override void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            var sys = _e.System<NodeGroupSystem>();
-
             if (args.Length == 0)
             {
-                foreach (var filtered in sys.Filtered)
+                foreach (var filtered in _nodeSystem.Filtered)
                 {
                     shell.WriteLine(filtered);
                 }
@@ -50,10 +41,8 @@ namespace Content.Client.NodeContainer
             else
             {
                 var filter = args[0];
-                if (!sys.Filtered.Add(filter))
-                {
-                    sys.Filtered.Remove(filter);
-                }
+                if (!_nodeSystem.Filtered.Add(filter))
+                    _nodeSystem.Filtered.Remove(filter);
             }
         }
     }
index b9dd11f7a78fc4504a5966acab5a86aa73a8a595..7cb2b37085af07c87e51fe2fbdcb7400dbd14267 100644 (file)
@@ -274,13 +274,11 @@ namespace Content.Client.Voting.UI
     }
 
     [UsedImplicitly, AnyCommand]
-    public sealed class VoteMenuCommand : IConsoleCommand
+    public sealed class VoteMenuCommand : LocalizedCommands
     {
-        public string Command => "votemenu";
-        public string Description => Loc.GetString("ui-vote-menu-command-description");
-        public string Help => Loc.GetString("ui-vote-menu-command-help-text");
+        public override string Command => "votemenu";
 
-        public void Execute(IConsoleShell shell, string argStr, string[] args)
+        public override void Execute(IConsoleShell shell, string argStr, string[] args)
         {
             new VoteCallMenu().OpenCentered();
         }
index 861d7d75c60dc34471a2345c86a6e82e4b06043d..42456d232bfbbcbe6416c99694fc7ca9d8ff6a81 100644 (file)
@@ -1,18 +1,18 @@
 using Content.Client.Weapons.Ranged.Systems;
 using Robust.Shared.Console;
 
-namespace Content.Client.Weapons.Ranged;
+namespace Content.Client.Weapons.Ranged.Commands;
 
-public sealed class ShowSpreadCommand : IConsoleCommand
+public sealed class ShowSpreadCommand : LocalizedEntityCommands
 {
-    public string Command => "showgunspread";
-    public string Description => $"Shows gun spread overlay for debugging";
-    public string Help => $"{Command}";
-    public void Execute(IConsoleShell shell, string argStr, string[] args)
+    [Dependency] private readonly GunSystem _gunSystem = default!;
+
+    public override string Command => "showgunspread";
+
+    public override void Execute(IConsoleShell shell, string argStr, string[] args)
     {
-        var system = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<GunSystem>();
-        system.SpreadOverlay ^= true;
+        _gunSystem.SpreadOverlay ^= true;
 
-        shell.WriteLine($"Set spread overlay to {system.SpreadOverlay}");
+        shell.WriteLine(Loc.GetString($"cmd-showgunspread-status", ("status", _gunSystem.SpreadOverlay)));
     }
 }
index 514b2eb1d17b1189a18346f8e4d769349ead58b0..4ee5552282cd48c307b4978f625dd51ae818244d 100644 (file)
@@ -14,3 +14,6 @@ changelog-button-new-entries = Changelog (new!)
 changelog-tab-title-Changelog = Changelog
 changelog-tab-title-Admin = Admin
 changelog-tab-title-Maps = Maps
+
+cmd-changelog-desc = Opens the changelog.
+cmd-changelog-help = Usage: changelog
diff --git a/Resources/Locale/en-US/commands/ghost-visibility-commands.ftl b/Resources/Locale/en-US/commands/ghost-visibility-commands.ftl
new file mode 100644 (file)
index 0000000..a4eaed2
--- /dev/null
@@ -0,0 +1,6 @@
+cmd-toggleghostvisibility-desc = Toggles ghost visibility on the client.
+cmd-toggleghostvisibility-help = Usage: toggleghostvisibility [bool]
+
+cmd-toggleselfghost-desc = Toggles seeing your own ghost.
+cmd-toggleselfghost-help = Usage: toggleselfghost
+cmd-toggleselfghost-must-be-ghost = Entity must be a ghost.
diff --git a/Resources/Locale/en-US/commands/node-vis-commands.ftl b/Resources/Locale/en-US/commands/node-vis-commands.ftl
new file mode 100644 (file)
index 0000000..e921c47
--- /dev/null
@@ -0,0 +1,6 @@
+cmd-nodevis-desc = Toggles node group visualization.
+cmd-nodevis-help = Usage: nodevis
+
+cmd-nodevisfilter-desc = Toggles showing a specific group on nodevis.
+cmd-nodevisfilter-help = Usage: nodevisfilter [filter]
+                         Omit filter to list currently masked-off
diff --git a/Resources/Locale/en-US/commands/show-ambient-command.ftl b/Resources/Locale/en-US/commands/show-ambient-command.ftl
new file mode 100644 (file)
index 0000000..262bbca
--- /dev/null
@@ -0,0 +1,3 @@
+cmd-showambient-desc = Shows all AmbientSoundComponents in the viewport.
+cmd-showambient-help = Usage: showambient
+cmd-showambient-status = Ambient sound overlay set to {$status}.
diff --git a/Resources/Locale/en-US/commands/show-gun-spread-command.ftl b/Resources/Locale/en-US/commands/show-gun-spread-command.ftl
new file mode 100644 (file)
index 0000000..a4a043e
--- /dev/null
@@ -0,0 +1,3 @@
+cmd-showgunspread-desc = Shows gun spread overlay for debugging.
+cmd-showgunspreade-help = Usage: showgunspread
+cmd-showgunspread-status = Set spread overlay to {$status}.
diff --git a/Resources/Locale/en-US/commands/show-htn-command.ftl b/Resources/Locale/en-US/commands/show-htn-command.ftl
new file mode 100644 (file)
index 0000000..6580a41
--- /dev/null
@@ -0,0 +1,2 @@
+cmd-showhtn-desc = Shows the current status for HTN NPCs.
+cmd-showhtn-help = Usage: showhtn
diff --git a/Resources/Locale/en-US/commands/toggle-decals-command.ftl b/Resources/Locale/en-US/commands/toggle-decals-command.ftl
new file mode 100644 (file)
index 0000000..0455704
--- /dev/null
@@ -0,0 +1,2 @@
+cmd-toggledecals-desc = Toggles decal overlay.
+cmd-toggledecals-help = Usage: toggledecals
index cd4955ed3655365c37bb80f928ec3bb020622b6c..8e0724b41e600c7bf390516759442e85cab62d9a 100644 (file)
@@ -43,3 +43,7 @@ network-configurator-examine-switch-modes = Press {$key} to switch modes
 # item status
 network-configurator-item-status-label = Mode: {$mode}
     Switch: {$keybinding}
+
+# command
+cmd-clearnetworklinkoverlays-desc = Clear all network link overlays.
+cmd-clearnetworklinkoverlays-help = Usage: clearnetworklinkoverlays
index 3661c45cb0bb1f91356deb8b0c456e654af25ba8..295eda887949f09be76155a8e38f22fffa17ce18 100644 (file)
@@ -25,6 +25,7 @@ shell-argument-uid = EntityUid
 
 ## Guards
 
+shell-missing-required-permission = You need {$perm} for this command!
 shell-entity-is-not-mob = Target entity is not a mob!
 shell-invalid-entity-id = Invalid entity ID.
 shell-invalid-grid-id = Invalid grid ID.
index 82e3a5d1f82e6af5cd6e37bf7fac53a3aed6da0d..de95b500558bc3483f77320622a3f598cb4aae13 100644 (file)
@@ -38,5 +38,5 @@ ui-vote-fluff = Powered by Robust™ Anti-Tamper Technology
 
 ## Vote menu command
 
-ui-vote-menu-command-description = Opens the voting menu
-ui-vote-menu-command-help-text = Usage: votemenu
+cmd-votemenu-desc = Opens the voting menu.
+cmd-votemenu-help = Usage: votemenu