Parcourir la source

Make loading an autosave a manual action

Otherwise, you could load a giant scene, close the browser, and be stuck with
it forever!
tags/v0.1.0
Fen Dweller il y a 6 ans
Parent
révision
b005952256
1 fichiers modifiés avec 9 ajouts et 5 suppressions
  1. +9
    -5
      macrovision.js

+ 9
- 5
macrovision.js Voir le fichier

@@ -1101,6 +1101,11 @@ function prepareMenu() {
name: "Load", name: "Load",
id: "menu-load", id: "menu-load",
icon: "fas fa-upload" icon: "fas fa-upload"
},
{
name: "Load Autosave",
id: "menu-load-autosave",
icon: "fas fa-redo"
} }
] ]
].forEach(group => { ].forEach(group => {
@@ -1355,11 +1360,7 @@ document.addEventListener("DOMContentLoaded", () => {
param = new URL(window.location.href).searchParams.get("scene"); param = new URL(window.location.href).searchParams.get("scene");


if (param === null) { if (param === null) {
if (loadScene("autosave")) {
deleteScene("autosave");
} else {
scenes["Default"]();
}
scenes["Default"]();
} }
else { else {
@@ -1550,6 +1551,9 @@ document.addEventListener("DOMContentLoaded", () => {
loadScene(); loadScene();
}); });


document.querySelector("#menu-load-autosave").addEventListener("click", e => {
loadScene("autosave");
});
clearEntityOptions(); clearEntityOptions();
clearViewOptions(); clearViewOptions();
clearAttribution(); clearAttribution();


Chargement…
Annuler
Enregistrer