From 2958706e0453b08ae1882788e24f6020827c873b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Schr=C3=B6dinger?= <132720404+Schrodinger71@users.noreply.github.com> Date: Tue, 25 Feb 2025 00:29:05 +0300 Subject: [PATCH] [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 --- .../Administration/Commands/SetMindCommand.cs | 10 ++++++++++ .../en-US/administration/commands/set-mind-command.ftl | 1 + 2 files changed, 11 insertions(+) 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 -- 2.51.2