1
0
Fork 0
mirror of https://github.com/Acamaeda/The-Modding-Tree.git synced 2025-05-05 07:41:04 +00:00

SheNaNigans

This commit is contained in:
Harley White 2021-06-07 17:54:29 -04:00
parent dde4c00276
commit f67e18b4bf
3 changed files with 6 additions and 4 deletions

View file

@ -396,7 +396,7 @@ function hardReset(resetOptions) {
if (!confirm("Are you sure you want to do this? You will lose all your progress!")) return
player = null
if(resetOptions) options = null
save();
save(true);
window.location.reload();
}

View file

@ -1,7 +1,7 @@
// ************ Save stuff ************
function save() {
function save(force) {
NaNcheck(player)
if (NaNalert) return
if (NaNalert && !force) return
localStorage.setItem(modInfo.id, btoa(unescape(encodeURIComponent(JSON.stringify(player)))));
localStorage.setItem(modInfo.id+"_options", btoa(unescape(encodeURIComponent(JSON.stringify(options)))));
@ -257,7 +257,7 @@ function NaNcheck(data) {
}
}
function exportSave() {
if (NaNalert) return
//if (NaNalert) return
let str = btoa(JSON.stringify(player));
const el = document.createElement("textarea");
@ -279,6 +279,7 @@ function importSave(imported = undefined, forced = false) {
player.versionType = modInfo.id;
fixSave();
versionCheck();
NaNcheck(save)
save();
window.location.reload();
} catch (e) {