[HTML5] Make home path persistent in editor.

We used to only persist specific sub-folder of /home/web_user/ when
running the Web Editor. This resulted in bad UX about default project
creation path etc.
This PR makes the whole folder persistent, move the zip preloading to a
different folder (to avoid persisting it), and automatically prompt the
user to import it if present.
This commit is contained in:
Fabio Alessandrelli 2021-02-03 17:18:28 +01:00
parent 3629617d36
commit 2668ca7a8c
2 changed files with 10 additions and 3 deletions

View file

@ -87,6 +87,13 @@ extern EMSCRIPTEN_KEEPALIVE int godot_js_main(int argc, char *argv[]) {
ResourceLoader::set_abort_on_missing_resources(false);
Main::start();
os->get_main_loop()->init();
#ifdef TOOLS_ENABLED
if (Main::is_project_manager() && FileAccess::exists("/tmp/preload.zip")) {
PoolStringArray ps;
ps.push_back("/tmp/preload.zip");
os->get_main_loop()->emit_signal("files_dropped", ps, -1);
}
#endif
emscripten_set_main_loop(main_loop_callback, -1, false);
// Immediately run the first iteration.
// We are inside an animation frame, we want to immediately draw on the newly setup canvas.