查看: 2795|回复: 6

[有事请教] 使用 YPE 的 SaveCore 插件后报错。

[复制链接]
梦石
0
星屑
686
在线时间
218 小时
注册时间
2016-5-10
回帖
74
发表于 2017-11-3 23:55:16 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
本帖最后由 a422740205 于 2017-11-5 20:51 编辑

插件功能:改变存档界面风格。问题描述:使用该插件以后,创建新的存档并且保存时会直接报错。
                 尝试解决1:在本论坛搜索了关于报错的帖子,都找不到类似提问。
                       尝试解决2:在网上及贴吧也搜索并寻找了下相关报错贴子也没有,唯独一个还没人解决。
                       尝试解决3:尝试了把YEP的核心插件及当前存档插件开启其余插件全部关闭也无效,单独开启存档插件也无效(所以插件冲突可以排除)。
                       错误字段如下图:
                     

插件样式

插件样式


                     

保存后报错

保存后报错
                      0V5(P2GV%T8Z{FG[0AS8~G4.png
F8报错图已补。

希望有大神帮忙解决下。
附上代码:
  1. //=============================================================================
  2. // Yanfly Engine Plugins - Save Core
  3. // YEP_SaveCore.js
  4. //=============================================================================

  5. var Imported = Imported || {};
  6. Imported.YEP_SaveCore = true;

  7. var Yanfly = Yanfly || {};
  8. Yanfly.Save = Yanfly.Save || {};
  9. Yanfly.Save.version = 1.04;

  10. //=============================================================================
  11. /*:
  12. * @plugindesc v1.04 存档核心
  13. * @author Yanfly Engine Plugins
  14. *
  15. * @param ---General---
  16. * @default
  17. *
  18. * @param Max Files
  19. * @desc The maximum number of files for your game.
  20. * Default: 20
  21. * @default 24
  22. *
  23. * @param Saved Icon
  24. * @desc Icon ID used for a file slot with a save.
  25. * @default 231
  26. *
  27. * @param Empty Icon
  28. * @desc Icon ID used for an empty file slot.
  29. * @default 230
  30. *
  31. * @param Return After Saving
  32. * @desc Return to the previous scene after saving?
  33. * NO - false     YES - true     Default: true
  34. * @default false
  35. *
  36. * @param Auto New Index
  37. * @desc For new games, automatically decide the save slot?
  38. * NO - false     YES - true     Default: true
  39. * @default true
  40. *
  41. * @param ---Action Window---
  42. * @default
  43. *
  44. * @param Load Command
  45. * @desc Text for the load command in the action window.
  46. * @default Load
  47. *
  48. * @param Save Command
  49. * @desc Text for the save command in the action window.
  50. * @default Save
  51. *
  52. * @param Delete Command
  53. * @desc Text for the delete command in the action window.
  54. * @default Delete
  55. *
  56. * @param ---Help Window---
  57. * @default
  58. *
  59. * @param Select Help
  60. * @desc Help text displayed when selecting a slot.
  61. * @default Please select a file slot.
  62. *
  63. * @param Load Help
  64. * @desc Help text displayed when selecting load option.
  65. * @default Loads the data from the saved game.
  66. *
  67. * @param Save Help
  68. * @desc Help text displayed when selecting save option.
  69. * @default Saves the current progress in your game.
  70. *
  71. * @param Delete Help
  72. * @desc Help text displayed when selecting delete option.
  73. * @default Deletes all data from this save file.
  74. *
  75. * @param ---Delete---
  76. * @default
  77. *
  78. * @param Delete Filename
  79. * @desc Used for the delete sound from the /audio/se/ folder.
  80. * Do NOT include the file extension.
  81. * @default Damage2
  82. *
  83. * @param Delete Volume
  84. * @desc Volume used for the delete sound.
  85. * @default 100
  86. *
  87. * @param Delete Pitch
  88. * @desc Pitch used for the delete sound.
  89. * @default 150
  90. *
  91. * @param Delete Pan
  92. * @desc Pan used for the delete sound.
  93. * @default 0
  94. *
  95. * @param ---Info Window---
  96. * @default
  97. *
  98. * @param Show Game Title
  99. * @desc Display the game title in the save file?
  100. * NO - false     YES - true
  101. * @default true
  102. *
  103. * @param Invalid Game Text
  104. * @desc Text used when the save is for a different game.
  105. * @default This save is for a different game.
  106. *
  107. * @param Empty Game Text
  108. * @desc Text used when the save is empty.
  109. * @default Empty
  110. *
  111. * @param Map Display Name
  112. * @desc Use the display name for the saved map instead?
  113. * NO - false     YES - true
  114. * @default true
  115. *
  116. * @param Party Display
  117. * @desc The display type used for the party.
  118. * 0 - None; 1 - Characters; 2 - Faces; 3 - SV Actors
  119. * @default 2
  120. *
  121. * @param Party Y Position
  122. * @desc This is the base Y position for the party display.
  123. * Formulas can be used.
  124. * @default this.lineHeight() + Window_Base._faceHeight
  125. *
  126. * @param Show Actor Names
  127. * @desc Display the names of the actors?
  128. * NO - false     YES - true
  129. * @default true
  130. *
  131. * @param Name Font Size
  132. * @desc Font size used for names if names are displayed.
  133. * Default: 28
  134. * @default 20
  135. *
  136. * @param Show Actor Level
  137. * @desc Display the levels of the actors?
  138. * NO - false     YES - true
  139. * @default true
  140. *
  141. * @param Level Font Size
  142. * @desc Font size used for levels if levels are displayed.
  143. * Default: 28
  144. * @default 20
  145. *
  146. * @param Level Format
  147. * @desc The text format used to display levels.
  148. * %1 - Lv (Abbr)   %2 - Lv (Full)     %3 - Value
  149. * @default \c[16]%1 \c[0]%3
  150. *
  151. * @param Data Font Size
  152. * @desc Font size used for displaying data.
  153. * Default: 28
  154. * @default 20
  155. *
  156. * @param Data Column 1
  157. * @desc The data to be displayed in data column 1. Refer to help
  158. * file for data entries. Separate each entry with commas.
  159. * @default empty, playtime, save count, gold count
  160. *
  161. * @param Data Column 2
  162. * @desc The data to be displayed in data column 2. Refer to help
  163. * file for data entries. Separate each entry with commas.
  164. * @default location, variable 1, variable 2, variable 3
  165. *
  166. * @param Data Column 3
  167. * @desc The data to be displayed in data column 2. Refer to help
  168. * file for data entries. Separate each entry with commas.
  169. * @default empty, variable 4, variable 5, variable 6
  170. *
  171. * @param Data Column 4
  172. * @desc The data to be displayed in data column 2. Refer to help
  173. * file for data entries. Separate each entry with commas.
  174. * @default
  175. *
  176. * @param ---Vocabulary---
  177. * @default
  178. *
  179. * @param Map Location
  180. * @desc Text used to categorize 'Map Location'.
  181. * Leave empty to not use this category and center the data.
  182. * @default
  183. *
  184. * @param Playtime
  185. * @desc Text used to categorize 'Playtime'.
  186. * Leave empty to not use this category and center the data.
  187. * @default Playtime:
  188. *
  189. * @param Save Count
  190. * @desc Text used to categorize 'Save Count'.
  191. * Leave empty to not use this category and center the data.
  192. * @default Total Saves:
  193. *
  194. * @param Gold Count
  195. * @desc Text used to categorize 'Gold Count'.
  196. * Leave empty to not use this category and center the data.
  197. * @default %1:
  198. *
  199. * @param ---Technical---
  200. * @default
  201. *
  202. * @param Save Mode
  203. * @desc How the save system should work for your game:
  204. * local     web     auto
  205. * @default auto
  206. *
  207. * @param Local Config
  208. * @desc Filename for config when working with local saves.
  209. * Default: config.rpgsave
  210. * @default config.rpgsave
  211. *
  212. * @param Local Global
  213. * @desc Filename for global when working with local saves.
  214. * Default: global.rpgsave
  215. * @default global.rpgsave
  216. *
  217. * @param Local Save
  218. * @desc Filename for game saves when working with local saves.
  219. * %1 - File Slot. Default: config.rpgsave
  220. * @default file%1.rpgsave
  221. *
  222. * @param Web Config
  223. * @desc Filename for config when working with web saves.
  224. * %1 - Game Name. Default: RPG Config
  225. * @default RPG %1 Config
  226. *
  227. * @param Web Global
  228. * @desc Filename for global when working with web saves.
  229. * %1 - Game Name. Default: RPG Global
  230. * @default RPG %1 Global
  231. *
  232. * @param Web Save
  233. * @desc Filename for game saves when working with web saves.
  234. * %1 - Game Name. %2 - File Slot. Default: RPG File%1
  235. * @default RPG %1 File%2
  236. *
  237. * @param ---Confirmation---
  238. * @default
  239. *
  240. * @param Load Confirmation
  241. * @desc Show the load confirmation window when loading a
  242. * save file? NO - false     YES - true
  243. * @default true
  244. *
  245. * @param Load Text
  246. * @desc Text displayed when loading a save file.
  247. * @default Do you wish to load this save file?
  248. *
  249. * @param Save Confirmation
  250. * @desc Show the save confirmation window when overwriting a
  251. * save file? NO - false     YES - true
  252. * @default true
  253. *
  254. * @param Save Text
  255. * @desc Text displayed when overwriting a save file.
  256. * @default Do you wish to overwrite this save file?
  257. *
  258. * @param Delete Confirmation
  259. * @desc Show the save confirmation window when deleting a
  260. * save file? NO - false     YES - true
  261. * @default true
  262. *
  263. * @param Delete Text
  264. * @desc Text displayed when deleting a save file.
  265. * @default Do you wish to delete this save file?
  266. *
  267. * @param Confirm Yes
  268. * @desc Text used for the 'Yes' confirm command
  269. * @default Yes
  270. *
  271. * @param Confirm No
  272. * @desc Text used for the 'No' confirm command
  273. * @default No
  274. *
  275. * @help
  276. * ============================================================================
  277. * Introduction
  278. * ============================================================================
  279. *
  280. * 注意:这个插件只支持1.1.0以上的版本
  281. * 这个插件提供了一个新的存档界面。通过这个新的界面,玩家可以直接从菜单载入
  282. * 或者删除存档,这也将导致存档命令一直显示在之菜单,但是我们可以关闭或者开
  283. * 启存档选项。从这个界面,玩家可以获得存档的各类信息,例如位置,金钱树,或
  284. * 者任何你想展示的变量。
  285. *
  286. * ============================================================================
  287. * Instructions - Data Columns
  288. * ============================================================================
  289. *
  290. * 对于那些想在每个存档显示额外信息的人,你可以添加插件参数里面的Data
  291. * Columns,用逗号隔开。你可以使用下面的标签
  292. *
  293. * Data Column Categories:
  294. *
  295. *   Empty
  296. *   - 显示一个空位置,但是没有外框
  297. *
  298. *   Null
  299. *   - 显示一个空位置,但是有外框
  300. *
  301. *   Location
  302. *   - 地图坐标
  303. *
  304. *   Playtime
  305. *   - 游戏时间
  306. *
  307. *   Save Count
  308. *   - 存档数
  309. *
  310. *   Gold Count
  311. *   - 金钱数
  312. *
  313. *   Variable x
  314. *   -显示变量的名字和值。你可以使用文本代码。任何在<< >>里面的都不会被显示。如
  315. *   果没有变量名,变量的值就会居中
  316. *
  317. *   text: stuff
  318. *   left text: stuff
  319. *   center text: stuff
  320. *   right text: stuff
  321. *   -这将显示自定义文本。可以设置显示位置,默认是居左对齐。
  322. *
  323. * ============================================================================
  324. * Technical - Save Modes
  325. * ============================================================================
  326. *
  327. * 对于想要在网上发布游戏的开发者,你可以看一看Technical里的参数。你可以设置
  328. * 游戏模式,是“本地”,还是“网站”。默认你可以设置为“自动”。如果是为了
  329. * 测试目的,你可以在本地运行时设置web模式。如果游戏运行在网站上,你不可以使
  330. * 用本地模式。
  331. *
  332. * ============================================================================
  333. * Technical - Save Files
  334. * ============================================================================
  335. *
  336. * 如果你有经验,你可以根据喜好设置'Local Config', 'Local Global', 和 'Local
  337. * Save'的名字
  338. *
  339. * ---
  340. *
  341. * 如果你正在做网站包括移动端的游戏,我建议你看下'Web Config', 'Web Global'
  342. * 和'Web Save'的参数。所以运行在网站上的游戏都会使用相同的设置。
  343. *
  344. * This plugin's default settings will solve this sharing issue by making the
  345. * web save named accordingly to your game's name provided that you keep the
  346. * current plugin settings as is or adjust it accordingly. Now, your game will
  347. * have its own individual identity, use its own configuration, global, and
  348. * save files without clashing with any other RPG Maker MV games players may
  349. * have played.这个插件默认设置解决了网站游戏存档奔溃的一些问题
  350. *
  351. * ============================================================================
  352. * Changelog
  353. * ============================================================================
  354. *
  355. * Version 1.04:
  356. * - Added 'Map Display Name' plugin parameter. Enabling this option will now
  357. * display the display name for the map instead of the editor name.
  358. *
  359. * Version 1.03:
  360. * - Fixed a bug that caused web saving to not work properly.
  361. *
  362. * Version 1.02:
  363. * - Fixed a bug that caused the actor's default name to appear in the save
  364. * screen instead of the actor's current name (if it was changed.)
  365. *
  366. * Version 1.01:
  367. * - Added a wait time update for save info data to load when moving across the
  368. * various save files.
  369. *
  370. * Version 1.00:
  371. * - Finished Plugin!
  372. */
  373. //=============================================================================

  374. //=============================================================================
  375. // Parameter Variables
  376. //=============================================================================

  377. Yanfly.Parameters = PluginManager.parameters('YEP_SaveCore');
  378. Yanfly.Param = Yanfly.Param || {};

  379. Yanfly.Param.SaveMaxFiles = Number(Yanfly.Parameters['Max Files']);
  380. Yanfly.Param.SaveIconSaved = Number(Yanfly.Parameters['Saved Icon']);
  381. Yanfly.Param.SaveIconEmpty = Number(Yanfly.Parameters['Empty Icon']);
  382. Yanfly.Param.SavePop = eval(String(Yanfly.Parameters['Return After Saving']));
  383. Yanfly.Param.SaveAutoIndex = eval(String(Yanfly.Parameters['Auto New Index']));

  384. Yanfly.Param.SaveCmdLoad = String(Yanfly.Parameters['Load Command']);
  385. Yanfly.Param.SaveCmdSave = String(Yanfly.Parameters['Save Command']);
  386. Yanfly.Param.SaveCmdDelete = String(Yanfly.Parameters['Delete Command']);

  387. Yanfly.Param.SaveHelpSelect = String(Yanfly.Parameters['Select Help']);
  388. Yanfly.Param.SaveLoadSelect = String(Yanfly.Parameters['Load Help']);
  389. Yanfly.Param.SaveSaveSelect = String(Yanfly.Parameters['Save Help']);
  390. Yanfly.Param.SaveDeleteSelect = String(Yanfly.Parameters['Delete Help']);

  391. Yanfly.Param.SaveDeleteSound = {
  392.   name:   String(Yanfly.Parameters['Delete Filename']),
  393.   volume: Number(Yanfly.Parameters['Delete Volume']),
  394.   pitch:  Number(Yanfly.Parameters['Delete Pitch']),
  395.   pan:    Number(Yanfly.Parameters['Delete Pan'])
  396. };

  397. Yanfly.Param.SaveInfoTitle = String(Yanfly.Parameters['Show Game Title']);
  398. Yanfly.Param.SaveInfoTitle = eval(Yanfly.Param.SaveInfoTitle);
  399. Yanfly.Param.SaveInfoInvalid = String(Yanfly.Parameters['Invalid Game Text']);
  400. Yanfly.Param.SaveInfoEmpty = String(Yanfly.Parameters['Empty Game Text']);
  401. Yanfly.Param.SaveMapDisplayName = String(Yanfly.Parameters['Map Display Name']);
  402. Yanfly.Param.SaveMapDisplayName = eval(Yanfly.Param.SaveMapDisplayName);
  403. Yanfly.Param.SaveInfoPartyType = Number(Yanfly.Parameters['Party Display']);
  404. Yanfly.Param.SaveInfoPartyType = Yanfly.Param.SaveInfoPartyType.clamp(0, 3);
  405. Yanfly.Param.SaveInfoPartyY = String(Yanfly.Parameters['Party Y Position']);
  406. Yanfly.Param.SaveInfoActorName = String(Yanfly.Parameters['Show Actor Names']);
  407. Yanfly.Param.SaveInfoActorName = eval(Yanfly.Param.SaveInfoActorName);
  408. Yanfly.Param.SaveInfoActorNameSz = Number(Yanfly.Parameters['Name Font Size']);
  409. Yanfly.Param.SaveInfoActorLv = String(Yanfly.Parameters['Show Actor Level']);
  410. Yanfly.Param.SaveInfoActorLv = eval(Yanfly.Param.SaveInfoActorLv);
  411. Yanfly.Param.SaveInfoActorLvSz = Number(Yanfly.Parameters['Level Font Size']);
  412. Yanfly.Param.SaveInfoActorLvFmt = String(Yanfly.Parameters['Level Format']);
  413. Yanfly.Param.SaveInfoDataSz = Number(Yanfly.Parameters['Data Font Size']);
  414. Yanfly.Param.SaveInfoDataCol1 = String(Yanfly.Parameters['Data Column 1']);
  415. Yanfly.Param.SaveInfoDataCol1 = Yanfly.Param.SaveInfoDataCol1.split(',');
  416. Yanfly.Param.SaveInfoDataCol2 = String(Yanfly.Parameters['Data Column 2']);
  417. Yanfly.Param.SaveInfoDataCol2 = Yanfly.Param.SaveInfoDataCol2.split(',');
  418. Yanfly.Param.SaveInfoDataCol3 = String(Yanfly.Parameters['Data Column 3']);
  419. Yanfly.Param.SaveInfoDataCol3 = Yanfly.Param.SaveInfoDataCol3.split(',');
  420. Yanfly.Param.SaveInfoDataCol4 = String(Yanfly.Parameters['Data Column 4']);
  421. Yanfly.Param.SaveInfoDataCol4 = Yanfly.Param.SaveInfoDataCol4.split(',');

  422. Yanfly.trimSaveDataColumns = function(array) {
  423.   var length = array.length;
  424.   for (var i = 0; i < length; ++i) {
  425.     array[i] = array[i].trim();
  426.   }
  427.   if (length === 1 && array[0] === '') array.splice(0);
  428. };

  429. Yanfly.trimSaveDataColumns(Yanfly.Param.SaveInfoDataCol1);
  430. Yanfly.trimSaveDataColumns(Yanfly.Param.SaveInfoDataCol2);
  431. Yanfly.trimSaveDataColumns(Yanfly.Param.SaveInfoDataCol3);
  432. Yanfly.trimSaveDataColumns(Yanfly.Param.SaveInfoDataCol4);

  433. Yanfly.Param.SaveVocabLocation = String(Yanfly.Parameters['Map Location']);
  434. Yanfly.Param.SaveVocabPlaytime = String(Yanfly.Parameters['Playtime']);
  435. Yanfly.Param.SaveVocabSaveCount = String(Yanfly.Parameters['Save Count']);
  436. Yanfly.Param.SaveVocabGoldCount = String(Yanfly.Parameters['Gold Count']);

  437. Yanfly.Param.SaveTechSaveMode = String(Yanfly.Parameters['Save Mode']).trim();
  438. Yanfly.Param.SaveTechSaveMode = Yanfly.Param.SaveTechSaveMode.toLowerCase();
  439. Yanfly.Param.SaveTechLocalConfig = String(Yanfly.Parameters['Local Config']);
  440. Yanfly.Param.SaveTechLocalGlobal = String(Yanfly.Parameters['Local Global']);
  441. Yanfly.Param.SaveTechLocalSave = String(Yanfly.Parameters['Local Save']);
  442. Yanfly.Param.SaveTechWebConfig = String(Yanfly.Parameters['Web Config']);
  443. Yanfly.Param.SaveTechWebGlobal = String(Yanfly.Parameters['Web Global']);
  444. Yanfly.Param.SaveTechWebSave = String(Yanfly.Parameters['Web Save']);

  445. Yanfly.Param.SaveConfirmLoad = String(Yanfly.Parameters['Load Confirmation']);
  446. Yanfly.Param.SaveConfirmLoad = eval(Yanfly.Param.SaveConfirmLoad);
  447. Yanfly.Param.SaveConfirmLoadTx = String(Yanfly.Parameters['Load Text']);
  448. Yanfly.Param.SaveConfirmSave = String(Yanfly.Parameters['Save Confirmation']);
  449. Yanfly.Param.SaveConfirmSave = eval(Yanfly.Param.SaveConfirmSave);
  450. Yanfly.Param.SaveConfirmSaveTx = String(Yanfly.Parameters['Save Text']);
  451. Yanfly.Param.SaveConfirmDel = String(Yanfly.Parameters['Delete Confirmation']);
  452. Yanfly.Param.SaveConfirmDel = eval(Yanfly.Param.SaveConfirmDel);
  453. Yanfly.Param.SaveConfirmDelTx = String(Yanfly.Parameters['Delete Text']);
  454. Yanfly.Param.SaveConfirmYes = String(Yanfly.Parameters['Confirm Yes']);
  455. Yanfly.Param.SaveConfirmNo = String(Yanfly.Parameters['Confirm No']);

  456. //=============================================================================
  457. // DataManager
  458. //=============================================================================

  459. DataManager.maxSavefiles = function() {
  460.     return Yanfly.Param.SaveMaxFiles;
  461. };

  462. Yanfly.Save.DataManager_selectSavefileForNewGame =
  463.     DataManager.selectSavefileForNewGame;
  464. DataManager.selectSavefileForNewGame = function() {
  465.     Yanfly.Save.DataManager_selectSavefileForNewGame.call(this);
  466.     if (Yanfly.Param.SaveAutoIndex) return;
  467.     this._lastAccessedId = 1;
  468. };

  469. Yanfly.Save.DataManager_makeSaveContents = DataManager.makeSaveContents;
  470. DataManager.makeSaveContents = function() {
  471.   var contents = Yanfly.Save.DataManager_makeSaveContents.call(this);
  472.   contents.map.locationDisplayName = $dataMap.displayName;
  473.   return contents;
  474. };

  475. //=============================================================================
  476. // StorageManager
  477. //=============================================================================

  478. Yanfly.Save.StorageManager_isLocalMode = StorageManager.isLocalMode;
  479. StorageManager.isLocalMode = function() {
  480.   if (Yanfly.Param.SaveTechSaveMode === 'local') {
  481.     if (!Utils.isNwjs()) return false;
  482.     return true;
  483.   } else if (Yanfly.Param.SaveTechSaveMode === 'web') {
  484.     return false;
  485.   } else {
  486.     return Yanfly.Save.StorageManager_isLocalMode.call(this);
  487.   }
  488. };

  489. StorageManager.localFilePath = function(savefileId) {
  490.   var name;
  491.   if (savefileId < 0) {
  492.     name = Yanfly.Param.SaveTechLocalConfig;
  493.   } else if (savefileId === 0) {
  494.     name = Yanfly.Param.SaveTechLocalGlobal;
  495.   } else {
  496.     name = Yanfly.Param.SaveTechLocalSave.format(savefileId);
  497.   }
  498.   return this.localFileDirectoryPath() + name;
  499. };

  500. Yanfly.Save.StorageManager_webStorageKey = StorageManager.webStorageKey;
  501. StorageManager.webStorageKey = function(savefileId) {
  502.   if (!$dataSystem) return Yanfly.Save.StorageManager_webStorageKey.call(this);
  503.   var title = $dataSystem.gameTitle;
  504.   this.loadConfig();
  505.   if (savefileId < 0) {
  506.     return Yanfly.Param.SaveTechWebConfig.format(title);
  507.   } else if (savefileId === 0) {
  508.     return Yanfly.Param.SaveTechWebGlobal.format(title);
  509.   } else {
  510.     return Yanfly.Param.SaveTechWebSave.format(title, savefileId);
  511.   }
  512. };

  513. StorageManager.loadConfig = function() {
  514.   if (this._configLoaded) return;
  515.   this._configLoaded = true;
  516.   ConfigManager.load();
  517. };

  518. //=============================================================================
  519. // BattleManager
  520. //=============================================================================

  521. Yanfly.Save.BattleManager_setBattleTest = BattleManager.setBattleTest;
  522. BattleManager.setBattleTest = function(battleTest) {
  523.     Yanfly.Save.BattleManager_setBattleTest.call(this, battleTest);
  524.     if (battleTest) StorageManager.loadConfig();
  525. };

  526. //=============================================================================
  527. // Window_Base
  528. //=============================================================================

  529. Window_Base.prototype.drawSvActor = function(actor, x, y) {
  530.     var filename = actor.battlerName();
  531.     var bitmap = ImageManager.loadSvActor(filename);
  532.     var pw = bitmap.width / 9;
  533.     var ph = bitmap.height / 6;
  534.     var sx = 0;
  535.     var sy = 0;
  536.     this.contents.blt(bitmap, sx, sy, pw, ph, x - pw / 2, y - ph);
  537. };

  538. Window_Base.prototype.textWidthEx = function(text) {
  539.     return this.drawTextEx(text, 0, this.contents.height);
  540. };

  541. //=============================================================================
  542. // Window_MenuCommand
  543. //=============================================================================

  544. Window_MenuCommand.prototype.isSaveEnabled = function() {
  545.     if (DataManager.isEventTest()) return false;
  546.     return true;
  547. };

  548. //=============================================================================
  549. // Window_SavefileList
  550. //=============================================================================

  551. Window_SavefileList.prototype.itemHeight = function() {
  552.     return this.lineHeight();
  553. };

  554. Window_SavefileList.prototype.drawItem = function(index) {
  555.     var id = index + 1;
  556.     var valid = DataManager.isThisGameFile(id);
  557.     var rect = this.itemRect(index);
  558.     this.resetTextColor();
  559.     //if (this._mode === 'load') this.changePaintOpacity(valid);
  560.     this.changePaintOpacity(valid);
  561.     var icon = valid ? Yanfly.Param.SaveIconSaved : Yanfly.Param.SaveIconEmpty;
  562.     this.drawIcon(icon, rect.x + 2, rect.y + 2);
  563.     this.drawFileId(id, rect.x + Window_Base._iconWidth + 4, rect.y);
  564. };

  565. Window_SavefileList.prototype.playOkSound = function() {
  566.     Window_Selectable.prototype.playOkSound.call(this);
  567. };

  568. //=============================================================================
  569. // Window_SaveAction
  570. //=============================================================================

  571. function Window_SaveAction() {
  572.     this.initialize.apply(this, arguments);
  573. }

  574. Window_SaveAction.prototype = Object.create(Window_HorzCommand.prototype);
  575. Window_SaveAction.prototype.constructor = Window_SaveAction;

  576. Window_SaveAction.prototype.initialize = function(x, y, mode) {
  577.     this._width = Graphics.boxWidth - x;
  578.     this._currentFile = 0;
  579.     this._mode = mode;
  580.     Window_HorzCommand.prototype.initialize.call(this, x, y);
  581.     this.deactivate();
  582.     this.deselect();
  583. };

  584. Window_SaveAction.prototype.windowWidth = function() {
  585.     return this._width;
  586. };

  587. Window_SaveAction.prototype.maxCols = function() {
  588.     return 3;
  589. };

  590. Window_SaveAction.prototype.savefileId = function() {
  591.     return SceneManager._scene._listWindow.index() + 1;
  592. };

  593. Window_SaveAction.prototype.makeCommandList = function() {
  594.     var id = this.savefileId();
  595.     var enabled = DataManager.isThisGameFile(id);
  596.     var valid = DataManager.loadSavefileInfo(id);
  597.     this.addCommand(this.getCommandName('load'), 'load', valid);
  598.     this.addCommand(this.getCommandName('save'), 'save', this.isSaveEnabled());
  599.     this.addCommand(this.getCommandName('delete'), 'delete', enabled);
  600. };

  601. Window_SaveAction.prototype.getCommandName = function(type) {
  602.     if (type === 'load') {
  603.       return Yanfly.Param.SaveCmdLoad;
  604.     } else if (type === 'save') {
  605.       return Yanfly.Param.SaveCmdSave;
  606.     } else {
  607.       return Yanfly.Param.SaveCmdDelete;
  608.     }
  609. };

  610. Window_SaveAction.prototype.isSaveEnabled = function() {
  611.     if (this._mode !== 'save') return false;
  612.     return $gameSystem.isSaveEnabled();
  613. };

  614. Window_SaveAction.prototype.update = function() {
  615.     Window_HorzCommand.prototype.update.call(this);
  616.     if (this.savefileId() !== this._currentFile) this.updateIndex();
  617. };

  618. Window_SaveAction.prototype.updateIndex = function() {
  619.     this._currentFile = this.savefileId();
  620.     this.refresh();
  621. };

  622. Window_SaveAction.prototype.playOkSound = function() {
  623. };

  624. Window_SaveAction.prototype.updateHelp = function() {
  625.     var text = '';
  626.     if (this.currentSymbol() === 'load') {
  627.       text = Yanfly.Param.SaveLoadSelect;
  628.     } else if (this.currentSymbol() === 'save') {
  629.       text = Yanfly.Param.SaveSaveSelect;
  630.     } else if (this.currentSymbol() === 'delete') {
  631.       text = Yanfly.Param.SaveDeleteSelect;
  632.     }
  633.     this._helpWindow.setText(text);
  634. };

  635. //=============================================================================
  636. // Window_SaveInfo
  637. //=============================================================================

  638. function Window_SaveInfo() {
  639.     this.initialize.apply(this, arguments);
  640. }

  641. Window_SaveInfo.prototype = Object.create(Window_Base.prototype);
  642. Window_SaveInfo.prototype.constructor = Window_SaveInfo;

  643. Window_SaveInfo.prototype.initialize = function(x, y, width, height, mode) {
  644.   this._currentFile = 0;
  645.   this._waitTime = 0;
  646.   this._mode = mode;
  647.   Window_Base.prototype.initialize.call(this, x, y, width, height);
  648. };

  649. Window_SaveInfo.prototype.resetFontSettings = function() {
  650.   Window_Base.prototype.resetFontSettings.call(this);
  651.   if (this._drawLevel) this.contents.fontSize = Yanfly.Param.SaveInfoActorLvSz;
  652.   if (this._drawData) this.contents.fontSize = Yanfly.Param.SaveInfoDataSz;
  653. };

  654. Window_SaveInfo.prototype.savefileId = function() {
  655.   return SceneManager._scene._listWindow.index() + 1;
  656. };

  657. Window_SaveInfo.prototype.drawDarkRect = function(dx, dy, dw, dh) {
  658.   var color = this.gaugeBackColor();
  659.   this.changePaintOpacity(false);
  660.   this.contents.fillRect(dx + 1, dy + 1, dw - 2, dh - 2, color);
  661.   this.changePaintOpacity(true);
  662. };

  663. Window_SaveInfo.prototype.update = function() {
  664.   Window_Base.prototype.update.call(this);
  665.   if (this.savefileId() !== this._currentFile) this.updateIndex();
  666.   if (this._waitTime > 0) this.updateTimer();
  667. };

  668. Window_SaveInfo.prototype.systemColorEx = function() {
  669.     if (Imported.YEP_CoreEngine) {
  670.       return '\\c[' + Yanfly.Param.ColorSystem + ']';
  671.     } else {
  672.       return '\\c[16]';
  673.     }
  674. };

  675. Window_SaveInfo.prototype.updateIndex = function() {
  676.   var id = this.savefileId();
  677.   this._currentFile = id;
  678.   this._waitTime = 30;
  679.   this.contents.clear();
  680. };

  681. Window_SaveInfo.prototype.updateTimer = function() {
  682.   this._waitTime -= 1;
  683.   if (this._waitTime > 0) return;
  684.   var id = this.savefileId();
  685.   this._valid = DataManager.isThisGameFile(id);
  686.   this._info = DataManager.loadSavefileInfo(id);
  687.   this.refresh();
  688. };

  689. Window_SaveInfo.prototype.refresh = function() {
  690.   this.contents.clear();
  691.   this.resetFontSettings();
  692.   var dy = 0;
  693.   dy = this.drawGameTitle(dy);
  694.   if (!this._valid) return this.drawInvalidText(dy);
  695.   this._saveContents = StorageManager.load(this.savefileId());
  696.   this.drawContents(dy);
  697. };

  698. Window_SaveInfo.prototype.drawGameTitle = function(dy) {
  699.   if (!Yanfly.Param.SaveInfoTitle) return dy;
  700.   if (!this._info) return dy;
  701.   if (!this._info.title) return dy;
  702.   this.resetFontSettings();
  703.   var text = this._info.title;
  704.   this.drawText(text, 0, dy, this.contents.width, 'center');
  705.   return dy + this.lineHeight();
  706. };

  707. Window_SaveInfo.prototype.drawInvalidText = function(dy) {
  708.   this.drawDarkRect(0, dy, this.contents.width, this.contents.height - dy);
  709.   dy = (this.contents.height - dy - this.lineHeight()) / 2;
  710.   if (this._info) {
  711.     var text = Yanfly.Param.SaveInfoInvalid;
  712.   } else {
  713.     var text = Yanfly.Param.SaveInfoEmpty;
  714.   }
  715.   this.changeTextColor(this.systemColor());
  716.   this.drawText(text, 0, dy, this.contents.width, 'center');
  717. };

  718. Window_SaveInfo.prototype.drawContents = function(dy) {
  719.   if (!this._saveContents) {
  720.     return setTimeout(this.drawContents.bind(this, dy), 50);
  721.   }
  722.   this._saveContents = JsonEx.parse(this._saveContents);
  723.   dy = this.drawPartyGraphics(dy);
  724.   dy = this.drawPartyNames(dy);
  725.   dy = this.drawPartyLevels(dy);
  726.   this.drawColumnData(dy);
  727. };

  728. Window_SaveInfo.prototype.drawPartyGraphics = function(dy) {
  729.   if (Yanfly.Param.SaveInfoPartyType === 0) return dy;
  730.   dy = eval(Yanfly.Param.SaveInfoPartyY);
  731.   var length = this._saveContents.party.maxBattleMembers();
  732.   var dw = this.contents.width / length;;
  733.   dw = Math.floor(dw);
  734.   var dx = Math.floor(dw / 2);
  735.   for (var i = 0; i < length; ++i) {
  736.     var actorId = this._saveContents.party._actors[i];
  737.     var member = this._saveContents.actors._data[actorId];
  738.     if (member) {
  739.       if (Yanfly.Param.SaveInfoPartyType === 1) {
  740.         var name = member.characterName();
  741.         var index = member.characterIndex();
  742.         this.drawCharacter(name, index, dx, dy);
  743.       } else if (Yanfly.Param.SaveInfoPartyType === 2) {
  744.         var fh = Window_Base._faceHeight;
  745.         var fw = Window_Base._faceWidth;
  746.         var fx = dx - Math.floor(Math.min(fh, dw) / 2);
  747.         var dif = Math.floor(Math.max(0, dw - fw) / 2);
  748.         var name = member.faceName();
  749.         var index = member.faceIndex();
  750.         this.drawFace(name, index, fx - dif, dy - fh, dw, fh);
  751.       } else if (Yanfly.Param.SaveInfoPartyType === 3) {
  752.         this.drawSvActor(member, dx, dy);
  753.       }
  754.     }
  755.     dx += dw;
  756.   }
  757.   return dy;
  758. };

  759. Window_SaveInfo.prototype.drawCharacter = function(name, index, x, y) {
  760.     var bitmap = ImageManager.loadCharacter(name);
  761.     if (bitmap.width <= 0) {
  762.       return setTimeout(this.drawCharacter.bind(this, name, index, x, y), 50);
  763.     }
  764.     Window_Base.prototype.drawCharacter.call(this, name, index, x, y);
  765. };

  766. Window_SaveInfo.prototype.drawFace = function(name, index, x, y, w, h) {
  767.     var bitmap = ImageManager.loadFace(name);
  768.     if (bitmap.width <= 0) {
  769.       return setTimeout(this.drawFace.bind(this, name, index, x, y, w, h), 50);
  770.     }
  771.     Window_Base.prototype.drawFace.call(this, name, index, x, y, w, h);
  772. };

  773. Window_SaveInfo.prototype.drawSvActor = function(actor, x, y) {
  774.     var filename = actor.battlerName();
  775.     var bitmap = ImageManager.loadSvActor(filename);
  776.     if (bitmap.width <= 0) {
  777.       return setTimeout(this.drawSvActor.bind(this, actor, x, y), 50);
  778.     }
  779.     Window_Base.prototype.drawSvActor.call(this, actor, x, y);
  780. };

  781. Window_SaveInfo.prototype.drawPartyNames = function(dy) {
  782.   if (!Yanfly.Param.SaveInfoActorName) return dy;
  783.   this.resetFontSettings();
  784.   this.contents.fontSize = Yanfly.Param.SaveInfoActorNameSz;
  785.   var length = this._saveContents.party.maxBattleMembers();
  786.   var dw = this.contents.width / length;;
  787.   dw = Math.floor(dw);
  788.   var dx = 0;
  789.   for (var i = 0; i < length; ++i) {
  790.     var actorId = this._saveContents.party._actors[i];
  791.     var member = this._saveContents.actors._data[actorId];
  792.     if (member) {
  793.       var name = member._name;
  794.       this.drawText(name, dx, dy, dw, 'center');
  795.     }
  796.     dx += dw
  797.   }
  798.   return dy += this.lineHeight();
  799. };

  800. Window_SaveInfo.prototype.drawPartyLevels = function(dy) {
  801.   if (!Yanfly.Param.SaveInfoActorLv) return dy;
  802.   this._drawLevel = true;
  803.   var length = this._saveContents.party.maxBattleMembers();
  804.   var dw = this.contents.width / length;;
  805.   dw = Math.floor(dw);
  806.   var dx = 0;
  807.   var fmt = Yanfly.Param.SaveInfoActorLvFmt;
  808.   for (var i = 0; i < length; ++i) {
  809.     var actorId = this._saveContents.party._actors[i];
  810.     var member = this._saveContents.actors._data[actorId];
  811.     if (member) {
  812.       var lv = Yanfly.Util.toGroup(member.level);
  813.       var text = fmt.format(TextManager.levelA, TextManager.level, lv);
  814.       var tw = this.textWidthEx(text);
  815.       var dif = Math.floor(Math.max(0, dw - tw) / 2);
  816.       this.drawTextEx(text, dx + dif, dy);
  817.     }
  818.     dx += dw
  819.   }
  820.   this._drawLevel = false;
  821.   return dy += this.lineHeight();
  822. };

  823. Window_SaveInfo.prototype.drawColumnData = function(dy) {
  824.     var totalColumns = 0;
  825.     var drawnArrays = [];
  826.     if (Yanfly.Param.SaveInfoDataCol1.length > 0) {
  827.       totalColumns += 1;
  828.       drawnArrays.push(Yanfly.Param.SaveInfoDataCol1);
  829.     }
  830.     if (Yanfly.Param.SaveInfoDataCol2.length > 0) {
  831.       totalColumns += 1;
  832.       drawnArrays.push(Yanfly.Param.SaveInfoDataCol2);
  833.     }
  834.     if (Yanfly.Param.SaveInfoDataCol3.length > 0) {
  835.       totalColumns += 1;
  836.       drawnArrays.push(Yanfly.Param.SaveInfoDataCol3);
  837.     }
  838.     if (Yanfly.Param.SaveInfoDataCol4.length > 0) {
  839.       totalColumns += 1;
  840.       drawnArrays.push(Yanfly.Param.SaveInfoDataCol4);
  841.     }
  842.     if (totalColumns <= 0) return;
  843.     var dw = Math.floor(this.contents.width / totalColumns);
  844.     var dif = totalColumns > 1 ? this.textPadding() : 0;
  845.     for (var i = 0; i < totalColumns; ++i) {
  846.       var column = drawnArrays[i];
  847.       var dx = i * dw;
  848.       this.drawColumn(column, dx, dy, dw - dif);
  849.     }
  850. };

  851. Window_SaveInfo.prototype.drawColumn = function(column, dx, dy, dw) {
  852.     var length = column.length;
  853.     var tp = this.textPadding();
  854.     for (var i = 0; i < length; ++i) {
  855.       this.resetFontSettings();
  856.       this.contents.fontSize = Yanfly.Param.SaveInfoDataSz;
  857.       var data = column[i];
  858.       if (data.toUpperCase().trim() !== 'EMPTY') {
  859.         this.drawDarkRect(dx, dy, dw, this.lineHeight());
  860.         this.drawData(data, dx + tp, dy, dw - tp * 2);
  861.       }
  862.       dy += this.lineHeight();
  863.     }
  864. };

  865. Window_SaveInfo.prototype.drawData = function(data, dx, dy, dw) {
  866.   if (data.toUpperCase().trim() === 'NULL') {
  867.     return;
  868.   } else if (data.toUpperCase().trim() === 'LOCATION') {
  869.     this.drawLocation(dx, dy, dw);
  870.   } else if (data.toUpperCase().trim() === 'PLAYTIME') {
  871.     this.drawPlaytime(dx, dy, dw);
  872.   } else if (data.toUpperCase().trim() === 'SAVE COUNT') {
  873.     this.drawSaveCount(dx, dy, dw);
  874.   } else if (data.toUpperCase().trim() === 'GOLD COUNT') {
  875.     this.drawGoldCount(dx, dy, dw);
  876.   } else if (data.match(/VARIABLE[ ](\d+)/i)) {
  877.     this.drawVariable(parseInt(RegExp.$1), dx, dy, dw);
  878.   } else if (data.match(/(.*)[ ]TEXT:(.*)/i)) {
  879.     this.drawDataText(String(RegExp.$1), String(RegExp.$2), dx, dy, dw);
  880.   } else if (data.match(/TEXT:(.*)/i)) {
  881.     this.drawDataText('left', String(RegExp.$1), dx, dy, dw);
  882.   }
  883. };

  884. Window_SaveInfo.prototype.drawLocation = function(dx, dy, dw) {
  885.     var id = this._saveContents.map._mapId;
  886.     if (Yanfly.Param.SaveMapDisplayName) {
  887.       var text = this._saveContents.map.locationDisplayName || '';
  888.       if (text.length <= 0) text = $dataMapInfos[id].name;
  889.     } else {
  890.       var text = $dataMapInfos[id].name;
  891.     }
  892.     if (Yanfly.Param.SaveVocabLocation.length > 0) {
  893.       this.changeTextColor(this.systemColor());
  894.       this.drawText(Yanfly.Param.SaveVocabLocation, dx, dy, dw, 'left');
  895.       this.changeTextColor(this.normalColor());
  896.       this.drawText(text, dx, dy, dw, 'right');
  897.     } else {
  898.       this.drawText(text, dx, dy, dw, 'center');
  899.     }
  900. };

  901. Window_SaveInfo.prototype.drawPlaytime = function(dx, dy, dw) {
  902.     if (!this._info.playtime) return;
  903.     var text = this._info.playtime;
  904.     if (Yanfly.Param.SaveVocabPlaytime.length > 0) {
  905.       this.changeTextColor(this.systemColor());
  906.       this.drawText(Yanfly.Param.SaveVocabPlaytime, dx, dy, dw, 'left');
  907.       this.changeTextColor(this.normalColor());
  908.       this.drawText(text, dx, dy, dw, 'right');
  909.     } else {
  910.       this.drawText(text, dx, dy, dw, 'center');
  911.     }
  912. };

  913. Window_SaveInfo.prototype.drawSaveCount = function(dx, dy, dw) {
  914.     var text = Yanfly.Util.toGroup(this._saveContents.system._saveCount);
  915.     if (Yanfly.Param.SaveVocabSaveCount.length > 0) {
  916.       this.changeTextColor(this.systemColor());
  917.       this.drawText(Yanfly.Param.SaveVocabSaveCount, dx, dy, dw, 'left');
  918.       this.changeTextColor(this.normalColor());
  919.       this.drawText(text, dx, dy, dw, 'right');
  920.     } else {
  921.       this.drawText(text, dx, dy, dw, 'center');
  922.     }
  923. };

  924. Window_SaveInfo.prototype.drawGoldCount = function(dx, dy, dw) {
  925.     var text = Yanfly.Util.toGroup(this._saveContents.party._gold);
  926.     if (Yanfly.Param.SaveVocabGoldCount.length > 0) {
  927.       this.changeTextColor(this.systemColor());
  928.       var fmt = Yanfly.Param.SaveVocabGoldCount;
  929.       this.drawText(fmt.format(TextManager.currencyUnit), dx, dy, dw, 'left');
  930.       this.changeTextColor(this.normalColor());
  931.       
  932.       this.drawText(text, dx, dy, dw, 'right');
  933.     } else {
  934.       var fmt = '\\c[0]%1' + this.systemColorEx() + '%2';
  935.       var ftext = fmt.format(text, TextManager.currencyUnit);
  936.       this._drawData = true;
  937.       var fw = this.textWidthEx(ftext);
  938.       dx += Math.max(0, Math.floor((dw - fw) / 2));
  939.       this.drawTextEx(ftext, dx, dy);
  940.       this._drawData = false;
  941.     }
  942. };

  943. Window_SaveInfo.prototype.drawVariable = function(id, dx, dy, dw) {
  944.     var varName = $dataSystem.variables[id];
  945.     varName = varName.replace(/<<(.*?)>>/i, '');
  946.     var text = Yanfly.Util.toGroup(this._saveContents.variables.value(id));
  947.     var diff = Math.max(0, (this.standardFontSize() -
  948.       this.contents.fontSize) / 2);
  949.     if (varName.length > 0) {
  950.       this._drawData = true;
  951.       this.changeTextColor(this.systemColor());
  952.       dy += diff;
  953.       this.drawTextEx(this.systemColorEx() + varName, dx, dy, dw, 'left');
  954.       dy -= diff;
  955.       this.changeTextColor(this.normalColor());
  956.       this._drawData = false;
  957.       this.drawText(text, dx, dy, dw, 'right');
  958.     } else {
  959.       this.drawText(text, dx, dy, dw, 'center');
  960.     }
  961. };

  962. Window_SaveInfo.prototype.drawDataText = function(align, text, dx, dy, dw) {
  963.     this._drawData = true;
  964.     dy += Math.max(0, (this.standardFontSize() - this.contents.fontSize) / 2);
  965.     var align = align.toLowerCase().trim();
  966.     var text = text.trim();
  967.     if (align === 'left') {
  968.       this.drawTextEx(text, dx, dy);
  969.     } else if (align === 'right') {
  970.       var tw = this.textWidthEx(text);
  971.       this.drawTextEx(text, dx + dw - tw, dy);
  972.     } else {
  973.       var tw = this.textWidthEx(text);
  974.       this.drawTextEx(text, dx + (dw - tw) / 2, dy);
  975.     }
  976.     this._drawData = false;
  977. };

  978. //=============================================================================
  979. // Window_SaveConfirm
  980. //=============================================================================

  981. function Window_SaveConfirm() {
  982.     this.initialize.apply(this, arguments);
  983. }

  984. Window_SaveConfirm.prototype = Object.create(Window_Command.prototype);
  985. Window_SaveConfirm.prototype.constructor = Window_SaveConfirm;

  986. Window_SaveConfirm.prototype.initialize = function() {
  987.     Window_Command.prototype.initialize.call(this, 0, 0);
  988.     this.openness = 0;
  989. };

  990. Window_SaveConfirm.prototype.makeCommandList = function() {
  991.     this.addCommand(Yanfly.Param.SaveConfirmYes, 'confirm');
  992.     this.addCommand(Yanfly.Param.SaveConfirmNo, 'cancel');
  993. };

  994. Window_SaveConfirm.prototype.setData = function(text) {
  995.     this._text = text;
  996.     var ww = this.textWidthEx(this._text) + this.standardPadding() * 2;
  997.     ww += this.textPadding() * 2;
  998.     this.width = ww;
  999.     this.refresh();
  1000.     this.x = (Graphics.boxWidth - this.width) / 2;
  1001.     this.y = (Graphics.boxHeight - this.height) / 2;
  1002.     this.drawTextEx(this._text, this.textPadding(), 0);
  1003. };

  1004. Window_SaveConfirm.prototype.itemTextAlign = function() {
  1005.     return 'center';
  1006. };

  1007. Window_SaveConfirm.prototype.windowHeight = function() {
  1008.     return this.fittingHeight(3);
  1009. };

  1010. Window_SaveConfirm.prototype.itemRect = function(index) {
  1011.     var rect = Window_Selectable.prototype.itemRect.call(this, index);
  1012.     rect.y += this.lineHeight();
  1013.     return rect;
  1014. };

  1015. //=============================================================================
  1016. // Scene_File
  1017. //=============================================================================

  1018. Scene_File.prototype.terminate = function() {
  1019.     Scene_MenuBase.prototype.terminate.call(this);
  1020.     if (this._loadSuccess) $gameSystem.onAfterLoad();
  1021. };

  1022. Scene_Load.prototype.terminate = function() {
  1023.     Scene_File.prototype.terminate.call(this);
  1024. };

  1025. Scene_File.prototype.create = function() {
  1026.     Scene_MenuBase.prototype.create.call(this);
  1027.     DataManager.loadAllSavefileImages();
  1028.     this.createHelpWindow();
  1029.     this.createListWindow();
  1030.     this.createActionWindow();
  1031.     this.createInfoWindow();
  1032.     this.createConfirmWindow();
  1033. };

  1034. Scene_File.prototype.createHelpWindow = function() {
  1035.     this._helpWindow = new Window_Help(2);
  1036.     this._helpWindow.setText(Yanfly.Param.SaveHelpSelect);
  1037.     this.addWindow(this._helpWindow);
  1038. };

  1039. Scene_File.prototype.createListWindow = function() {
  1040.     var x = 0;
  1041.     var y = this._helpWindow.height;
  1042.     var width = 240;
  1043.     var height = Graphics.boxHeight - y;
  1044.     this._listWindow = new Window_SavefileList(x, y, width, height);
  1045.     this.addWindow(this._listWindow);
  1046.     this._listWindow.setHandler('ok',     this.onSavefileOk.bind(this));
  1047.     this._listWindow.setHandler('cancel', this.popScene.bind(this));
  1048.     this._listWindow.select(this.firstSavefileIndex());
  1049.     this._listWindow.setTopRow(this.firstSavefileIndex() - 2);
  1050.     this._listWindow.setMode(this.mode());
  1051.     this._listWindow.refresh();
  1052.    
  1053. };

  1054. Scene_File.prototype.createActionWindow = function() {
  1055.     var x = this._listWindow.width;
  1056.     var y = this._listWindow.y;
  1057.     this._actionWindow = new Window_SaveAction(x, y, this.mode());
  1058.     this.addWindow(this._actionWindow);
  1059.     this._actionWindow.setHelpWindow(this._helpWindow);
  1060.     this._actionWindow.setHandler('load', this.onActionLoad.bind(this));
  1061.     this._actionWindow.setHandler('save', this.onActionSave.bind(this));
  1062.     this._actionWindow.setHandler('delete', this.onActionDelete.bind(this));
  1063.     this._actionWindow.setHandler('cancel', this.onActionCancel.bind(this));
  1064. };

  1065. Scene_File.prototype.createInfoWindow = function() {
  1066.     var x = this._actionWindow.x;
  1067.     var y = this._actionWindow.y + this._actionWindow.height;
  1068.     var width = Graphics.boxWidth - x;
  1069.     var height = Graphics.boxHeight - y;
  1070.     this._infoWindow = new Window_SaveInfo(x, y, width, height, this.mode());
  1071.     this.addWindow(this._infoWindow);
  1072. };

  1073. Scene_File.prototype.createConfirmWindow = function() {
  1074.     this._confirmWindow = new Window_SaveConfirm();
  1075.     var win = this._confirmWindow;
  1076.     win.setHandler('confirm', this.onConfirmOk.bind(this));
  1077.     win.setHandler('cancel',  this.onConfirmCancel.bind(this));
  1078.     this.addWindow(this._confirmWindow);
  1079. };

  1080. Scene_File.prototype.onSavefileOk = function() {
  1081.     this._actionWindow.activate();
  1082.     if (this.mode() === 'load') {
  1083.       this._actionWindow.select(0);
  1084.     } else if (this.mode() === 'save') {
  1085.       this._actionWindow.select(1);
  1086.     }
  1087. };

  1088. Scene_Save.prototype.onSavefileOk = function() {
  1089.     Scene_File.prototype.onSavefileOk.call(this);
  1090. };

  1091. Scene_Load.prototype.onSavefileOk = function() {
  1092.     Scene_File.prototype.onSavefileOk.call(this);
  1093. };

  1094. Scene_File.prototype.onActionLoad = function() {
  1095.     if (Yanfly.Param.SaveConfirmLoad) {
  1096.       this.startConfirmWindow(Yanfly.Param.SaveConfirmLoadTx);
  1097.     } else {
  1098.       this.performActionLoad();
  1099.     }
  1100. };

  1101. Scene_File.prototype.performActionLoad = function() {
  1102.     if (DataManager.loadGame(this.savefileId())) {
  1103.         this.onLoadSuccess();
  1104.     } else {
  1105.         this.onLoadFailure();
  1106.     }
  1107. };

  1108. Scene_File.prototype.onLoadSuccess = function() {
  1109.     SoundManager.playLoad();
  1110.     this.fadeOutAll();
  1111.     this.reloadMapIfUpdated();
  1112.     SceneManager.goto(Scene_Map);
  1113.     this._loadSuccess = true;
  1114. };

  1115. Scene_Load.prototype.onLoadSuccess = function() {
  1116.     Scene_File.prototype.onLoadSuccess.call(this);
  1117. };

  1118. Scene_File.prototype.onLoadFailure = function() {
  1119.     SoundManager.playBuzzer();
  1120.     this.onActionCancel();
  1121. };

  1122. Scene_Load.prototype.onLoadFailure = function() {
  1123.     Scene_File.prototype.onLoadFailure.call(this);
  1124. };

  1125. Scene_File.prototype.reloadMapIfUpdated = function() {
  1126.   if ($gameSystem.versionId() === $dataSystem.versionId) return;
  1127.   $gamePlayer.reserveTransfer($gameMap.mapId(), $gamePlayer.x, $gamePlayer.y);
  1128.   $gamePlayer.requestMapReload();
  1129. };

  1130. Scene_File.prototype.onActionSave = function() {
  1131.   var id = this.savefileId();
  1132.   if (Yanfly.Param.SaveConfirmSave && StorageManager.exists(id)) {
  1133.     this.startConfirmWindow(Yanfly.Param.SaveConfirmSaveTx);
  1134.   } else {
  1135.     this.performActionSave();
  1136.   }
  1137. };

  1138. Scene_File.prototype.performActionSave = function() {
  1139.     $gameSystem.onBeforeSave();
  1140.     if (DataManager.saveGame(this.savefileId())) {
  1141.       this.onSaveSuccess();
  1142.     } else {
  1143.       this.onSaveFailure();
  1144.     }
  1145. };

  1146. Scene_File.prototype.onSaveSuccess = function() {
  1147.     SoundManager.playSave();
  1148.     StorageManager.cleanBackup(this.savefileId());
  1149.     if (Yanfly.Param.SavePop) {
  1150.       this.popScene();
  1151.     } else {
  1152.       this._listWindow.refresh();
  1153.       this._actionWindow._currentFile = this.savefileId() - 1;
  1154.       this._infoWindow._currentFile = this.savefileId() - 1;
  1155.       this.onActionCancel();
  1156.     }
  1157. };

  1158. Scene_Save.prototype.onSaveSuccess = function() {
  1159.     Scene_File.prototype.onSaveSuccess.call(this);
  1160. };

  1161. Scene_File.prototype.onSaveFailure = function() {
  1162.     SoundManager.playBuzzer();
  1163.     this.onActionCancel();
  1164. };

  1165. Scene_Save.prototype.onSaveFailure = function() {
  1166.     Scene_File.prototype.onSaveFailure.call(this);
  1167. };

  1168. Scene_File.prototype.onActionDelete = function() {
  1169.     if (Yanfly.Param.SaveConfirmDel) {
  1170.       this.startConfirmWindow(Yanfly.Param.SaveConfirmDelTx);
  1171.     } else {
  1172.       this.performActionDelete();
  1173.     }
  1174. };

  1175. Scene_File.prototype.performActionDelete = function() {
  1176.     AudioManager.playSe(Yanfly.Param.SaveDeleteSound);
  1177.     StorageManager.remove(this.savefileId());
  1178.     this.onActionCancel();
  1179.     this._listWindow.refresh();
  1180.     this._actionWindow._currentFile = this.savefileId() - 1;
  1181.     this._infoWindow._currentFile = this.savefileId() - 1;
  1182. };

  1183. Scene_File.prototype.onActionCancel = function() {
  1184.     this._actionWindow.deselect();
  1185.     this._listWindow.activate();
  1186.     this._helpWindow.setText(Yanfly.Param.SaveHelpSelect);
  1187. };

  1188. Scene_File.prototype.startConfirmWindow = function(text) {
  1189.     SoundManager.playOk();
  1190.     this._confirmWindow.setData(text);
  1191.     this._confirmWindow.open();
  1192.     this._confirmWindow.activate();
  1193.     this._confirmWindow.select(0);
  1194. };

  1195. Scene_File.prototype.onConfirmOk = function() {
  1196.     this._confirmWindow.deactivate();
  1197.     this._confirmWindow.close();
  1198.     if (this._actionWindow.currentSymbol() === 'load') {
  1199.       setTimeout(this.performActionLoad.bind(this), 200);
  1200.     } else if (this._actionWindow.currentSymbol() === 'save') {
  1201.       setTimeout(this.performActionSave.bind(this), 200);
  1202.     } else if (this._actionWindow.currentSymbol() === 'delete') {
  1203.       setTimeout(this.performActionDelete.bind(this), 200);
  1204.     } else {
  1205.       this.onConfirmCancel();
  1206.     }
  1207. };

  1208. Scene_File.prototype.onConfirmCancel = function() {
  1209.     var index = this._actionWindow.index();
  1210.     this._confirmWindow.deactivate();
  1211.     this._confirmWindow.close();
  1212.     this.onSavefileOk();
  1213.     this._actionWindow.select(index);
  1214. };

  1215. //=============================================================================
  1216. // Utilities
  1217. //=============================================================================

  1218. Yanfly.Util = Yanfly.Util || {};

  1219. if (!Yanfly.Util.toGroup) {
  1220.     Yanfly.Util.toGroup = function(inVal) {
  1221.         return inVal;
  1222.     }
  1223. };

  1224. //=============================================================================
  1225. // End of File
  1226. //=============================================================================
复制代码




梦石
0
星屑
7427
在线时间
948 小时
注册时间
2017-9-27
回帖
566
发表于 2017-11-3 23:57:48 | 显示全部楼层
出错时你按一下F8,把控制台显示的信息贴出来。

点评

大神,图已补 , 求帮助。  发表于 2017-11-5 20:51
回复

使用道具 举报

梦石
0
星屑
7427
在线时间
948 小时
注册时间
2017-9-27
回帖
566
发表于 2017-11-5 21:08:37 | 显示全部楼层
第一行显示的'Mhe'是什么?还有那个'LeNotification.js'是个什么插件?

点评

报错提示跟上图第二张图的报错情况一样。  发表于 2017-11-6 12:00
LeNotification.js 是我打的一个物品丢失显示插件,Mhe不知道是什么,我把LeNotification关掉后运行还是报错。  发表于 2017-11-6 11:59
回复

使用道具 举报

梦石
0
星屑
67
在线时间
11 小时
注册时间
2020-2-19
回帖
1
发表于 2020-2-24 18:35:41 | 显示全部楼层
楼主, 你找到问题了吗?
我今天把插件js文件中出错的那句代码注释掉了, 就能运行了, 不知道后期会不会有问题.
求大佬回复
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部