From: Schrödinger <132720404+Schrodinger71@users.noreply.github.com> Date: Mon, 24 Feb 2025 21:29:05 +0000 (+0300) Subject: [ADMIN minor update] Add Autocompletion for Player Usernames in SetMind Command ... X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=2958706e0453b08ae1882788e24f6020827c873b;p=space-station-14.git [ADMIN minor update] Add Autocompletion for Player Usernames in SetMind Command (#35477) * add(src): Add getCompletion player for setmind command * tweak(src): Fulfilling review requirements. used CompletionHelper.SessionNames() * tweak(loc): Add localization * fix(srs): smail --- diff --git a/Content.Server/Administration/Commands/SetMindCommand.cs b/Content.Server/Administration/Commands/SetMindCommand.cs index a7b6849423..423c30ae37 100644 --- a/Content.Server/Administration/Commands/SetMindCommand.cs +++ b/Content.Server/Administration/Commands/SetMindCommand.cs @@ -74,5 +74,15 @@ namespace Content.Server.Administration.Commands mindSystem.TransferTo(mind, eUid, ghostOverride); } + + public CompletionResult GetCompletion(IConsoleShell shell, string[] args) + { + if (args.Length == 2) + { + return CompletionResult.FromHintOptions(CompletionHelper.SessionNames(), Loc.GetString("cmd-mind-command-hint")); + } + + return CompletionResult.Empty; + } } } diff --git a/Resources/Locale/en-US/administration/commands/set-mind-command.ftl b/Resources/Locale/en-US/administration/commands/set-mind-command.ftl index 7ec910e4ae..1039b9f1f7 100644 --- a/Resources/Locale/en-US/administration/commands/set-mind-command.ftl +++ b/Resources/Locale/en-US/administration/commands/set-mind-command.ftl @@ -2,3 +2,4 @@ set-mind-command-description = Transfers a mind to the specified entity. The ent set-mind-command-help-text = Usage: {$command} [unvisit] set-mind-command-target-has-no-content-data-message = Target player does not have content data (wtf?) set-mind-command-target-has-no-mind-message = Target entity does not have a mind (did you forget to make sentient?) +cmd-mind-command-hint = username