-
Notifications
You must be signed in to change notification settings - Fork 263
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
Add slash command macro functions #4249
Conversation
I didn't find any references to MtScript2Lexer. Is it already used or was it added accidentally? |
yeah it was something I was working on in another branch when I switched back to implement a few extra things people on discord wanted (those are IDE generated files) no idea why it wasn't cleaned up properly and made it into this PR will make sure its not there when I complete the changes requested and push final PR |
Identify the Bug or Feature request
resolves #1691
Description of the Change
Adds the following macro functions
Set an alias
Returns a JSON Object withe the defined aliases (defined by macro or /alias)
Clears an alias
Add-ons can also define aliases in a file
slash_commands.json
With the following format
This will take care of registering the aliases for you so that you do not need to create any onCampaignLoad macro, it will also separate the commands for your add on in the /alias command listing into their own heading like
Aliases set via macros and add ons have a different "lifetime" to those set using the /alias command.
When set by macro, the aliases are cleared when a new campaign is created, or a campaign is loaded. This is so campaign set aliases will not pollute each other. They are not saved as part of the campaign, so they must be recreated each time if not defined the slash_commands.json file in an add-on.
To maintain functional compatibility, aliases created with /alias command will persist across campaign load/creation and /savealias will not save alises created with
slash.setAlias()
or add-ons.Possible Drawbacks
See the above discussion about differences between aliases set with new macro functions and /alias
Documentation Notes
See above
Release Notes
This change is