]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
[ADMIN minor update] Add Autocompletion for Player Usernames in SetMind Command ...
authorSchrödinger <132720404+Schrodinger71@users.noreply.github.com>
Mon, 24 Feb 2025 21:29:05 +0000 (00:29 +0300)
committerGitHub <noreply@github.com>
Mon, 24 Feb 2025 21:29:05 +0000 (22:29 +0100)
* add(src): Add getCompletion player for setmind command

* tweak(src): Fulfilling review requirements. used CompletionHelper.SessionNames()

* tweak(loc): Add localization

* fix(srs): smail

Content.Server/Administration/Commands/SetMindCommand.cs
Resources/Locale/en-US/administration/commands/set-mind-command.ftl

index a7b6849423e01b512d85ed5022bfcd0536562050..423c30ae37fe20d9333cfa0f5e8fad83849c1357 100644 (file)
@@ -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;
+        }
     }
 }
index 7ec910e4aedc3a29adcf9ec9591ca236993cdc47..1039b9f1f7c802a7e2a9714ee82901455441e02a 100644 (file)
@@ -2,3 +2,4 @@ set-mind-command-description = Transfers a mind to the specified entity. The ent
 set-mind-command-help-text = Usage: {$command} <entityUid> <username> [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