Skip to content

Commit 561b583

Browse files
committed
Update dev documentation
1 parent 7cd465c commit 561b583

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,15 @@ This mod comes included with several built-in commands. Use the `listcommands` a
2929
## Developers
3030

3131
Developers can add their own commands to the terminal. Note that if you don't need parameters, it's usually better to use a DebugMod keybind.
32-
To add a command, simply call `CommandTable.RegisterCommand`. This mod uses its own API; there are several usage examples [here](https://github.com/BadMagic100/ModTerminal/blob/4b7dcbacc9553b3b5549f66e1fcbe0bdbbb02f57/ModTerminal/ModTerminal.cs#L50-L60).
32+
To add a command, simply call `CommandTable.RegisterCommand`. You may also use `CommandTable.RegisterGroup` to create groups of commands.
33+
This mod uses its own API; there are several usage examples [here](https://github.com/BadMagic100/ModTerminal/blob/master/ModTerminal/ModTerminal.cs).
3334

3435
You can add documentation to your command by using the `[HelpDocumentation]` attribute. This attribute can be applied to both methods and parameters.
35-
Documentation about the name and type of parameters is inferred automatically; any provided documentation serves only as additional description.
36+
Documentation about the name and type of parameters is inferred automatically; any provided documentation serves only as additional description.
37+
38+
You can convert non-standard parameters using the `[ParameterConverter]` attribute. This attribute is applied to parameters to control how values
39+
are converted.
40+
41+
Command methods can take a Command instance as their first parameter to access metadata about themselves and their current execution.
42+
This is particularly pertinent for long-running commands, which may use `AsyncCommand` in tandem with the command's execution context
43+
to report progress and completion without blocking the UI thread and freezing the game.

0 commit comments

Comments
 (0)