设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1410|回复: 6
打印 上一主题 下一主题

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

[复制链接]

Lv2.观梦者

梦石
0
星屑
511
在线时间
187 小时
注册时间
2016-5-10
帖子
99
跳转到指定楼层
1
发表于 2017-11-3 23:55:16 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

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

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

                                           
F8报错图已补。

希望有大神帮忙解决下。
附上代码:
JAVASCRIPT 代码复制下载
  1. //=============================================================================
  2. // Yanfly Engine Plugins - Save Core
  3. // YEP_SaveCore.js
  4. //=============================================================================
  5.  
  6. var Imported = Imported || {};
  7. Imported.YEP_SaveCore = true;
  8.  
  9. var Yanfly = Yanfly || {};
  10. Yanfly.Save = Yanfly.Save || {};
  11. Yanfly.Save.version = 1.04;
  12.  
  13. //=============================================================================
  14. /*:
  15.  * @plugindesc v1.04 存档核心
  16.  * @author Yanfly Engine Plugins
  17.  *
  18.  * @param ---General---
  19.  * @default
  20.  *
  21.  * @param Max Files
  22.  * @desc The maximum number of files for your game.
  23.  * Default: 20
  24.  * @default 24
  25.  *
  26.  * @param Saved Icon
  27.  * @desc Icon ID used for a file slot with a save.
  28.  * @default 231
  29.  *
  30.  * @param Empty Icon
  31.  * @desc Icon ID used for an empty file slot.
  32.  * @default 230
  33.  *
  34.  * @param Return After Saving
  35.  * @desc Return to the previous scene after saving?
  36.  * NO - false     YES - true     Default: true
  37.  * @default false
  38.  *
  39.  * @param Auto New Index
  40.  * @desc For new games, automatically decide the save slot?
  41.  * NO - false     YES - true     Default: true
  42.  * @default true
  43.  *
  44.  * @param ---Action Window---
  45.  * @default
  46.  *
  47.  * @param Load Command
  48.  * @desc Text for the load command in the action window.
  49.  * @default Load
  50.  *
  51.  * @param Save Command
  52.  * @desc Text for the save command in the action window.
  53.  * @default Save
  54.  *
  55.  * @param Delete Command
  56.  * @desc Text for the delete command in the action window.
  57.  * @default Delete
  58.  *
  59.  * @param ---Help Window---
  60.  * @default
  61.  *
  62.  * @param Select Help
  63.  * @desc Help text displayed when selecting a slot.
  64.  * @default Please select a file slot.
  65.  *
  66.  * @param Load Help
  67.  * @desc Help text displayed when selecting load option.
  68.  * @default Loads the data from the saved game.
  69.  *
  70.  * @param Save Help
  71.  * @desc Help text displayed when selecting save option.
  72.  * @default Saves the current progress in your game.
  73.  *
  74.  * @param Delete Help
  75.  * @desc Help text displayed when selecting delete option.
  76.  * @default Deletes all data from this save file.
  77.  *
  78.  * @param ---Delete---
  79.  * @default
  80.  *
  81.  * @param Delete Filename
  82.  * @desc Used for the delete sound from the /audio/se/ folder.
  83.  * Do NOT include the file extension.
  84.  * @default Damage2
  85.  *
  86.  * @param Delete Volume
  87.  * @desc Volume used for the delete sound.
  88.  * @default 100
  89.  *
  90.  * @param Delete Pitch
  91.  * @desc Pitch used for the delete sound.
  92.  * @default 150
  93.  *
  94.  * @param Delete Pan
  95.  * @desc Pan used for the delete sound.
  96.  * @default 0
  97.  *
  98.  * @param ---Info Window---
  99.  * @default
  100.  *
  101.  * @param Show Game Title
  102.  * @desc Display the game title in the save file?
  103.  * NO - false     YES - true
  104.  * @default true
  105.  *
  106.  * @param Invalid Game Text
  107.  * @desc Text used when the save is for a different game.
  108.  * @default This save is for a different game.
  109.  *
  110.  * @param Empty Game Text
  111.  * @desc Text used when the save is empty.
  112.  * @default Empty
  113.  *
  114.  * @param Map Display Name
  115.  * @desc Use the display name for the saved map instead?
  116.  * NO - false     YES - true
  117.  * @default true
  118.  *
  119.  * @param Party Display
  120.  * @desc The display type used for the party.
  121.  * 0 - None; 1 - Characters; 2 - Faces; 3 - SV Actors
  122.  * @default 2
  123.  *
  124.  * @param Party Y Position
  125.  * @desc This is the base Y position for the party display.
  126.  * Formulas can be used.
  127.  * @default this.lineHeight() + Window_Base._faceHeight
  128.  *
  129.  * @param Show Actor Names
  130.  * @desc Display the names of the actors?
  131.  * NO - false     YES - true
  132.  * @default true
  133.  *
  134.  * @param Name Font Size
  135.  * @desc Font size used for names if names are displayed.
  136.  * Default: 28
  137.  * @default 20
  138.  *
  139.  * @param Show Actor Level
  140.  * @desc Display the levels of the actors?
  141.  * NO - false     YES - true
  142.  * @default true
  143.  *
  144.  * @param Level Font Size
  145.  * @desc Font size used for levels if levels are displayed.
  146.  * Default: 28
  147.  * @default 20
  148.  *
  149.  * @param Level Format
  150.  * @desc The text format used to display levels.
  151.  * %1 - Lv (Abbr)   %2 - Lv (Full)     %3 - Value
  152.  * @default \c[16]%1 \c[0]%3
  153.  *
  154.  * @param Data Font Size
  155.  * @desc Font size used for displaying data.
  156.  * Default: 28
  157.  * @default 20
  158.  *
  159.  * @param Data Column 1
  160.  * @desc The data to be displayed in data column 1. Refer to help
  161.  * file for data entries. Separate each entry with commas.
  162.  * @default empty, playtime, save count, gold count
  163.  *
  164.  * @param Data Column 2
  165.  * @desc The data to be displayed in data column 2. Refer to help
  166.  * file for data entries. Separate each entry with commas.
  167.  * @default location, variable 1, variable 2, variable 3
  168.  *
  169.  * @param Data Column 3
  170.  * @desc The data to be displayed in data column 2. Refer to help
  171.  * file for data entries. Separate each entry with commas.
  172.  * @default empty, variable 4, variable 5, variable 6
  173.  *
  174.  * @param Data Column 4
  175.  * @desc The data to be displayed in data column 2. Refer to help
  176.  * file for data entries. Separate each entry with commas.
  177.  * @default
  178.  *
  179.  * @param ---Vocabulary---
  180.  * @default
  181.  *
  182.  * @param Map Location
  183.  * @desc Text used to categorize 'Map Location'.
  184.  * Leave empty to not use this category and center the data.
  185.  * @default
  186.  *
  187.  * @param Playtime
  188.  * @desc Text used to categorize 'Playtime'.
  189.  * Leave empty to not use this category and center the data.
  190.  * @default Playtime:
  191.  *
  192.  * @param Save Count
  193.  * @desc Text used to categorize 'Save Count'.
  194.  * Leave empty to not use this category and center the data.
  195.  * @default Total Saves:
  196.  *
  197.  * @param Gold Count
  198.  * @desc Text used to categorize 'Gold Count'.
  199.  * Leave empty to not use this category and center the data.
  200.  * @default %1:
  201.  *
  202.  * @param ---Technical---
  203.  * @default
  204.  *
  205.  * @param Save Mode
  206.  * @desc How the save system should work for your game:
  207.  * local     web     auto
  208.  * @default auto
  209.  *
  210.  * @param Local Config
  211.  * @desc Filename for config when working with local saves.
  212.  * Default: config.rpgsave
  213.  * @default config.rpgsave
  214.  *
  215.  * @param Local Global
  216.  * @desc Filename for global when working with local saves.
  217.  * Default: global.rpgsave
  218.  * @default global.rpgsave
  219.  *
  220.  * @param Local Save
  221.  * @desc Filename for game saves when working with local saves.
  222.  * %1 - File Slot. Default: config.rpgsave
  223.  * @default file%1.rpgsave
  224.  *
  225.  * @param Web Config
  226.  * @desc Filename for config when working with web saves.
  227.  * %1 - Game Name. Default: RPG Config
  228.  * @default RPG %1 Config
  229.  *
  230.  * @param Web Global
  231.  * @desc Filename for global when working with web saves.
  232.  * %1 - Game Name. Default: RPG Global
  233.  * @default RPG %1 Global
  234.  *
  235.  * @param Web Save
  236.  * @desc Filename for game saves when working with web saves.
  237.  * %1 - Game Name. %2 - File Slot. Default: RPG File%1
  238.  * @default RPG %1 File%2
  239.  *
  240.  * @param ---Confirmation---
  241.  * @default
  242.  *
  243.  * @param Load Confirmation
  244.  * @desc Show the load confirmation window when loading a
  245.  * save file? NO - false     YES - true
  246.  * @default true
  247.  *
  248.  * @param Load Text
  249.  * @desc Text displayed when loading a save file.
  250.  * @default Do you wish to load this save file?
  251.  *
  252.  * @param Save Confirmation
  253.  * @desc Show the save confirmation window when overwriting a
  254.  * save file? NO - false     YES - true
  255.  * @default true
  256.  *
  257.  * @param Save Text
  258.  * @desc Text displayed when overwriting a save file.
  259.  * @default Do you wish to overwrite this save file?
  260.  *
  261.  * @param Delete Confirmation
  262.  * @desc Show the save confirmation window when deleting a
  263.  * save file? NO - false     YES - true
  264.  * @default true
  265.  *
  266.  * @param Delete Text
  267.  * @desc Text displayed when deleting a save file.
  268.  * @default Do you wish to delete this save file?
  269.  *
  270.  * @param Confirm Yes
  271.  * @desc Text used for the 'Yes' confirm command
  272.  * @default Yes
  273.  *
  274.  * @param Confirm No
  275.  * @desc Text used for the 'No' confirm command
  276.  * @default No
  277.  *
  278.  * @help
  279.  * ============================================================================
  280.  * Introduction
  281.  * ============================================================================
  282.  *
  283.  * 注意:这个插件只支持1.1.0以上的版本
  284.  * 这个插件提供了一个新的存档界面。通过这个新的界面,玩家可以直接从菜单载入
  285.  * 或者删除存档,这也将导致存档命令一直显示在之菜单,但是我们可以关闭或者开
  286.  * 启存档选项。从这个界面,玩家可以获得存档的各类信息,例如位置,金钱树,或
  287.  * 者任何你想展示的变量。
  288.  *
  289.  * ============================================================================
  290.  * Instructions - Data Columns
  291.  * ============================================================================
  292.  *
  293.  * 对于那些想在每个存档显示额外信息的人,你可以添加插件参数里面的Data
  294.  * Columns,用逗号隔开。你可以使用下面的标签
  295.  *
  296.  * Data Column Categories:
  297.  *
  298.  *   Empty
  299.  *   - 显示一个空位置,但是没有外框
  300.  *
  301.  *   Null
  302.  *   - 显示一个空位置,但是有外框
  303.  *
  304.  *   Location
  305.  *   - 地图坐标
  306.  *
  307.  *   Playtime
  308.  *   - 游戏时间
  309.  *
  310.  *   Save Count
  311.  *   - 存档数
  312.  *
  313.  *   Gold Count
  314.  *   - 金钱数
  315.  *
  316.  *   Variable x
  317.  *   -显示变量的名字和值。你可以使用文本代码。任何在<< >>里面的都不会被显示。如
  318.  *   果没有变量名,变量的值就会居中
  319.  *
  320.  *   text: stuff
  321.  *   left text: stuff
  322.  *   center text: stuff
  323.  *   right text: stuff
  324.  *   -这将显示自定义文本。可以设置显示位置,默认是居左对齐。
  325.  *
  326.  * ============================================================================
  327.  * Technical - Save Modes
  328.  * ============================================================================
  329.  *
  330.  * 对于想要在网上发布游戏的开发者,你可以看一看Technical里的参数。你可以设置
  331.  * 游戏模式,是“本地”,还是“网站”。默认你可以设置为“自动”。如果是为了
  332.  * 测试目的,你可以在本地运行时设置web模式。如果游戏运行在网站上,你不可以使
  333.  * 用本地模式。
  334.  *
  335.  * ============================================================================
  336.  * Technical - Save Files
  337.  * ============================================================================
  338.  *
  339.  * 如果你有经验,你可以根据喜好设置'Local Config', 'Local Global', 和 'Local
  340.  * Save'的名字
  341.  *
  342.  * ---
  343.  *
  344.  * 如果你正在做网站包括移动端的游戏,我建议你看下'Web Config', 'Web Global'
  345.  * 和'Web Save'的参数。所以运行在网站上的游戏都会使用相同的设置。
  346.  *
  347.  * This plugin's default settings will solve this sharing issue by making the
  348.  * web save named accordingly to your game's name provided that you keep the
  349.  * current plugin settings as is or adjust it accordingly. Now, your game will
  350.  * have its own individual identity, use its own configuration, global, and
  351.  * save files without clashing with any other RPG Maker MV games players may
  352.  * have played.这个插件默认设置解决了网站游戏存档奔溃的一些问题
  353.  *
  354.  * ============================================================================
  355.  * Changelog
  356.  * ============================================================================
  357.  *
  358.  * Version 1.04:
  359.  * - Added 'Map Display Name' plugin parameter. Enabling this option will now
  360.  * display the display name for the map instead of the editor name.
  361.  *
  362.  * Version 1.03:
  363.  * - Fixed a bug that caused web saving to not work properly.
  364.  *
  365.  * Version 1.02:
  366.  * - Fixed a bug that caused the actor's default name to appear in the save
  367.  * screen instead of the actor's current name (if it was changed.)
  368.  *
  369.  * Version 1.01:
  370.  * - Added a wait time update for save info data to load when moving across the
  371.  * various save files.
  372.  *
  373.  * Version 1.00:
  374.  * - Finished Plugin!
  375.  */
  376. //=============================================================================
  377.  
  378. //=============================================================================
  379. // Parameter Variables
  380. //=============================================================================
  381.  
  382. Yanfly.Parameters = PluginManager.parameters('YEP_SaveCore');
  383. Yanfly.Param = Yanfly.Param || {};
  384.  
  385. Yanfly.Param.SaveMaxFiles = Number(Yanfly.Parameters['Max Files']);
  386. Yanfly.Param.SaveIconSaved = Number(Yanfly.Parameters['Saved Icon']);
  387. Yanfly.Param.SaveIconEmpty = Number(Yanfly.Parameters['Empty Icon']);
  388. Yanfly.Param.SavePop = eval(String(Yanfly.Parameters['Return After Saving']));
  389. Yanfly.Param.SaveAutoIndex = eval(String(Yanfly.Parameters['Auto New Index']));
  390.  
  391. Yanfly.Param.SaveCmdLoad = String(Yanfly.Parameters['Load Command']);
  392. Yanfly.Param.SaveCmdSave = String(Yanfly.Parameters['Save Command']);
  393. Yanfly.Param.SaveCmdDelete = String(Yanfly.Parameters['Delete Command']);
  394.  
  395. Yanfly.Param.SaveHelpSelect = String(Yanfly.Parameters['Select Help']);
  396. Yanfly.Param.SaveLoadSelect = String(Yanfly.Parameters['Load Help']);
  397. Yanfly.Param.SaveSaveSelect = String(Yanfly.Parameters['Save Help']);
  398. Yanfly.Param.SaveDeleteSelect = String(Yanfly.Parameters['Delete Help']);
  399.  
  400. Yanfly.Param.SaveDeleteSound = {
  401.   name:   String(Yanfly.Parameters['Delete Filename']),
  402.   volume: Number(Yanfly.Parameters['Delete Volume']),
  403.   pitch:  Number(Yanfly.Parameters['Delete Pitch']),
  404.   pan:    Number(Yanfly.Parameters['Delete Pan'])
  405. };
  406.  
  407. Yanfly.Param.SaveInfoTitle = String(Yanfly.Parameters['Show Game Title']);
  408. Yanfly.Param.SaveInfoTitle = eval(Yanfly.Param.SaveInfoTitle);
  409. Yanfly.Param.SaveInfoInvalid = String(Yanfly.Parameters['Invalid Game Text']);
  410. Yanfly.Param.SaveInfoEmpty = String(Yanfly.Parameters['Empty Game Text']);
  411. Yanfly.Param.SaveMapDisplayName = String(Yanfly.Parameters['Map Display Name']);
  412. Yanfly.Param.SaveMapDisplayName = eval(Yanfly.Param.SaveMapDisplayName);
  413. Yanfly.Param.SaveInfoPartyType = Number(Yanfly.Parameters['Party Display']);
  414. Yanfly.Param.SaveInfoPartyType = Yanfly.Param.SaveInfoPartyType.clamp(0, 3);
  415. Yanfly.Param.SaveInfoPartyY = String(Yanfly.Parameters['Party Y Position']);
  416. Yanfly.Param.SaveInfoActorName = String(Yanfly.Parameters['Show Actor Names']);
  417. Yanfly.Param.SaveInfoActorName = eval(Yanfly.Param.SaveInfoActorName);
  418. Yanfly.Param.SaveInfoActorNameSz = Number(Yanfly.Parameters['Name Font Size']);
  419. Yanfly.Param.SaveInfoActorLv = String(Yanfly.Parameters['Show Actor Level']);
  420. Yanfly.Param.SaveInfoActorLv = eval(Yanfly.Param.SaveInfoActorLv);
  421. Yanfly.Param.SaveInfoActorLvSz = Number(Yanfly.Parameters['Level Font Size']);
  422. Yanfly.Param.SaveInfoActorLvFmt = String(Yanfly.Parameters['Level Format']);
  423. Yanfly.Param.SaveInfoDataSz = Number(Yanfly.Parameters['Data Font Size']);
  424. Yanfly.Param.SaveInfoDataCol1 = String(Yanfly.Parameters['Data Column 1']);
  425. Yanfly.Param.SaveInfoDataCol1 = Yanfly.Param.SaveInfoDataCol1.split(',');
  426. Yanfly.Param.SaveInfoDataCol2 = String(Yanfly.Parameters['Data Column 2']);
  427. Yanfly.Param.SaveInfoDataCol2 = Yanfly.Param.SaveInfoDataCol2.split(',');
  428. Yanfly.Param.SaveInfoDataCol3 = String(Yanfly.Parameters['Data Column 3']);
  429. Yanfly.Param.SaveInfoDataCol3 = Yanfly.Param.SaveInfoDataCol3.split(',');
  430. Yanfly.Param.SaveInfoDataCol4 = String(Yanfly.Parameters['Data Column 4']);
  431. Yanfly.Param.SaveInfoDataCol4 = Yanfly.Param.SaveInfoDataCol4.split(',');
  432.  
  433. Yanfly.trimSaveDataColumns = function(array) {
  434.   var length = array.length;
  435.   for (var i = 0; i < length; ++i) {
  436.     array[i] = array[i].trim();
  437.   }
  438.   if (length === 1 && array[0] === '') array.splice(0);
  439. };
  440.  
  441. Yanfly.trimSaveDataColumns(Yanfly.Param.SaveInfoDataCol1);
  442. Yanfly.trimSaveDataColumns(Yanfly.Param.SaveInfoDataCol2);
  443. Yanfly.trimSaveDataColumns(Yanfly.Param.SaveInfoDataCol3);
  444. Yanfly.trimSaveDataColumns(Yanfly.Param.SaveInfoDataCol4);
  445.  
  446. Yanfly.Param.SaveVocabLocation = String(Yanfly.Parameters['Map Location']);
  447. Yanfly.Param.SaveVocabPlaytime = String(Yanfly.Parameters['Playtime']);
  448. Yanfly.Param.SaveVocabSaveCount = String(Yanfly.Parameters['Save Count']);
  449. Yanfly.Param.SaveVocabGoldCount = String(Yanfly.Parameters['Gold Count']);
  450.  
  451. Yanfly.Param.SaveTechSaveMode = String(Yanfly.Parameters['Save Mode']).trim();
  452. Yanfly.Param.SaveTechSaveMode = Yanfly.Param.SaveTechSaveMode.toLowerCase();
  453. Yanfly.Param.SaveTechLocalConfig = String(Yanfly.Parameters['Local Config']);
  454. Yanfly.Param.SaveTechLocalGlobal = String(Yanfly.Parameters['Local Global']);
  455. Yanfly.Param.SaveTechLocalSave = String(Yanfly.Parameters['Local Save']);
  456. Yanfly.Param.SaveTechWebConfig = String(Yanfly.Parameters['Web Config']);
  457. Yanfly.Param.SaveTechWebGlobal = String(Yanfly.Parameters['Web Global']);
  458. Yanfly.Param.SaveTechWebSave = String(Yanfly.Parameters['Web Save']);
  459.  
  460. Yanfly.Param.SaveConfirmLoad = String(Yanfly.Parameters['Load Confirmation']);
  461. Yanfly.Param.SaveConfirmLoad = eval(Yanfly.Param.SaveConfirmLoad);
  462. Yanfly.Param.SaveConfirmLoadTx = String(Yanfly.Parameters['Load Text']);
  463. Yanfly.Param.SaveConfirmSave = String(Yanfly.Parameters['Save Confirmation']);
  464. Yanfly.Param.SaveConfirmSave = eval(Yanfly.Param.SaveConfirmSave);
  465. Yanfly.Param.SaveConfirmSaveTx = String(Yanfly.Parameters['Save Text']);
  466. Yanfly.Param.SaveConfirmDel = String(Yanfly.Parameters['Delete Confirmation']);
  467. Yanfly.Param.SaveConfirmDel = eval(Yanfly.Param.SaveConfirmDel);
  468. Yanfly.Param.SaveConfirmDelTx = String(Yanfly.Parameters['Delete Text']);
  469. Yanfly.Param.SaveConfirmYes = String(Yanfly.Parameters['Confirm Yes']);
  470. Yanfly.Param.SaveConfirmNo = String(Yanfly.Parameters['Confirm No']);
  471.  
  472. //=============================================================================
  473. // DataManager
  474. //=============================================================================
  475.  
  476. DataManager.maxSavefiles = function() {
  477.     return Yanfly.Param.SaveMaxFiles;
  478. };
  479.  
  480. Yanfly.Save.DataManager_selectSavefileForNewGame =
  481.     DataManager.selectSavefileForNewGame;
  482. DataManager.selectSavefileForNewGame = function() {
  483.     Yanfly.Save.DataManager_selectSavefileForNewGame.call(this);
  484.     if (Yanfly.Param.SaveAutoIndex) return;
  485.     this._lastAccessedId = 1;
  486. };
  487.  
  488. Yanfly.Save.DataManager_makeSaveContents = DataManager.makeSaveContents;
  489. DataManager.makeSaveContents = function() {
  490.   var contents = Yanfly.Save.DataManager_makeSaveContents.call(this);
  491.   contents.map.locationDisplayName = $dataMap.displayName;
  492.   return contents;
  493. };
  494.  
  495. //=============================================================================
  496. // StorageManager
  497. //=============================================================================
  498.  
  499. Yanfly.Save.StorageManager_isLocalMode = StorageManager.isLocalMode;
  500. StorageManager.isLocalMode = function() {
  501.   if (Yanfly.Param.SaveTechSaveMode === 'local') {
  502.     if (!Utils.isNwjs()) return false;
  503.     return true;
  504.   } else if (Yanfly.Param.SaveTechSaveMode === 'web') {
  505.     return false;
  506.   } else {
  507.     return Yanfly.Save.StorageManager_isLocalMode.call(this);
  508.   }
  509. };
  510.  
  511. StorageManager.localFilePath = function(savefileId) {
  512.   var name;
  513.   if (savefileId < 0) {
  514.     name = Yanfly.Param.SaveTechLocalConfig;
  515.   } else if (savefileId === 0) {
  516.     name = Yanfly.Param.SaveTechLocalGlobal;
  517.   } else {
  518.     name = Yanfly.Param.SaveTechLocalSave.format(savefileId);
  519.   }
  520.   return this.localFileDirectoryPath() + name;
  521. };
  522.  
  523. Yanfly.Save.StorageManager_webStorageKey = StorageManager.webStorageKey;
  524. StorageManager.webStorageKey = function(savefileId) {
  525.   if (!$dataSystem) return Yanfly.Save.StorageManager_webStorageKey.call(this);
  526.   var title = $dataSystem.gameTitle;
  527.   this.loadConfig();
  528.   if (savefileId < 0) {
  529.     return Yanfly.Param.SaveTechWebConfig.format(title);
  530.   } else if (savefileId === 0) {
  531.     return Yanfly.Param.SaveTechWebGlobal.format(title);
  532.   } else {
  533.     return Yanfly.Param.SaveTechWebSave.format(title, savefileId);
  534.   }
  535. };
  536.  
  537. StorageManager.loadConfig = function() {
  538.   if (this._configLoaded) return;
  539.   this._configLoaded = true;
  540.   ConfigManager.load();
  541. };
  542.  
  543. //=============================================================================
  544. // BattleManager
  545. //=============================================================================
  546.  
  547. Yanfly.Save.BattleManager_setBattleTest = BattleManager.setBattleTest;
  548. BattleManager.setBattleTest = function(battleTest) {
  549.     Yanfly.Save.BattleManager_setBattleTest.call(this, battleTest);
  550.     if (battleTest) StorageManager.loadConfig();
  551. };
  552.  
  553. //=============================================================================
  554. // Window_Base
  555. //=============================================================================
  556.  
  557. Window_Base.prototype.drawSvActor = function(actor, x, y) {
  558.     var filename = actor.battlerName();
  559.     var bitmap = ImageManager.loadSvActor(filename);
  560.     var pw = bitmap.width / 9;
  561.     var ph = bitmap.height / 6;
  562.     var sx = 0;
  563.     var sy = 0;
  564.     this.contents.blt(bitmap, sx, sy, pw, ph, x - pw / 2, y - ph);
  565. };
  566.  
  567. Window_Base.prototype.textWidthEx = function(text) {
  568.     return this.drawTextEx(text, 0, this.contents.height);
  569. };
  570.  
  571. //=============================================================================
  572. // Window_MenuCommand
  573. //=============================================================================
  574.  
  575. Window_MenuCommand.prototype.isSaveEnabled = function() {
  576.     if (DataManager.isEventTest()) return false;
  577.     return true;
  578. };
  579.  
  580. //=============================================================================
  581. // Window_SavefileList
  582. //=============================================================================
  583.  
  584. Window_SavefileList.prototype.itemHeight = function() {
  585.     return this.lineHeight();
  586. };
  587.  
  588. Window_SavefileList.prototype.drawItem = function(index) {
  589.     var id = index + 1;
  590.     var valid = DataManager.isThisGameFile(id);
  591.     var rect = this.itemRect(index);
  592.     this.resetTextColor();
  593.     //if (this._mode === 'load') this.changePaintOpacity(valid);
  594.     this.changePaintOpacity(valid);
  595.     var icon = valid ? Yanfly.Param.SaveIconSaved : Yanfly.Param.SaveIconEmpty;
  596.     this.drawIcon(icon, rect.x + 2, rect.y + 2);
  597.     this.drawFileId(id, rect.x + Window_Base._iconWidth + 4, rect.y);
  598. };
  599.  
  600. Window_SavefileList.prototype.playOkSound = function() {
  601.     Window_Selectable.prototype.playOkSound.call(this);
  602. };
  603.  
  604. //=============================================================================
  605. // Window_SaveAction
  606. //=============================================================================
  607.  
  608. function Window_SaveAction() {
  609.     this.initialize.apply(this, arguments);
  610. }
  611.  
  612. Window_SaveAction.prototype = Object.create(Window_HorzCommand.prototype);
  613. Window_SaveAction.prototype.constructor = Window_SaveAction;
  614.  
  615. Window_SaveAction.prototype.initialize = function(x, y, mode) {
  616.     this._width = Graphics.boxWidth - x;
  617.     this._currentFile = 0;
  618.     this._mode = mode;
  619.     Window_HorzCommand.prototype.initialize.call(this, x, y);
  620.     this.deactivate();
  621.     this.deselect();
  622. };
  623.  
  624. Window_SaveAction.prototype.windowWidth = function() {
  625.     return this._width;
  626. };
  627.  
  628. Window_SaveAction.prototype.maxCols = function() {
  629.     return 3;
  630. };
  631.  
  632. Window_SaveAction.prototype.savefileId = function() {
  633.     return SceneManager._scene._listWindow.index() + 1;
  634. };
  635.  
  636. Window_SaveAction.prototype.makeCommandList = function() {
  637.     var id = this.savefileId();
  638.     var enabled = DataManager.isThisGameFile(id);
  639.     var valid = DataManager.loadSavefileInfo(id);
  640.     this.addCommand(this.getCommandName('load'), 'load', valid);
  641.     this.addCommand(this.getCommandName('save'), 'save', this.isSaveEnabled());
  642.     this.addCommand(this.getCommandName('delete'), 'delete', enabled);
  643. };
  644.  
  645. Window_SaveAction.prototype.getCommandName = function(type) {
  646.     if (type === 'load') {
  647.       return Yanfly.Param.SaveCmdLoad;
  648.     } else if (type === 'save') {
  649.       return Yanfly.Param.SaveCmdSave;
  650.     } else {
  651.       return Yanfly.Param.SaveCmdDelete;
  652.     }
  653. };
  654.  
  655. Window_SaveAction.prototype.isSaveEnabled = function() {
  656.     if (this._mode !== 'save') return false;
  657.     return $gameSystem.isSaveEnabled();
  658. };
  659.  
  660. Window_SaveAction.prototype.update = function() {
  661.     Window_HorzCommand.prototype.update.call(this);
  662.     if (this.savefileId() !== this._currentFile) this.updateIndex();
  663. };
  664.  
  665. Window_SaveAction.prototype.updateIndex = function() {
  666.     this._currentFile = this.savefileId();
  667.     this.refresh();
  668. };
  669.  
  670. Window_SaveAction.prototype.playOkSound = function() {
  671. };
  672.  
  673. Window_SaveAction.prototype.updateHelp = function() {
  674.     var text = '';
  675.     if (this.currentSymbol() === 'load') {
  676.       text = Yanfly.Param.SaveLoadSelect;
  677.     } else if (this.currentSymbol() === 'save') {
  678.       text = Yanfly.Param.SaveSaveSelect;
  679.     } else if (this.currentSymbol() === 'delete') {
  680.       text = Yanfly.Param.SaveDeleteSelect;
  681.     }
  682.     this._helpWindow.setText(text);
  683. };
  684.  
  685. //=============================================================================
  686. // Window_SaveInfo
  687. //=============================================================================
  688.  
  689. function Window_SaveInfo() {
  690.     this.initialize.apply(this, arguments);
  691. }
  692.  
  693. Window_SaveInfo.prototype = Object.create(Window_Base.prototype);
  694. Window_SaveInfo.prototype.constructor = Window_SaveInfo;
  695.  
  696. Window_SaveInfo.prototype.initialize = function(x, y, width, height, mode) {
  697.   this._currentFile = 0;
  698.   this._waitTime = 0;
  699.   this._mode = mode;
  700.   Window_Base.prototype.initialize.call(this, x, y, width, height);
  701. };
  702.  
  703. Window_SaveInfo.prototype.resetFontSettings = function() {
  704.   Window_Base.prototype.resetFontSettings.call(this);
  705.   if (this._drawLevel) this.contents.fontSize = Yanfly.Param.SaveInfoActorLvSz;
  706.   if (this._drawData) this.contents.fontSize = Yanfly.Param.SaveInfoDataSz;
  707. };
  708.  
  709. Window_SaveInfo.prototype.savefileId = function() {
  710.   return SceneManager._scene._listWindow.index() + 1;
  711. };
  712.  
  713. Window_SaveInfo.prototype.drawDarkRect = function(dx, dy, dw, dh) {
  714.   var color = this.gaugeBackColor();
  715.   this.changePaintOpacity(false);
  716.   this.contents.fillRect(dx + 1, dy + 1, dw - 2, dh - 2, color);
  717.   this.changePaintOpacity(true);
  718. };
  719.  
  720. Window_SaveInfo.prototype.update = function() {
  721.   Window_Base.prototype.update.call(this);
  722.   if (this.savefileId() !== this._currentFile) this.updateIndex();
  723.   if (this._waitTime > 0) this.updateTimer();
  724. };
  725.  
  726. Window_SaveInfo.prototype.systemColorEx = function() {
  727.     if (Imported.YEP_CoreEngine) {
  728.       return '\\c[' + Yanfly.Param.ColorSystem + ']';
  729.     } else {
  730.       return '\\c[16]';
  731.     }
  732. };
  733.  
  734. Window_SaveInfo.prototype.updateIndex = function() {
  735.   var id = this.savefileId();
  736.   this._currentFile = id;
  737.   this._waitTime = 30;
  738.   this.contents.clear();
  739. };
  740.  
  741. Window_SaveInfo.prototype.updateTimer = function() {
  742.   this._waitTime -= 1;
  743.   if (this._waitTime > 0) return;
  744.   var id = this.savefileId();
  745.   this._valid = DataManager.isThisGameFile(id);
  746.   this._info = DataManager.loadSavefileInfo(id);
  747.   this.refresh();
  748. };
  749.  
  750. Window_SaveInfo.prototype.refresh = function() {
  751.   this.contents.clear();
  752.   this.resetFontSettings();
  753.   var dy = 0;
  754.   dy = this.drawGameTitle(dy);
  755.   if (!this._valid) return this.drawInvalidText(dy);
  756.   this._saveContents = StorageManager.load(this.savefileId());
  757.   this.drawContents(dy);
  758. };
  759.  
  760. Window_SaveInfo.prototype.drawGameTitle = function(dy) {
  761.   if (!Yanfly.Param.SaveInfoTitle) return dy;
  762.   if (!this._info) return dy;
  763.   if (!this._info.title) return dy;
  764.   this.resetFontSettings();
  765.   var text = this._info.title;
  766.   this.drawText(text, 0, dy, this.contents.width, 'center');
  767.   return dy + this.lineHeight();
  768. };
  769.  
  770. Window_SaveInfo.prototype.drawInvalidText = function(dy) {
  771.   this.drawDarkRect(0, dy, this.contents.width, this.contents.height - dy);
  772.   dy = (this.contents.height - dy - this.lineHeight()) / 2;
  773.   if (this._info) {
  774.     var text = Yanfly.Param.SaveInfoInvalid;
  775.   } else {
  776.     var text = Yanfly.Param.SaveInfoEmpty;
  777.   }
  778.   this.changeTextColor(this.systemColor());
  779.   this.drawText(text, 0, dy, this.contents.width, 'center');
  780. };
  781.  
  782. Window_SaveInfo.prototype.drawContents = function(dy) {
  783.   if (!this._saveContents) {
  784.     return setTimeout(this.drawContents.bind(this, dy), 50);
  785.   }
  786.   this._saveContents = JsonEx.parse(this._saveContents);
  787.   dy = this.drawPartyGraphics(dy);
  788.   dy = this.drawPartyNames(dy);
  789.   dy = this.drawPartyLevels(dy);
  790.   this.drawColumnData(dy);
  791. };
  792.  
  793. Window_SaveInfo.prototype.drawPartyGraphics = function(dy) {
  794.   if (Yanfly.Param.SaveInfoPartyType === 0) return dy;
  795.   dy = eval(Yanfly.Param.SaveInfoPartyY);
  796.   var length = this._saveContents.party.maxBattleMembers();
  797.   var dw = this.contents.width / length;;
  798.   dw = Math.floor(dw);
  799.   var dx = Math.floor(dw / 2);
  800.   for (var i = 0; i < length; ++i) {
  801.     var actorId = this._saveContents.party._actors[i];
  802.     var member = this._saveContents.actors._data[actorId];
  803.     if (member) {
  804.       if (Yanfly.Param.SaveInfoPartyType === 1) {
  805.         var name = member.characterName();
  806.         var index = member.characterIndex();
  807.         this.drawCharacter(name, index, dx, dy);
  808.       } else if (Yanfly.Param.SaveInfoPartyType === 2) {
  809.         var fh = Window_Base._faceHeight;
  810.         var fw = Window_Base._faceWidth;
  811.         var fx = dx - Math.floor(Math.min(fh, dw) / 2);
  812.         var dif = Math.floor(Math.max(0, dw - fw) / 2);
  813.         var name = member.faceName();
  814.         var index = member.faceIndex();
  815.         this.drawFace(name, index, fx - dif, dy - fh, dw, fh);
  816.       } else if (Yanfly.Param.SaveInfoPartyType === 3) {
  817.         this.drawSvActor(member, dx, dy);
  818.       }
  819.     }
  820.     dx += dw;
  821.   }
  822.   return dy;
  823. };
  824.  
  825. Window_SaveInfo.prototype.drawCharacter = function(name, index, x, y) {
  826.     var bitmap = ImageManager.loadCharacter(name);
  827.     if (bitmap.width <= 0) {
  828.       return setTimeout(this.drawCharacter.bind(this, name, index, x, y), 50);
  829.     }
  830.     Window_Base.prototype.drawCharacter.call(this, name, index, x, y);
  831. };
  832.  
  833. Window_SaveInfo.prototype.drawFace = function(name, index, x, y, w, h) {
  834.     var bitmap = ImageManager.loadFace(name);
  835.     if (bitmap.width <= 0) {
  836.       return setTimeout(this.drawFace.bind(this, name, index, x, y, w, h), 50);
  837.     }
  838.     Window_Base.prototype.drawFace.call(this, name, index, x, y, w, h);
  839. };
  840.  
  841. Window_SaveInfo.prototype.drawSvActor = function(actor, x, y) {
  842.     var filename = actor.battlerName();
  843.     var bitmap = ImageManager.loadSvActor(filename);
  844.     if (bitmap.width <= 0) {
  845.       return setTimeout(this.drawSvActor.bind(this, actor, x, y), 50);
  846.     }
  847.     Window_Base.prototype.drawSvActor.call(this, actor, x, y);
  848. };
  849.  
  850. Window_SaveInfo.prototype.drawPartyNames = function(dy) {
  851.   if (!Yanfly.Param.SaveInfoActorName) return dy;
  852.   this.resetFontSettings();
  853.   this.contents.fontSize = Yanfly.Param.SaveInfoActorNameSz;
  854.   var length = this._saveContents.party.maxBattleMembers();
  855.   var dw = this.contents.width / length;;
  856.   dw = Math.floor(dw);
  857.   var dx = 0;
  858.   for (var i = 0; i < length; ++i) {
  859.     var actorId = this._saveContents.party._actors[i];
  860.     var member = this._saveContents.actors._data[actorId];
  861.     if (member) {
  862.       var name = member._name;
  863.       this.drawText(name, dx, dy, dw, 'center');
  864.     }
  865.     dx += dw
  866.   }
  867.   return dy += this.lineHeight();
  868. };
  869.  
  870. Window_SaveInfo.prototype.drawPartyLevels = function(dy) {
  871.   if (!Yanfly.Param.SaveInfoActorLv) return dy;
  872.   this._drawLevel = true;
  873.   var length = this._saveContents.party.maxBattleMembers();
  874.   var dw = this.contents.width / length;;
  875.   dw = Math.floor(dw);
  876.   var dx = 0;
  877.   var fmt = Yanfly.Param.SaveInfoActorLvFmt;
  878.   for (var i = 0; i < length; ++i) {
  879.     var actorId = this._saveContents.party._actors[i];
  880.     var member = this._saveContents.actors._data[actorId];
  881.     if (member) {
  882.       var lv = Yanfly.Util.toGroup(member.level);
  883.       var text = fmt.format(TextManager.levelA, TextManager.level, lv);
  884.       var tw = this.textWidthEx(text);
  885.       var dif = Math.floor(Math.max(0, dw - tw) / 2);
  886.       this.drawTextEx(text, dx + dif, dy);
  887.     }
  888.     dx += dw
  889.   }
  890.   this._drawLevel = false;
  891.   return dy += this.lineHeight();
  892. };
  893.  
  894. Window_SaveInfo.prototype.drawColumnData = function(dy) {
  895.     var totalColumns = 0;
  896.     var drawnArrays = [];
  897.     if (Yanfly.Param.SaveInfoDataCol1.length > 0) {
  898.       totalColumns += 1;
  899.       drawnArrays.push(Yanfly.Param.SaveInfoDataCol1);
  900.     }
  901.     if (Yanfly.Param.SaveInfoDataCol2.length > 0) {
  902.       totalColumns += 1;
  903.       drawnArrays.push(Yanfly.Param.SaveInfoDataCol2);
  904.     }
  905.     if (Yanfly.Param.SaveInfoDataCol3.length > 0) {
  906.       totalColumns += 1;
  907.       drawnArrays.push(Yanfly.Param.SaveInfoDataCol3);
  908.     }
  909.     if (Yanfly.Param.SaveInfoDataCol4.length > 0) {
  910.       totalColumns += 1;
  911.       drawnArrays.push(Yanfly.Param.SaveInfoDataCol4);
  912.     }
  913.     if (totalColumns <= 0) return;
  914.     var dw = Math.floor(this.contents.width / totalColumns);
  915.     var dif = totalColumns > 1 ? this.textPadding() : 0;
  916.     for (var i = 0; i < totalColumns; ++i) {
  917.       var column = drawnArrays[i];
  918.       var dx = i * dw;
  919.       this.drawColumn(column, dx, dy, dw - dif);
  920.     }
  921. };
  922.  
  923. Window_SaveInfo.prototype.drawColumn = function(column, dx, dy, dw) {
  924.     var length = column.length;
  925.     var tp = this.textPadding();
  926.     for (var i = 0; i < length; ++i) {
  927.       this.resetFontSettings();
  928.       this.contents.fontSize = Yanfly.Param.SaveInfoDataSz;
  929.       var data = column[i];
  930.       if (data.toUpperCase().trim() !== 'EMPTY') {
  931.         this.drawDarkRect(dx, dy, dw, this.lineHeight());
  932.         this.drawData(data, dx + tp, dy, dw - tp * 2);
  933.       }
  934.       dy += this.lineHeight();
  935.     }
  936. };
  937.  
  938. Window_SaveInfo.prototype.drawData = function(data, dx, dy, dw) {
  939.   if (data.toUpperCase().trim() === 'NULL') {
  940.     return;
  941.   } else if (data.toUpperCase().trim() === 'LOCATION') {
  942.     this.drawLocation(dx, dy, dw);
  943.   } else if (data.toUpperCase().trim() === 'PLAYTIME') {
  944.     this.drawPlaytime(dx, dy, dw);
  945.   } else if (data.toUpperCase().trim() === 'SAVE COUNT') {
  946.     this.drawSaveCount(dx, dy, dw);
  947.   } else if (data.toUpperCase().trim() === 'GOLD COUNT') {
  948.     this.drawGoldCount(dx, dy, dw);
  949.   } else if (data.match(/VARIABLE[ ](\d+)/i)) {
  950.     this.drawVariable(parseInt(RegExp.$1), dx, dy, dw);
  951.   } else if (data.match(/(.*)[ ]TEXT:(.*)/i)) {
  952.     this.drawDataText(String(RegExp.$1), String(RegExp.$2), dx, dy, dw);
  953.   } else if (data.match(/TEXT:(.*)/i)) {
  954.     this.drawDataText('left', String(RegExp.$1), dx, dy, dw);
  955.   }
  956. };
  957.  
  958. Window_SaveInfo.prototype.drawLocation = function(dx, dy, dw) {
  959.     var id = this._saveContents.map._mapId;
  960.     if (Yanfly.Param.SaveMapDisplayName) {
  961.       var text = this._saveContents.map.locationDisplayName || '';
  962.       if (text.length <= 0) text = $dataMapInfos[id].name;
  963.     } else {
  964.       var text = $dataMapInfos[id].name;
  965.     }
  966.     if (Yanfly.Param.SaveVocabLocation.length > 0) {
  967.       this.changeTextColor(this.systemColor());
  968.       this.drawText(Yanfly.Param.SaveVocabLocation, dx, dy, dw, 'left');
  969.       this.changeTextColor(this.normalColor());
  970.       this.drawText(text, dx, dy, dw, 'right');
  971.     } else {
  972.       this.drawText(text, dx, dy, dw, 'center');
  973.     }
  974. };
  975.  
  976. Window_SaveInfo.prototype.drawPlaytime = function(dx, dy, dw) {
  977.     if (!this._info.playtime) return;
  978.     var text = this._info.playtime;
  979.     if (Yanfly.Param.SaveVocabPlaytime.length > 0) {
  980.       this.changeTextColor(this.systemColor());
  981.       this.drawText(Yanfly.Param.SaveVocabPlaytime, dx, dy, dw, 'left');
  982.       this.changeTextColor(this.normalColor());
  983.       this.drawText(text, dx, dy, dw, 'right');
  984.     } else {
  985.       this.drawText(text, dx, dy, dw, 'center');
  986.     }
  987. };
  988.  
  989. Window_SaveInfo.prototype.drawSaveCount = function(dx, dy, dw) {
  990.     var text = Yanfly.Util.toGroup(this._saveContents.system._saveCount);
  991.     if (Yanfly.Param.SaveVocabSaveCount.length > 0) {
  992.       this.changeTextColor(this.systemColor());
  993.       this.drawText(Yanfly.Param.SaveVocabSaveCount, dx, dy, dw, 'left');
  994.       this.changeTextColor(this.normalColor());
  995.       this.drawText(text, dx, dy, dw, 'right');
  996.     } else {
  997.       this.drawText(text, dx, dy, dw, 'center');
  998.     }
  999. };
  1000.  
  1001. Window_SaveInfo.prototype.drawGoldCount = function(dx, dy, dw) {
  1002.     var text = Yanfly.Util.toGroup(this._saveContents.party._gold);
  1003.     if (Yanfly.Param.SaveVocabGoldCount.length > 0) {
  1004.       this.changeTextColor(this.systemColor());
  1005.       var fmt = Yanfly.Param.SaveVocabGoldCount;
  1006.       this.drawText(fmt.format(TextManager.currencyUnit), dx, dy, dw, 'left');
  1007.       this.changeTextColor(this.normalColor());
  1008.  
  1009.       this.drawText(text, dx, dy, dw, 'right');
  1010.     } else {
  1011.       var fmt = '\\c[0]%1' + this.systemColorEx() + '%2';
  1012.       var ftext = fmt.format(text, TextManager.currencyUnit);
  1013.       this._drawData = true;
  1014.       var fw = this.textWidthEx(ftext);
  1015.       dx += Math.max(0, Math.floor((dw - fw) / 2));
  1016.       this.drawTextEx(ftext, dx, dy);
  1017.       this._drawData = false;
  1018.     }
  1019. };
  1020.  
  1021. Window_SaveInfo.prototype.drawVariable = function(id, dx, dy, dw) {
  1022.     var varName = $dataSystem.variables[id];
  1023.     varName = varName.replace(/<<(.*?)>>/i, '');
  1024.     var text = Yanfly.Util.toGroup(this._saveContents.variables.value(id));
  1025.     var diff = Math.max(0, (this.standardFontSize() -
  1026.       this.contents.fontSize) / 2);
  1027.     if (varName.length > 0) {
  1028.       this._drawData = true;
  1029.       this.changeTextColor(this.systemColor());
  1030.       dy += diff;
  1031.       this.drawTextEx(this.systemColorEx() + varName, dx, dy, dw, 'left');
  1032.       dy -= diff;
  1033.       this.changeTextColor(this.normalColor());
  1034.       this._drawData = false;
  1035.       this.drawText(text, dx, dy, dw, 'right');
  1036.     } else {
  1037.       this.drawText(text, dx, dy, dw, 'center');
  1038.     }
  1039. };
  1040.  
  1041. Window_SaveInfo.prototype.drawDataText = function(align, text, dx, dy, dw) {
  1042.     this._drawData = true;
  1043.     dy += Math.max(0, (this.standardFontSize() - this.contents.fontSize) / 2);
  1044.     var align = align.toLowerCase().trim();
  1045.     var text = text.trim();
  1046.     if (align === 'left') {
  1047.       this.drawTextEx(text, dx, dy);
  1048.     } else if (align === 'right') {
  1049.       var tw = this.textWidthEx(text);
  1050.       this.drawTextEx(text, dx + dw - tw, dy);
  1051.     } else {
  1052.       var tw = this.textWidthEx(text);
  1053.       this.drawTextEx(text, dx + (dw - tw) / 2, dy);
  1054.     }
  1055.     this._drawData = false;
  1056. };
  1057.  
  1058. //=============================================================================
  1059. // Window_SaveConfirm
  1060. //=============================================================================
  1061.  
  1062. function Window_SaveConfirm() {
  1063.     this.initialize.apply(this, arguments);
  1064. }
  1065.  
  1066. Window_SaveConfirm.prototype = Object.create(Window_Command.prototype);
  1067. Window_SaveConfirm.prototype.constructor = Window_SaveConfirm;
  1068.  
  1069. Window_SaveConfirm.prototype.initialize = function() {
  1070.     Window_Command.prototype.initialize.call(this, 0, 0);
  1071.     this.openness = 0;
  1072. };
  1073.  
  1074. Window_SaveConfirm.prototype.makeCommandList = function() {
  1075.     this.addCommand(Yanfly.Param.SaveConfirmYes, 'confirm');
  1076.     this.addCommand(Yanfly.Param.SaveConfirmNo, 'cancel');
  1077. };
  1078.  
  1079. Window_SaveConfirm.prototype.setData = function(text) {
  1080.     this._text = text;
  1081.     var ww = this.textWidthEx(this._text) + this.standardPadding() * 2;
  1082.     ww += this.textPadding() * 2;
  1083.     this.width = ww;
  1084.     this.refresh();
  1085.     this.x = (Graphics.boxWidth - this.width) / 2;
  1086.     this.y = (Graphics.boxHeight - this.height) / 2;
  1087.     this.drawTextEx(this._text, this.textPadding(), 0);
  1088. };
  1089.  
  1090. Window_SaveConfirm.prototype.itemTextAlign = function() {
  1091.     return 'center';
  1092. };
  1093.  
  1094. Window_SaveConfirm.prototype.windowHeight = function() {
  1095.     return this.fittingHeight(3);
  1096. };
  1097.  
  1098. Window_SaveConfirm.prototype.itemRect = function(index) {
  1099.     var rect = Window_Selectable.prototype.itemRect.call(this, index);
  1100.     rect.y += this.lineHeight();
  1101.     return rect;
  1102. };
  1103.  
  1104. //=============================================================================
  1105. // Scene_File
  1106. //=============================================================================
  1107.  
  1108. Scene_File.prototype.terminate = function() {
  1109.     Scene_MenuBase.prototype.terminate.call(this);
  1110.     if (this._loadSuccess) $gameSystem.onAfterLoad();
  1111. };
  1112.  
  1113. Scene_Load.prototype.terminate = function() {
  1114.     Scene_File.prototype.terminate.call(this);
  1115. };
  1116.  
  1117. Scene_File.prototype.create = function() {
  1118.     Scene_MenuBase.prototype.create.call(this);
  1119.     DataManager.loadAllSavefileImages();
  1120.     this.createHelpWindow();
  1121.     this.createListWindow();
  1122.     this.createActionWindow();
  1123.     this.createInfoWindow();
  1124.     this.createConfirmWindow();
  1125. };
  1126.  
  1127. Scene_File.prototype.createHelpWindow = function() {
  1128.     this._helpWindow = new Window_Help(2);
  1129.     this._helpWindow.setText(Yanfly.Param.SaveHelpSelect);
  1130.     this.addWindow(this._helpWindow);
  1131. };
  1132.  
  1133. Scene_File.prototype.createListWindow = function() {
  1134.     var x = 0;
  1135.     var y = this._helpWindow.height;
  1136.     var width = 240;
  1137.     var height = Graphics.boxHeight - y;
  1138.     this._listWindow = new Window_SavefileList(x, y, width, height);
  1139.     this.addWindow(this._listWindow);
  1140.     this._listWindow.setHandler('ok',     this.onSavefileOk.bind(this));
  1141.     this._listWindow.setHandler('cancel', this.popScene.bind(this));
  1142.     this._listWindow.select(this.firstSavefileIndex());
  1143.     this._listWindow.setTopRow(this.firstSavefileIndex() - 2);
  1144.     this._listWindow.setMode(this.mode());
  1145.     this._listWindow.refresh();
  1146.  
  1147. };
  1148.  
  1149. Scene_File.prototype.createActionWindow = function() {
  1150.     var x = this._listWindow.width;
  1151.     var y = this._listWindow.y;
  1152.     this._actionWindow = new Window_SaveAction(x, y, this.mode());
  1153.     this.addWindow(this._actionWindow);
  1154.     this._actionWindow.setHelpWindow(this._helpWindow);
  1155.     this._actionWindow.setHandler('load', this.onActionLoad.bind(this));
  1156.     this._actionWindow.setHandler('save', this.onActionSave.bind(this));
  1157.     this._actionWindow.setHandler('delete', this.onActionDelete.bind(this));
  1158.     this._actionWindow.setHandler('cancel', this.onActionCancel.bind(this));
  1159. };
  1160.  
  1161. Scene_File.prototype.createInfoWindow = function() {
  1162.     var x = this._actionWindow.x;
  1163.     var y = this._actionWindow.y + this._actionWindow.height;
  1164.     var width = Graphics.boxWidth - x;
  1165.     var height = Graphics.boxHeight - y;
  1166.     this._infoWindow = new Window_SaveInfo(x, y, width, height, this.mode());
  1167.     this.addWindow(this._infoWindow);
  1168. };
  1169.  
  1170. Scene_File.prototype.createConfirmWindow = function() {
  1171.     this._confirmWindow = new Window_SaveConfirm();
  1172.     var win = this._confirmWindow;
  1173.     win.setHandler('confirm', this.onConfirmOk.bind(this));
  1174.     win.setHandler('cancel',  this.onConfirmCancel.bind(this));
  1175.     this.addWindow(this._confirmWindow);
  1176. };
  1177.  
  1178. Scene_File.prototype.onSavefileOk = function() {
  1179.     this._actionWindow.activate();
  1180.     if (this.mode() === 'load') {
  1181.       this._actionWindow.select(0);
  1182.     } else if (this.mode() === 'save') {
  1183.       this._actionWindow.select(1);
  1184.     }
  1185. };
  1186.  
  1187. Scene_Save.prototype.onSavefileOk = function() {
  1188.     Scene_File.prototype.onSavefileOk.call(this);
  1189. };
  1190.  
  1191. Scene_Load.prototype.onSavefileOk = function() {
  1192.     Scene_File.prototype.onSavefileOk.call(this);
  1193. };
  1194.  
  1195. Scene_File.prototype.onActionLoad = function() {
  1196.     if (Yanfly.Param.SaveConfirmLoad) {
  1197.       this.startConfirmWindow(Yanfly.Param.SaveConfirmLoadTx);
  1198.     } else {
  1199.       this.performActionLoad();
  1200.     }
  1201. };
  1202.  
  1203. Scene_File.prototype.performActionLoad = function() {
  1204.     if (DataManager.loadGame(this.savefileId())) {
  1205.         this.onLoadSuccess();
  1206.     } else {
  1207.         this.onLoadFailure();
  1208.     }
  1209. };
  1210.  
  1211. Scene_File.prototype.onLoadSuccess = function() {
  1212.     SoundManager.playLoad();
  1213.     this.fadeOutAll();
  1214.     this.reloadMapIfUpdated();
  1215.     SceneManager.goto(Scene_Map);
  1216.     this._loadSuccess = true;
  1217. };
  1218.  
  1219. Scene_Load.prototype.onLoadSuccess = function() {
  1220.     Scene_File.prototype.onLoadSuccess.call(this);
  1221. };
  1222.  
  1223. Scene_File.prototype.onLoadFailure = function() {
  1224.     SoundManager.playBuzzer();
  1225.     this.onActionCancel();
  1226. };
  1227.  
  1228. Scene_Load.prototype.onLoadFailure = function() {
  1229.     Scene_File.prototype.onLoadFailure.call(this);
  1230. };
  1231.  
  1232. Scene_File.prototype.reloadMapIfUpdated = function() {
  1233.   if ($gameSystem.versionId() === $dataSystem.versionId) return;
  1234.   $gamePlayer.reserveTransfer($gameMap.mapId(), $gamePlayer.x, $gamePlayer.y);
  1235.   $gamePlayer.requestMapReload();
  1236. };
  1237.  
  1238. Scene_File.prototype.onActionSave = function() {
  1239.   var id = this.savefileId();
  1240.   if (Yanfly.Param.SaveConfirmSave && StorageManager.exists(id)) {
  1241.     this.startConfirmWindow(Yanfly.Param.SaveConfirmSaveTx);
  1242.   } else {
  1243.     this.performActionSave();
  1244.   }
  1245. };
  1246.  
  1247. Scene_File.prototype.performActionSave = function() {
  1248.     $gameSystem.onBeforeSave();
  1249.     if (DataManager.saveGame(this.savefileId())) {
  1250.       this.onSaveSuccess();
  1251.     } else {
  1252.       this.onSaveFailure();
  1253.     }
  1254. };
  1255.  
  1256. Scene_File.prototype.onSaveSuccess = function() {
  1257.     SoundManager.playSave();
  1258.     StorageManager.cleanBackup(this.savefileId());
  1259.     if (Yanfly.Param.SavePop) {
  1260.       this.popScene();
  1261.     } else {
  1262.       this._listWindow.refresh();
  1263.       this._actionWindow._currentFile = this.savefileId() - 1;
  1264.       this._infoWindow._currentFile = this.savefileId() - 1;
  1265.       this.onActionCancel();
  1266.     }
  1267. };
  1268.  
  1269. Scene_Save.prototype.onSaveSuccess = function() {
  1270.     Scene_File.prototype.onSaveSuccess.call(this);
  1271. };
  1272.  
  1273. Scene_File.prototype.onSaveFailure = function() {
  1274.     SoundManager.playBuzzer();
  1275.     this.onActionCancel();
  1276. };
  1277.  
  1278. Scene_Save.prototype.onSaveFailure = function() {
  1279.     Scene_File.prototype.onSaveFailure.call(this);
  1280. };
  1281.  
  1282. Scene_File.prototype.onActionDelete = function() {
  1283.     if (Yanfly.Param.SaveConfirmDel) {
  1284.       this.startConfirmWindow(Yanfly.Param.SaveConfirmDelTx);
  1285.     } else {
  1286.       this.performActionDelete();
  1287.     }
  1288. };
  1289.  
  1290. Scene_File.prototype.performActionDelete = function() {
  1291.     AudioManager.playSe(Yanfly.Param.SaveDeleteSound);
  1292.     StorageManager.remove(this.savefileId());
  1293.     this.onActionCancel();
  1294.     this._listWindow.refresh();
  1295.     this._actionWindow._currentFile = this.savefileId() - 1;
  1296.     this._infoWindow._currentFile = this.savefileId() - 1;
  1297. };
  1298.  
  1299. Scene_File.prototype.onActionCancel = function() {
  1300.     this._actionWindow.deselect();
  1301.     this._listWindow.activate();
  1302.     this._helpWindow.setText(Yanfly.Param.SaveHelpSelect);
  1303. };
  1304.  
  1305. Scene_File.prototype.startConfirmWindow = function(text) {
  1306.     SoundManager.playOk();
  1307.     this._confirmWindow.setData(text);
  1308.     this._confirmWindow.open();
  1309.     this._confirmWindow.activate();
  1310.     this._confirmWindow.select(0);
  1311. };
  1312.  
  1313. Scene_File.prototype.onConfirmOk = function() {
  1314.     this._confirmWindow.deactivate();
  1315.     this._confirmWindow.close();
  1316.     if (this._actionWindow.currentSymbol() === 'load') {
  1317.       setTimeout(this.performActionLoad.bind(this), 200);
  1318.     } else if (this._actionWindow.currentSymbol() === 'save') {
  1319.       setTimeout(this.performActionSave.bind(this), 200);
  1320.     } else if (this._actionWindow.currentSymbol() === 'delete') {
  1321.       setTimeout(this.performActionDelete.bind(this), 200);
  1322.     } else {
  1323.       this.onConfirmCancel();
  1324.     }
  1325. };
  1326.  
  1327. Scene_File.prototype.onConfirmCancel = function() {
  1328.     var index = this._actionWindow.index();
  1329.     this._confirmWindow.deactivate();
  1330.     this._confirmWindow.close();
  1331.     this.onSavefileOk();
  1332.     this._actionWindow.select(index);
  1333. };
  1334.  
  1335. //=============================================================================
  1336. // Utilities
  1337. //=============================================================================
  1338.  
  1339. Yanfly.Util = Yanfly.Util || {};
  1340.  
  1341. if (!Yanfly.Util.toGroup) {
  1342.     Yanfly.Util.toGroup = function(inVal) {
  1343.         return inVal;
  1344.     }
  1345. };
  1346.  
  1347. //=============================================================================
  1348. // End of File
  1349. //=============================================================================




Lv4.逐梦者

梦石
0
星屑
7422
在线时间
948 小时
注册时间
2017-9-27
帖子
583
2
发表于 2017-11-3 23:57:48 | 只看该作者
出错时你按一下F8,把控制台显示的信息贴出来。

点评

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

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
7422
在线时间
948 小时
注册时间
2017-9-27
帖子
583
3
发表于 2017-11-5 21:08:37 | 只看该作者
第一行显示的'Mhe'是什么?还有那个'LeNotification.js'是个什么插件?

点评

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

使用道具 举报

Lv1.梦旅人

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

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-1 01:33

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表