加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
好久没提问了
跪求大佬告知如何判断是否有存档1,如果有的话直接读取存档1,没有的话开新游戏
我从汪汪大大小白机翻那里找的代码,结合坦克君的自动读档代码,没效果,跪求指点
if (!DataManager.isThisGameFile(save(1))) return; //$.toaster({ message : "读取成功!"}) // Extract data from savegame console.log("Extract save contents"); DataManager.createGameObjects(); DataManager.extractSaveContents(JsonEx.parse(StorageManager.load(1))); //console.log(LZString.decompressFromBase64(data.savedata)); //console.log(JsonEx.parse(LZString.decompressFromBase64(data.savedata))); // Move player console.log("Reserve transfer player"); $gamePlayer.reserveTransfer($gameMap.mapId(), $gamePlayer.x, $gamePlayer.y); $gamePlayer.requestMapReload(); // Initialize map console.log("Goto Scene_Map"); $gameSystem.onAfterLoad(); Scene_Load.prototype.reloadMapIfUpdated.call(null); SceneManager.goto(Scene_Map); if (SceneManager._scene) { SceneManager._scene.fadeOutAll(); } } else { DataManager.setupNewGame(); SceneManager.goto(Scene_Map); } }
if (!DataManager.isThisGameFile(save(1))) return;
//$.toaster({ message : "读取成功!"})
// Extract data from savegame
console.log("Extract save contents");
DataManager.createGameObjects();
DataManager.extractSaveContents(JsonEx.parse(StorageManager.load(1)));
//console.log(LZString.decompressFromBase64(data.savedata));
//console.log(JsonEx.parse(LZString.decompressFromBase64(data.savedata)));
// Move player
console.log("Reserve transfer player");
$gamePlayer.reserveTransfer($gameMap.mapId(), $gamePlayer.x, $gamePlayer.y);
$gamePlayer.requestMapReload();
// Initialize map
console.log("Goto Scene_Map");
$gameSystem.onAfterLoad();
Scene_Load.prototype.reloadMapIfUpdated.call(null);
SceneManager.goto(Scene_Map);
if (SceneManager._scene) {
SceneManager._scene.fadeOutAll();
}
} else {
DataManager.setupNewGame();
SceneManager.goto(Scene_Map);
}
}
|