From 1bf591a5735068d1853be13c5a4255962835d5fe Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Tue, 5 Sep 2017 20:10:16 +0100 Subject: Support for saving games in Javascript puzzles. This is done by getting midend_serialise to produce the complete saved-game file as an in-memory string buffer, and then encoding that into a data: URI which we provide to the user as a hyperlink in a dialog box. The hyperlink has the 'download' attribute, which means clicking on it should automatically offer to save the file, and also lets me specify a not-too-silly default file name. --- emccx.json | 3 +++ 1 file changed, 3 insertions(+) (limited to 'emccx.json') diff --git a/emccx.json b/emccx.json index e03f7e2..25d08fe 100644 --- a/emccx.json +++ b/emccx.json @@ -18,6 +18,9 @@ '_timer_callback', // Callback from button presses in the UI outside the canvas '_command', + // Game-saving functions + '_get_save_file', + '_free_save_file', // Callbacks to return values from dialog boxes '_dlg_return_sval', '_dlg_return_ival', -- cgit v1.1