From b0059522563bf6d3c6a458aaedf909839f4fc6ba Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Sat, 28 Mar 2020 12:49:27 -0400 Subject: [PATCH] Make loading an autosave a manual action Otherwise, you could load a giant scene, close the browser, and be stuck with it forever! --- macrovision.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/macrovision.js b/macrovision.js index 095f99ed..d15e92c4 100644 --- a/macrovision.js +++ b/macrovision.js @@ -1101,6 +1101,11 @@ function prepareMenu() { name: "Load", id: "menu-load", icon: "fas fa-upload" + }, + { + name: "Load Autosave", + id: "menu-load-autosave", + icon: "fas fa-redo" } ] ].forEach(group => { @@ -1355,11 +1360,7 @@ document.addEventListener("DOMContentLoaded", () => { param = new URL(window.location.href).searchParams.get("scene"); if (param === null) { - if (loadScene("autosave")) { - deleteScene("autosave"); - } else { - scenes["Default"](); - } + scenes["Default"](); } else { @@ -1550,6 +1551,9 @@ document.addEventListener("DOMContentLoaded", () => { loadScene(); }); + document.querySelector("#menu-load-autosave").addEventListener("click", e => { + loadScene("autosave"); + }); clearEntityOptions(); clearViewOptions(); clearAttribution();