optimize autosave
This commit is contained in:
parent
1d271648d2
commit
f4c200d3fb
@ -1621,9 +1621,12 @@ control.prototype.autosave = function (removeLast) {
|
|||||||
control.prototype.checkAutosave = function () {
|
control.prototype.checkAutosave = function () {
|
||||||
if (!core.animateFrame || !core.saves || !core.saves.autosave) return;
|
if (!core.animateFrame || !core.saves || !core.saves.autosave) return;
|
||||||
core.setLocalStorage('totalTime', core.animateFrame.totalTime);
|
core.setLocalStorage('totalTime', core.animateFrame.totalTime);
|
||||||
if (core.saves.autosave.data == null || !core.saves.autosave.updated) return;
|
var autosave = core.saves.autosave;
|
||||||
core.saves.autosave.updated = false;
|
if (autosave.data == null || !autosave.updated || !autosave.storage) return;
|
||||||
core.setLocalForage("autoSave", core.saves.autosave.data);
|
autosave.updated = false;
|
||||||
|
if (autosave.data.length >= 1) {
|
||||||
|
core.setLocalForage("autoSave", autosave.data[autosave.data.length - 1]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
////// 实际进行存读档事件 //////
|
////// 实际进行存读档事件 //////
|
||||||
|
|||||||
@ -106,6 +106,7 @@ function core() {
|
|||||||
"data": null,
|
"data": null,
|
||||||
"time": 0,
|
"time": 0,
|
||||||
"updated": false,
|
"updated": false,
|
||||||
|
"storage": true, // 是否把自动存档写入文件a
|
||||||
"max": 10, // 自动存档最大回退数
|
"max": 10, // 自动存档最大回退数
|
||||||
},
|
},
|
||||||
"favorite": [],
|
"favorite": [],
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user