mirror of
https://github.com/Cola-Echo/memory-manager-concurrent.git
synced 2026-06-14 08:15:50 +00:00
- isSummaryBook 函数新增对 Lore-char/lore-char 的检测 - 修复启用记忆搜索助手时进度条重复显示总结世界书任务的问题 - 更新错误提示信息,说明支持的命名规则 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
50 lines
1.2 KiB
JavaScript
50 lines
1.2 KiB
JavaScript
(function() {
|
|
|
|
/**
|
|
*
|
|
* Backbone Game Engine - An elementary HTML5 canvas game engine using Backbone.
|
|
*
|
|
* Copyright (c) 2014 Martin Drapeau
|
|
* https://github.com/martindrapeau/backbone-game-engine
|
|
*
|
|
*/
|
|
|
|
// Load this file to persist in local storage.
|
|
// It will replace Backbone.World's save and fetch methods with
|
|
// naive implementations.
|
|
|
|
Backbone.World.prototype.fetch = function(options) {
|
|
options || (options = {});
|
|
|
|
var data = localStorage.getItem(this.id);
|
|
if (data) {
|
|
console.log("===== LOADING LOCAL STORAGE ====");
|
|
this.set(JSON.parse(data));
|
|
}
|
|
|
|
if (_.isFunction(options.success)) options.success();
|
|
|
|
return this;
|
|
};
|
|
|
|
Backbone.World.prototype.save = function(attributes, options) {
|
|
options || (options = {});
|
|
|
|
|
|
this.set({
|
|
state: "play",
|
|
sprites: this.sprites.map(function(sprite) {
|
|
return sprite.toSave.apply(sprite);
|
|
}),
|
|
savedOn: new Date().toJSON()
|
|
}, {silent: true});
|
|
|
|
console.log("===== SAVING LOCAL STORAGE ====");
|
|
localStorage.setItem(this.id, JSON.stringify(this.toJSON()));
|
|
|
|
if (_.isFunction(options.success)) options.success();
|
|
|
|
return this;
|
|
};
|
|
|
|
}).call(this); |