Unity-DeveloperConsole icon indicating copy to clipboard operation
Unity-DeveloperConsole copied to clipboard

Feature Request: parameter autocompletion

Open juzdepeche opened this issue 2 years ago • 1 comments

Would be helpful and nice to have a command parameter autocompletion (like the command autocomplete). A way to use it could be to pass a list of values like in the example below.

Usage:

        private static void ConfigureGiveCollectibleCommand()
        {
            DevConsole.AddCommand(Command.Create(
                name: "collectible_give",
                aliases: "",
                helpText: "Gives collectibles to the player",
                p1: Parameter.Create(
                    name: "collectible type",
                    helpText: "The collectible type to give to the player"
--->             autocompletion: new List<CollectibleType>() { CollectibleType.Life, CollectibleType.Ammo, CollectibleType.Mana }
                ),
                p2: Parameter.Create(
                    name: "amount",
                    helpText: "The amount you want to give to the player"
                ),
                callback: (CollectibleType type, int amount) => GiveCollectible(type, amount)
            ));
        }

juzdepeche avatar Aug 25 '22 18:08 juzdepeche