Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let argument definitions override functions from the type definition #50

Open
evaera opened this issue Oct 29, 2018 · 0 comments
Open
Labels
Projects

Comments

@evaera
Copy link
Owner

evaera commented Oct 29, 2018

...
Args = {
        {
            Type = "players";
            Name = "from";
            Description = "The players to teleport";
            OverrideType = {
                    Autocomplete = function (context, default) -- Accepts the command context, and the default function from the type defintion
                            return function (value) -- Can inspect the context and return either the `default` value or a new function to replace the one in the type definition
                                if context:GetArgument(1):GetValue() == "something" then
                                        return {1, 2, 3}
                                end
                            end
                    end
            }
        },
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Cmdr
  
Features
Development

No branches or pull requests

1 participant