本帖最后由 alexncf125 于 2024-9-8 18:25 编辑
以下这三段插入到YEP_SaveCore.js的底部去
Window_SaveInfo.prototype.isJson = function (content) { try { if (typeof JSON.parse(content) === "object") { return true; } } catch (e) { return false; } }; Window_SaveInfo.prototype.drawContents = function (dy) { if (!this._saveContents) { return setTimeout(this.drawContents.bind(this, dy), 50); } if (this.isJson(this._saveContents)) { this._saveContents = JsonEx.parse(this._saveContents); } dy = this.drawPartyGraphics(dy); dy = this.drawPartyNames(dy); dy = this.drawPartyLevels(dy); this.drawColumnData(dy); }; Yanfly.Save.Scene_File_performActionDelete = Scene_File.prototype.performActionDelete; Scene_File.prototype.performActionDelete = function () { Yanfly.Save.Scene_File_performActionDelete.call(this); var globalInfo = DataManager.loadGlobalInfo(); delete globalInfo[this.savefileId()]; DataManager.saveGlobalInfo(globalInfo); this._listWindow.refresh(); };
Window_SaveInfo.prototype.isJson = function (content) {
try {
if (typeof JSON.parse(content) === "object") {
return true;
}
} catch (e) {
return false;
}
};
Window_SaveInfo.prototype.drawContents = function (dy) {
if (!this._saveContents) {
return setTimeout(this.drawContents.bind(this, dy), 50);
}
if (this.isJson(this._saveContents)) {
this._saveContents = JsonEx.parse(this._saveContents);
}
dy = this.drawPartyGraphics(dy);
dy = this.drawPartyNames(dy);
dy = this.drawPartyLevels(dy);
this.drawColumnData(dy);
};
Yanfly.Save.Scene_File_performActionDelete = Scene_File.prototype.performActionDelete;
Scene_File.prototype.performActionDelete = function () {
Yanfly.Save.Scene_File_performActionDelete.call(this);
var globalInfo = DataManager.loadGlobalInfo();
delete globalInfo[this.savefileId()];
DataManager.saveGlobalInfo(globalInfo);
this._listWindow.refresh();
};
|