Persist console (implements #72)
- Persist console command history and buffer contents between game executions. Makes resuming work easier.
- Also added utility
clear
/clear()
function, to clear the console contents. - Added function
console.clear_lines()
(clear()
was taken). - Is hacked into
eval
's code instead of injecting into the sandbox as a regular function to get a completely empty buffer. A regular function clears the buffer first and then prints the result (nil
).
Please review this Merge Request before merging, I'm making (slowly) bigger changes in the codebase but I'm still not confident I didn't mess anything important :) I tested the console and persistence and it works, and the game seems to be running fine too.