curiousdannii/ifvms.js

Small autorestore issues

Closed this issue · 2 comments

I've released a version of Lectrote with autorestore, and it's working pretty good. Thanks! And quote boxes look good too.

A couple of autosave corner cases:

  • If you quit the game and then close the window (while the blue "game session has ended" banner is showing), the VM should do a null autosave -- that is, delete the autosave file. Then the next game the game is launched, it will from the beginning. ZVM currently doesn't do this.

(You can see the support for this in glkapi.js, at the end of the update() function. If has_exited is true, it calls do_autosave() with a negative argument, which tells Quixe to call Dialog.autosave_write with a null snapshot argument.)

  • If an autosave occurs inside the Advent.z5 help menu, the autorestore comes back with the output stream set to the wrong window. The effect is that hitting the arrow keys draws the > selection mark in the story window, instead of updating the status window. (But the next time you select a menu option it all gets back on track.)

The zvm.min.js in curiousdannii/lectrote (css branch) fixes the first case, but the second one is still going funny. The > marks now appear in the status window, but they accumulate in the top row instead of being drawn in the correct line as you hit the arrow keys. It looks like the set-cursor-position calls are not working after autorestore?

After fixing this the first time I made a change to the autorestore code which meant that the locals weren't being restored properly. I must have only tested that when line input was active and I think in Inform 6 there weren't any crucial locals in the line input functions. It's fixed now and I've published 1.1.1.