mirror of
https://github.com/Acamaeda/The-Modding-Tree.git
synced 2024-11-24 17:31:50 +00:00
SheNaNigans
This commit is contained in:
parent
dde4c00276
commit
f67e18b4bf
3 changed files with 6 additions and 4 deletions
|
@ -5,6 +5,7 @@
|
||||||
- Tree branches can have custom line widths.
|
- Tree branches can have custom line widths.
|
||||||
- If an upgrade has both canAfford and cost, it checks both. (So you can use canAfford for other things)
|
- If an upgrade has both canAfford and cost, it checks both. (So you can use canAfford for other things)
|
||||||
- Releasing a held buyable/clickable with onHold doesn't click it again.
|
- Releasing a held buyable/clickable with onHold doesn't click it again.
|
||||||
|
- Fixed hard resetting while NaN'ed and exporting NaN saves for debugging.
|
||||||
- Attempt to fix buttons sometimes not updating.
|
- Attempt to fix buttons sometimes not updating.
|
||||||
- Improvements to theme code, partially by Cubedey.
|
- Improvements to theme code, partially by Cubedey.
|
||||||
|
|
||||||
|
|
|
@ -396,7 +396,7 @@ function hardReset(resetOptions) {
|
||||||
if (!confirm("Are you sure you want to do this? You will lose all your progress!")) return
|
if (!confirm("Are you sure you want to do this? You will lose all your progress!")) return
|
||||||
player = null
|
player = null
|
||||||
if(resetOptions) options = null
|
if(resetOptions) options = null
|
||||||
save();
|
save(true);
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// ************ Save stuff ************
|
// ************ Save stuff ************
|
||||||
function save() {
|
function save(force) {
|
||||||
NaNcheck(player)
|
NaNcheck(player)
|
||||||
if (NaNalert) return
|
if (NaNalert && !force) return
|
||||||
localStorage.setItem(modInfo.id, btoa(unescape(encodeURIComponent(JSON.stringify(player)))));
|
localStorage.setItem(modInfo.id, btoa(unescape(encodeURIComponent(JSON.stringify(player)))));
|
||||||
localStorage.setItem(modInfo.id+"_options", btoa(unescape(encodeURIComponent(JSON.stringify(options)))));
|
localStorage.setItem(modInfo.id+"_options", btoa(unescape(encodeURIComponent(JSON.stringify(options)))));
|
||||||
|
|
||||||
|
@ -257,7 +257,7 @@ function NaNcheck(data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function exportSave() {
|
function exportSave() {
|
||||||
if (NaNalert) return
|
//if (NaNalert) return
|
||||||
let str = btoa(JSON.stringify(player));
|
let str = btoa(JSON.stringify(player));
|
||||||
|
|
||||||
const el = document.createElement("textarea");
|
const el = document.createElement("textarea");
|
||||||
|
@ -279,6 +279,7 @@ function importSave(imported = undefined, forced = false) {
|
||||||
player.versionType = modInfo.id;
|
player.versionType = modInfo.id;
|
||||||
fixSave();
|
fixSave();
|
||||||
versionCheck();
|
versionCheck();
|
||||||
|
NaNcheck(save)
|
||||||
save();
|
save();
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
Loading…
Reference in a new issue