diff --git a/Content.Server/CrewManifest/CrewManifestSystem.cs b/Content.Server/CrewManifest/CrewManifestSystem.cs index 1064379a17..2181625989 100644 --- a/Content.Server/CrewManifest/CrewManifestSystem.cs +++ b/Content.Server/CrewManifest/CrewManifestSystem.cs @@ -1,3 +1,4 @@ +using System.Linq; using Content.Server.Administration; using Content.Server.EUI; using Content.Server.GameTicking; @@ -232,6 +233,13 @@ public sealed class CrewManifestCommand : IConsoleCommand public string Description => "Opens the crew manifest for the given station."; public string Help => $"Usage: {Command} "; + [Dependency] private readonly IEntityManager _entityManager = default!; + + public CrewManifestCommand() + { + IoCManager.InjectDependencies(this); + } + public void Execute(IConsoleShell shell, string argStr, string[] args) { if (args.Length != 1) @@ -240,8 +248,6 @@ public sealed class CrewManifestCommand : IConsoleCommand return; } - var entMan = IoCManager.Resolve(); - if (!EntityUid.TryParse(args[0], out var uid)) { shell.WriteLine($"{args[0]} is not a valid entity UID."); @@ -254,8 +260,28 @@ public sealed class CrewManifestCommand : IConsoleCommand return; } - var crewManifestSystem = entMan.EntitySysManager.GetEntitySystem(); + var crewManifestSystem = _entityManager.System(); crewManifestSystem.OpenEui(uid, session); } + + public CompletionResult GetCompletion(IConsoleShell shell, string[] args) + { + if (args.Length != 1) + { + return CompletionResult.Empty; + } + + var stations = _entityManager + .System() + .Stations + .Select(station => + { + var meta = _entityManager.GetComponent(station); + + return new CompletionOption(station.ToString(), meta.EntityName); + }); + + return CompletionResult.FromHintOptions(stations, null); + } }