mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-01-31 15:09:26 +08:00
fix: 优化自动存档时机
This commit is contained in:
parent
92ed1c2d4a
commit
283df5fca6
@ -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) {
|
||||
|
@ -52,3 +52,10 @@ loading.once('coreInit', () => {
|
||||
});
|
||||
|
||||
registerPresetState();
|
||||
|
||||
window.addEventListener('beforeunload', () => {
|
||||
core.checkAutosave();
|
||||
});
|
||||
hook.on('restart', () => {
|
||||
core.checkAutosave();
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user