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
feat: new Run method in ConsoleCommand that gives the Terminal context. Is the default wired in CommandManager but calls the old Run when not overriden.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,6 @@
1
1
# Changelog
2
-
## Version 2.28.1
2
+
## Version 2.29.0
3
+
* Added new method in ConsoleCommand to take a Terminal context parameter, so mods can write output to either Console or Chat depending on where the command was executed from. Backwards compatible. For more info on that see https://valheim-modding.github.io/Jotunn/tutorials/console-commands.html
3
4
* Added TMPro FontAssets shortcuts to the GUIManager
If you need to know from which Terminal your command was executed from, you can also overwrite `Run(string[] args, Terminal context)` from the base class. This will give you the `Terminal` instance, which is either the Console or the Chat of Valheim. Note that you will have to use `context.AddString()` for output on the calling Terminal instead of directly writing to `Console.instance`.
60
+
61
+
```cs
62
+
publicclassEchoCommand : ConsoleCommand
63
+
{
64
+
publicoverridestringName=>"echo";
65
+
66
+
publicoverridestringHelp=>"Echoes all text entered to the console or chat";
0 commit comments