Norbyte / ositools

Advanced scripting and mod support for Divinity Original Sin 2
MIT License
373 stars 30 forks source link

Add console clear command and "clear on reset" setting #127

Closed PinewoodPip closed 1 year ago

PinewoodPip commented 1 year ago

This PR adds a clear command to the console that clears the console, to remove clutter logging from previous Lua states.

image ^ Console state after clearing. Scrollback is cleared as well.

Additionally, a ClearOnReset setting has been added which clears the console anytime reset, reset client or reset server are manually executed from the console. This clearing happens right before the "Resetting Lua states" message. This setting is off by default - default behaviour is unmodified.

Though it's possible to clear the console from user code, it is unreliable as messages about any scripts loaded before yours will be cleared out, possibly causing the user to miss errors during bootstrap.

The readme has been updated with this setting and the previous one I added (didn't see a need to make a separate PR for that, but feel free to disagree). The help command also mentions the clear command, which will work regardless of the previously mentioned setting.