You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-2Lines changed: 10 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,15 @@ This mod comes included with several built-in commands. Use the `listcommands` a
29
29
## Developers
30
30
31
31
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).
33
34
34
35
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