fix: 优化自动存档时机

This commit is contained in:
unanmed 2024-11-06 15:06:43 +08:00
parent 92ed1c2d4a
commit 283df5fca6
2 changed files with 10 additions and 3 deletions

View File

@ -186,9 +186,9 @@ control.prototype._animationFrame_totalTime = function (timestamp) {
};
control.prototype._animationFrame_autoSave = function (timestamp) {
if (timestamp - core.saves.autosave.time <= 5000) return;
core.control.checkAutosave();
core.saves.autosave.time = timestamp;
// if (timestamp - core.saves.autosave.time <= 5000) return;
// core.control.checkAutosave();
// core.saves.autosave.time = timestamp;
};
control.prototype._animationFrame_globalAnimate = function (timestamp) {

View File

@ -52,3 +52,10 @@ loading.once('coreInit', () => {
});
registerPresetState();
window.addEventListener('beforeunload', () => {
core.checkAutosave();
});
hook.on('restart', () => {
core.checkAutosave();
});