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

feature:F1 Help and Aliases for ChatCommands #50

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rspotc
Copy link

@rspotc rspotc commented Sep 20, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant