SMAPI
SMAPI copied to clipboard
Auto-complete support for the console
(And a bunch of other stuff, included in the ReadLine library. See GitHub page. Only tab completion and history was tested.)
Uses the ReadLine library, with some tweaks I had to do for SMAPI: https://www.nuget.org/packages/spacechase0.ReadLine.SMAPI/2.2.0 Fork: https://github.com/spacechase0/ReadLine (and relevant commit: https://github.com/spacechase0/ReadLine/commit/e5eaa386f55bcd153c36d796150daf96ff6b7973 )
Includes support for commands names themselves (handled by SMAPI) and the help
built-in command, + API for mods to handle auto-completion for their commands.
Mods can pass a new parameter, a function taking a string
representing the current input and returning string[]
representing the list of potential completions. For an example, see SMAPI's help
command (since they function the same).
(I'd normally include a GIF here, but the GIF has some unreleased stuff of mine in it.)
Made the API more consistent, and fixed some things.
Oh yeah. This doesn't include copying the ReadLine assembly into smapi-internal/
. I don't know how to do that.
There seems to be a bug where you can move the cursor to the left, and it will crash the game if it goes left of the left edge. Probably a bug in usage of the library, judging from the stack trace. Will look into it.
I'll close this since it still has some unresolved issues, and we're discussing a different library to tackle this on Discord. Thanks for the PR though!