mirror of
https://github.com/Cola-Echo/memory-manager-concurrent.git
synced 2026-06-14 19:55:51 +00:00
feat: 支持 Lore-char 命名的总结世界书识别
- isSummaryBook 函数新增对 Lore-char/lore-char 的检测 - 修复启用记忆搜索助手时进度条重复显示总结世界书任务的问题 - 更新错误提示信息,说明支持的命名规则 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
50
games/mario/src/local-storage.js
Normal file
50
games/mario/src/local-storage.js
Normal file
@@ -0,0 +1,50 @@
|
||||
(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);
|
||||
Reference in New Issue
Block a user