feature:F1 Help and Aliases for ChatCommands #50
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added two new arguments to IChatCommand, Aliases and Arguments.
Aliases are so the command can be triggered by multiple different strings but still stay as a single registered command.
Arguments are purely for documentation, they don't affect the Handle of the command at all, but will appear in the help menu.
Also moved all of the "/help" display from the chatbox to the F1 commands menu. New pages will be added as new commands are registered. Pages can be cycled by using the spacebar when the menu is active.
Finally, added LocalChatCommandGroup, a class that can be used to keep relevant commands together (i.e. with the same prefix, but additional subcommands.
Example Command Group:
"/dummy"
"/dummy action1"
"/dummy actioin2"
These subcommands can be registered to the group so the Handle of the Group goes through each subcommand to execute its own handle.
URGENT NOTE: Because the Aliases and Arguments are optional parameters, but optional parameters are resolved on the calling side, mods using RegisterLocalChatCommand will need to be updated to work. Also any mods (such as GTR) that inherit from the chat command interfaces will need to be updated to implement the Aliases and Arguments getter function. There may be a more clever way to get around breaking mods in this way, but I didn't know how.
Let me know if you need me to make updates before merging this feature in, or feel free to just use it as a baseline and make it how you want.
Cheers,
agix