Project1

标题: 不存在的脚本陈列室 [打印本页]

作者: MonsterJohnCN    时间: 2015-10-24 18:59
标题: 不存在的脚本陈列室
本帖最后由 MonsterJohnCN 于 2015-12-27 06:11 编辑


作者: MonsterJohnCN    时间: 2015-10-24 18:59
本帖最后由 MonsterJohnCN 于 2015-10-25 02:38 编辑

JAVASCRIPT 代码复制
  1. //=============================================================================
  2. // Actor Stepping Animation
  3. // by Shaz
  4. // Last Updated: 2015.10.21
  5. //=============================================================================
  6.  
  7. /*:
  8.  * @plugindesc Allows party leader/followers to have stepping anim on map
  9.  * @author Shaz
  10.  *
  11.  * @help This plugin does not provide plugin commands.
  12.  *
  13.  * Add <stepanim> to the note box of an Actor to turn on stepping animation
  14.  * for the actor's sprite on the map, as the party leader or a follower.
  15.  *
  16.  */
  17.  
  18. /*:ch
  19.  * @plugindesc
  20.  * 允许一个队伍中的某个角色在地图中显示步行动画。
  21.  *
  22.  * @author
  23.  * Shaz
  24.  *
  25.  * @help
  26.  * 在角色的备注(note)盒子中添加“<stepanim>”(不含双引号)来让这个角色自动
  27.  * 播放走路动画。
  28.  */
  29.  
  30. (function() {
  31.     var _Game_Player_update = Game_Player.prototype.update;                     // 用_Game_Player_update指向原始的队伍主要角色的更新函数,类似RUBY的alias
  32.     Game_Player.prototype.update = function(sceneActive) {                      // 追加用于本插件的队伍主要角色更新函数
  33.         _Game_Player_update.call(this, sceneActive);                                // 调用原始的队伍主要角色更新函数,类似RUBY的super
  34.         this.setStepAnime($gameParty.leader().actor().meta.stepanim || false);      // 【?】更新角色队伍中本角色的动画状态
  35.     };
  36.  
  37.     var _Game_Follower_update = Game_Follower.prototype.update;                 // 用_Game_Follower_update指向原始的队伍附属角色的更新函数,类似RUBY的alias
  38.     Game_Follower.prototype.update = function() {                               // 追加用于本插件的队伍附属角色更新函数
  39.         _Game_Follower_update.call(this);                                           // 调用原始的队伍附属角色更新函数,类似RUBY的super
  40.         this.setStepAnime(this.actor().actor().meta.stepanim || false);             // 【?】更新角色队伍中本角色的动画状态
  41.     };
  42. })();

作者: MonsterJohnCN    时间: 2015-10-24 19:01
本帖最后由 MonsterJohnCN 于 2015-10-25 02:38 编辑

JAVASCRIPT 代码复制
  1. //=============================================================================
  2. // AltMenuScreen.js
  3. //=============================================================================
  4.  
  5. /*:
  6.  * @plugindesc Alternative menu screen layout.
  7.  * @author Yoji Ojima
  8.  *
  9.  * @help This plugin does not provide plugin commands.
  10.  */
  11.  
  12. /*:ja
  13.  * @plugindesc メニュー画面のレイアウトを変更します。
  14.  * @author Yoji Ojima
  15.  *
  16.  * @help このプラグインには、プラグインコマンドはありません。
  17.  */
  18.  
  19. /*:ch
  20.  * @plugindesc
  21.  * 修改菜单界面的布局方式。
  22.  *
  23.  * @author
  24.  * Yoji Ojima
  25.  *
  26.  * @help
  27.  * 启用本插件后,会将ESC菜单的纵向排版变为横向排版。
  28.  */
  29.  
  30. (function() {
  31.  
  32.     var _Scene_Menu_create = Scene_Menu.prototype.create;                       // 用_Scene_Menu_create指向原始的创建菜单函数
  33.     Scene_Menu.prototype.create = function() {                                  // 追加用于本插件的创建菜单函数
  34.         _Scene_Menu_create.call(this);                                              // 调用原始的创建菜单函数
  35.         this._statusWindow.x = 0;                                                   // 设置状态窗口的X坐标为0
  36.         this._statusWindow.y = this._commandWindow.height;                          // 设置状态窗口的Y坐标为指令窗口的高度
  37.         this._goldWindow.x = Graphics.boxWidth - this._goldWindow.width;            // 设置金币窗口的X坐标为 游戏窗口的宽度 - 金币窗口的宽度
  38.     };
  39.  
  40.     Window_MenuCommand.prototype.windowWidth = function() {                     // 重定义指令窗口的宽度
  41.         return Graphics.boxWidth;                                                   // 返回游戏窗口宽度
  42.     };
  43.  
  44.     Window_MenuCommand.prototype.maxCols = function() {                         // 重定义指令窗口的选项的最大列数
  45.         return 4;                                                                   // 返回 4
  46.     };
  47.  
  48.     Window_MenuCommand.prototype.numVisibleRows = function() {                  // 重定义指令窗口的选项的可见的行数
  49.         return 2;                                                                   // 返回 葵花宝典
  50.     };
  51.  
  52.     Window_MenuStatus.prototype.windowWidth = function() {                      // 重定义状态窗口的宽度
  53.         return Graphics.boxWidth;                                                   // 返回游戏窗口宽度
  54.     };
  55.  
  56.     Window_MenuStatus.prototype.windowHeight = function() {                     // 重定义状态窗口的高度
  57.         var h1 = this.fittingHeight(1);                                             // 【?】适配行数为1的项目的行高
  58.         var h2 = this.fittingHeight(2);                                             // 【?】适配行数为2的项目的行高
  59.         return Graphics.boxHeight - h1 - h2;                                        // 返回 游戏窗口高度 - 【?】 - 【?】
  60.     };
  61.  
  62.     Window_MenuStatus.prototype.maxCols = function() {                          // 重定义状态窗口的内容的最大列数
  63.         return 4;                                                                   // 返回 蜜汁肥皂
  64.     };
  65.  
  66.     Window_MenuStatus.prototype.numVisibleRows = function() {                   // 重定义状态窗口的内容的可见行数
  67.         return 1;                                                                   // 返回 辣条
  68.     };
  69.  
  70.     Window_MenuStatus.prototype.drawItemImage = function(index) {               // 重定义状态窗口的项目图片绘制函数
  71.         var actor = $gameParty.members()[index];                                    // 将玩家队伍中排序为index的角色保存到actor中
  72.         var rect = this.itemRectForText(index);                                     // 【?】获取用于绘制文字的区域并保存到rect中
  73.         var w = Math.min(rect.width, 144);                                          // 设置宽度为rect的宽度和144中较小的一个
  74.         var h = Math.min(rect.height, 144);                                         // 设置高度为rect的高度和144中较小的一个
  75.         var lineHeight = this.lineHeight();                                         // 获取状态窗口的行高并保存到lineHeight中
  76.         this.changePaintOpacity(actor.isBattleMember());                            // 【?】改变绘制功能的透明度
  77.         this.drawActorFace(actor, rect.x, rect.y + lineHeight * 2.5, w, h);         // 绘制角色脸图
  78.         this.changePaintOpacity(true);                                              // 【?】恢复绘制功能的透明度
  79.     };
  80.  
  81.     Window_MenuStatus.prototype.drawItemStatus = function(index) {              // 重定义状态窗口的项目属性绘制函数
  82.         var actor = $gameParty.members()[index];                                    // 将玩家队伍中排序为index的角色保存到actor中
  83.         var rect = this.itemRectForText(index);                                     // 【?】获取用于绘制文字的区域并保存到rect中
  84.         var x = rect.x;                                                             // 获取用于绘制文字的区域的X坐标
  85.         var y = rect.y;                                                             // 获取用于绘制文字的区域的Y坐标
  86.         var width = rect.width;                                                     // 获取用于绘制文字的区域的宽度
  87.         var bottom = y + rect.height;                                               // 获取用于绘制文字的区域的底部Y坐标
  88.         var lineHeight = this.lineHeight();                                         // 获取状态窗口的行高
  89.         this.drawActorName(actor, x, y + lineHeight * 0, width);                    // 绘制角色姓名
  90.         this.drawActorLevel(actor, x, y + lineHeight * 1, width);                   // 绘制角色等级
  91.         this.drawActorClass(actor, x, bottom - lineHeight * 4, width);              // 绘制角色职业
  92.         this.drawActorHp(actor, x, bottom - lineHeight * 3, width);                 // 绘制角色生命值
  93.         this.drawActorMp(actor, x, bottom - lineHeight * 2, width);                 // 绘制角色魔法值
  94.         this.drawActorIcons(actor, x, bottom - lineHeight * 1, width);              // 【?】绘制角色状态图标
  95.     };
  96.  
  97.     var _Window_MenuActor_initialize = Window_MenuActor.prototype.initialize;   // 用_Window_MenuActor_initialize指向原始的菜单角色初始化函数
  98.     Window_MenuActor.prototype.initialize = function() {                        // 追加用于本插件的菜单角色初始化函数
  99.         _Window_MenuActor_initialize.call(this);                                    // 调用原始的菜单角色初始化函数
  100.         this.y = this.fittingHeight(2);                                             // 【?】适配项目数为2的行高
  101.     };
  102.  
  103. })();

作者: MonsterJohnCN    时间: 2015-10-24 19:51
本帖最后由 MonsterJohnCN 于 2015-10-25 02:38 编辑

JAVASCRIPT 代码复制
  1. //=============================================================================
  2. // AltMenuScreen2.js
  3. //=============================================================================
  4.  
  5. /*:
  6.  * @plugindesc Alternative menu screen layout.
  7.  * @author Yoji Ojima, Sasuke KANNAZUKI
  8.  *
  9.  * @param backGroundBitmap
  10.  * @desc background bitmap file at img/pictures.
  11.  * @default
  12.  *
  13.  * @param maxColsMenu
  14.  * @desc max column at menu window
  15.  * @default 4
  16.  *
  17.  * @param commandRows
  18.  * @desc number of visible rows at command window
  19.  * @default 2
  20.  *
  21.  * @param isDisplayStatus
  22.  * @desc whether display status or not. (1 = yes, 0 = no)
  23.  * @default 0
  24.  *
  25.  * @help This plugin does not provide plugin commands.
  26.  *  The differences with AltMenuscreen are follows:
  27.  *   - windows are transparent
  28.  *   - it can set the menu's background bitmap.
  29.  *   - picture is actors' original
  30.  *
  31.  * Actor' note:
  32.  * <stand_picture:filename> set actor's standing picture at menu.
  33.  *   put file at img/pictures.
  34.  *
  35.  * preferred size of actor's picture:
  36.  * width: 174px(maxColsMenu=4), 240px(maxColsMenu=3)
  37.  * height: 408px(commandRows=2), 444px(commandRows=1)
  38.  */
  39.  
  40. /*:ja
  41.  * @plugindesc レイアウトの異なるメニュー画面
  42.  * @author Yoji Ojima, 神無月サスケ
  43.  *
  44.  * @param backGroundBitmap
  45.  * @desc 背景にするビットマップファイルです。
  46.  * img/pictures に置いてください。
  47.  * @default
  48.  *
  49.  * @param maxColsMenu
  50.  * @desc アクターを表示するウィンドウの1画面の登録最大数です。
  51.  * @default 4
  52.  *
  53.  * @param commandRows
  54.  * @desc コマンドウィンドウの行数です。
  55.  * @default 2
  56.  *
  57.  * @param isDisplayStatus
  58.  * @desc ステータスを表示するかしないかを選びます。(1 = yes, 0 = no)
  59.  * @default 0
  60.  *
  61.  * @help このプラグインには、プラグインコマンドはありません。
  62.  *
  63.  *  AltMenuscreen との違いは以下です:
  64.  *  - ウィンドウが透明です
  65.  *  - 背景ビットマップを付けることが出来ます。
  66.  *  - アクターに立ち絵を利用します。
  67.  *
  68.  * アクターのメモに以下のように書いてください:
  69.  * <stand_picture:ファイル名> ファイル名が、そのアクターの立ち絵になります。
  70.  *   ファイルは img/pictures に置いてください。
  71.  *
  72.  * 望ましいアクター立ち絵のサイズ:
  73.  * 幅:3列:240px, 4列:174px
  74.  * 高さ: コマンドウィンドウ 1行:444px 2行:408px
  75.  *
  76.  */
  77.  
  78. /*:ch
  79.  * @plugindesc
  80.  * 通过填写参数来定制你的ESC菜单布局。
  81.  *
  82.  * @author
  83.  * Yoji Ojima, Sasuke KANNAZUKI
  84.  *
  85.  * @param backGroundBitmap
  86.  * @desc 背景图片(Bitmap),将背景图片保存在img/pictures。
  87.  * @default
  88.  *
  89.  * @param maxColsMenu
  90.  * @desc 菜单最大列数,菜单窗口的最大列数
  91.  * @default 4
  92.  *
  93.  * @param commandRows
  94.  * @desc 指令行数,在指令窗口内可见的指令行数
  95.  * @default 2
  96.  *
  97.  * @param isDisplayStatus
  98.  * @desc 是否显示角色状态,选择是否显示角色状态属性(1 = 显示,0 = 不显示)
  99.  * @default 0
  100.  *
  101.  * @help
  102.  * 本插件与AltMenuScreen插件的不同有以下几点:
  103.  * - 窗口是透明的
  104.  * - 可以自己设定窗口背景图
  105.  * - 可定制角色的菜单显示图(默认为脸图)
  106.  *   - 在角色的备注内填写<stand_picture:filename>,即可设置角色的菜单显示图
  107.  *   - 注意图片应当放置在img/pictures目录下
  108.  *   - filename不含后缀
  109.  *
  110.  * 角色的菜单显示图的最佳尺寸:
  111.  * - 菜单最大列数为4时,宽度为174像素。
  112.  * - 菜单最大列数为3时,宽度为240像素。
  113.  * - 指令选项行数为2时,高度为408像素。
  114.  * - 指令选项行数为1时,高度为444像素。
  115.  */
  116.  
  117. (function() {
  118.  
  119.     // set parameters                                                                   // 设置参数
  120.     var parameters = PluginManager.parameters('AltMenuScreen2');                        // 获取插件管理器中AltMenuScreen2的参数列表,保存到parameters中
  121.     var backGroundBitmap = parameters['backGroundBitmap'] || '';                        // 获取“背景图片(参数)”内容,默认为空
  122.     var maxColsMenuWnd = Number(parameters['maxColsMenu'] || 4);                        // 获取“菜单最大列数(参数)”内容,默认为4
  123.     var rowsCommandWnd = Number(parameters['commandRows'] || 2);                        // 获取“指令行数(参数)”内容,默认为2
  124.     var isDisplayStatus = !!Number(parameters['isDisplayStatus']);                      // 获取“是否显示角色状态(参数)”内容,默认为【?】
  125.  
  126.     var _Scene_Menu_create = Scene_Menu.prototype.create;                               // 用_Scene_Menu_create指向原始的创建菜单函数
  127.     Scene_Menu.prototype.create = function() {                                          // 追加用于本插件的创建菜单函数
  128.         _Scene_Menu_create.call(this);                                                      // 调用原始的创建菜单函数
  129.         this._statusWindow.x = 0;                                                           // 设置状态窗口的X坐标为0
  130.         this._statusWindow.y = this._commandWindow.height;                                  // 设置状态窗口的Y坐标为指令窗口的高度
  131.         this._goldWindow.x = Graphics.boxWidth - this._goldWindow.width;                    // 设置金币窗口的X坐标为游戏窗口的宽度 - 金币窗口的宽度
  132.         // make transparent for all windows at menu scene.                                  // 注释:设置ESC菜单界面内的所有窗口的透明度为0
  133.         this._statusWindow.opacity = 0;                                                     // 设置状态窗口的透明度为0
  134.         this._goldWindow.opacity = 0;                                                       // 设置金币窗口的透明度为0
  135.         this._commandWindow.opacity = 0;                                                    // 设置指令窗口的透明度为0
  136.     };
  137.  
  138.     // load bitmap that set in plugin parameters                                        // 注释:载入“背景图片”参数所指向的图片
  139.     var _Scene_Menu_createBackground = Scene_Menu.prototype.createBackground;           // 用_Scene_Menu_createBackground指向原始的创建背景函数
  140.     Scene_Menu.prototype.createBackground = function(){                                 // 追加用于本插件的创建背景函数
  141.         if(backGroundBitmap){                                                               // 如果“背景图片”参数有内容
  142.             this._backgroundSprite = new Sprite();                                              // 为本场景创建一个新的背景图精灵
  143.             this._backgroundSprite.bitmap = ImageManager.loadPicture(backGroundBitmap);         // 调用图片管理器,为精灵的Bitmap设值,调用的图片路径为参数的地址
  144.             this.addChild(this._backgroundSprite);                                              // 为本场景添加背景图精灵
  145.             return;                                                                             // 结束本次函数运行
  146.         }
  147.         // if background file is invalid, it does original process.                         // 注释:如果背景文件不存在,则调用原始的创建背景函数
  148.         _Scene_Menu_createBackground.call(this);                                            // 调用原始的创建背景函数
  149.     };
  150.  
  151.     Window_MenuCommand.prototype.windowWidth = function() {                             // 重定义指令窗口的宽度
  152.         return Graphics.boxWidth;                                                           // 返回游戏窗口宽度
  153.     };
  154.  
  155.     Window_MenuCommand.prototype.maxCols = function() {                                 // 重定义指令窗口项目的最大列数
  156.         return 4;                                                                           // 返回⑨
  157.     };
  158.  
  159.     Window_MenuCommand.prototype.numVisibleRows = function() {                          // 重定义指令窗口项目的可见行数
  160.         return rowsCommandWnd;                                                              // 返回“指令行数(参数)”
  161.     };
  162.  
  163.     Window_MenuStatus.prototype.windowWidth = function() {                              // 重定义状态窗口的宽度
  164.         return Graphics.boxWidth;                                                           // 返回游戏窗口宽度
  165.     };
  166.  
  167.     Window_MenuStatus.prototype.windowHeight = function() {                             // 重定义状态窗口的高度
  168.         var h1 = this.fittingHeight(1);                                                     // 【?】自动适配1行项目的高度
  169.         var h2 = this.fittingHeight(rowsCommandWnd);                                        // 【?】自动适配“指令行数(参数)”行项目的高度
  170.         return Graphics.boxHeight - h1 - h2;                                                // 返回游戏窗口高度-【?】-【?】
  171.     };
  172.  
  173.     Window_MenuStatus.prototype.maxCols = function() {                                  // 重定义状态窗口的最大列数
  174.         return maxColsMenuWnd;                                                              // 返回“指令列数(参数)”
  175.     };
  176.  
  177.     Window_MenuStatus.prototype.numVisibleRows = function() {                           // 重定义状态窗口的可见行数
  178.         return 1;                                                                           // 返回奥特曼变身器
  179.     };
  180.  
  181.     Window_MenuStatus.prototype.drawItemImage = function(index) {                       // 重定义状态窗口的项目图片绘制函数
  182.         var actor = $gameParty.members()[index];                                            // 获取角色队伍中排序为index的角色
  183.         var rect = this.itemRectForText(index);                                             // 获取排序为index的项目图片绘制区域
  184.         // load stand_picture                                                               // 注释:读取标准角色图
  185.         var bitmapName = $dataActors[actor.actorId()].meta.stand_picture;                   // 【?】读取当前角色的标准角色图名字
  186.         var bitmap = bitmapName ? ImageManager.loadPicture(bitmapName) : null;              // 如果角色图名字不为空,则载入角色图,否则不载入图片
  187.         var w = Math.min(rect.width, (bitmapName ? bitmap.width : 144));                    // 如果角色图名字不为空,则读取项目图片绘制区域或角色图的宽度中较小的一个,如果没有角色图,则认为角色图宽度为144
  188.         var h = Math.min(rect.height, (bitmapName ? bitmap.height : 144));                  // 如果角色图名字不为空,则读取项目图片绘制区域或角色图的高度中较小的一个,如果没有角色图,则认为角色图高度为144
  189.         var lineHeight = this.lineHeight();                                                 // 读取状态窗口的行高
  190.         this.changePaintOpacity(actor.isBattleMember());                                    // 【?】改变绘制功能的透明度
  191.         if(bitmap){                                                                         // 如果存在角色图
  192.             var sx = (bitmap.width > w) ? (bitmap.width - w) / 2 : 0;                           // 一套算法,用于计算出适配角色图的区域坐标
  193.             var sy = (bitmap.height > h) ? (bitmap.height - h) / 2 : 0;                         // ...
  194.             var dx = (bitmap.width > rect.width) ? rect.x :                                     // ...
  195.                 rect.x + (rect.width - bitmap.width) / 2;                                       // ...
  196.             var dy = (bitmap.height > rect.height) ? rect.y :                                   // ...
  197.                 rect.y + (rect.height - bitmap.height) / 2;                                     // ...
  198.             this.contents.blt(bitmap, sx, sy, w, h, dx, dy);                                    // ...
  199.         } else { // when bitmap is not set, do the original process.                        // 如果不存在角色图,则调用原始的状态窗口的项目图片绘制函数
  200.             this.drawActorFace(actor, rect.x, rect.y + lineHeight * 2.5, w, h);                 // 为当前角色绘制角色图(脸图)
  201.         }
  202.         this.changePaintOpacity(true);                                                      // 【?】恢复绘制功能的透明度
  203.     };
  204.  
  205.     Window_MenuStatus.prototype.drawItemStatus = function(index) {                      // 重定义状态窗口的项目属性绘制函数
  206.         if(!isDisplayStatus){                                                               // 如果“是否显示角色状态(参数)”为否
  207.             return;                                                                             // 结束本次调用
  208.         }
  209.         var actor = $gameParty.members()[index];                                            // 读取角色队伍中排序为index的角色
  210.         var rect = this.itemRectForText(index);                                             // 读取排序为index的项目图片绘制区域
  211.         var x = rect.x;                                                                     // 获取排序为index的项目图片绘制区域的X坐标
  212.         var y = rect.y;                                                                     // 获取排序为index的项目图片绘制区域的Y坐标
  213.         var width = rect.width;                                                             // 获取排序为index的项目图片绘制区域的宽度
  214.         var bottom = y + rect.height;                                                       // 获取排序为index的项目图片绘制区域的底部坐标
  215.         var lineHeight = this.lineHeight();                                                 // 获取状态窗口的行高
  216.         this.drawActorName(actor, x, y + lineHeight * 0, width);                            // 绘制排序为index的角色姓名
  217.         this.drawActorLevel(actor, x, y + lineHeight * 1, width);                           // 绘制排序为index的角色等级
  218.         this.drawActorClass(actor, x, bottom - lineHeight * 4, width);                      // 绘制排序为index的角色职业
  219.         this.drawActorHp(actor, x, bottom - lineHeight * 3, width);                         // 绘制排序为index的角色生命值
  220.         this.drawActorMp(actor, x, bottom - lineHeight * 2, width);                         // 绘制排序为index的角色魔法值
  221.         this.drawActorIcons(actor, x, bottom - lineHeight * 1, width);                      // 【?】绘制排序为index的角色状态图标
  222.     };
  223.  
  224.     var _Window_MenuActor_initialize = Window_MenuActor.prototype.initialize;           // 用_Window_MenuActor_initialize指向原始的菜单角色初始化函数
  225.     Window_MenuActor.prototype.initialize = function() {                                // 重定义菜单角色初始化函数
  226.         _Window_MenuActor_initialize.call(this);                                            // 调用原始的菜单角色初始化函数
  227.         this.y = this.fittingHeight(2);                                                     // 【?】设置菜单角色的Y坐标为两行项目的行高
  228.     };
  229.  
  230. })();

作者: 魔力的觉醒    时间: 2015-10-24 20:52
吃惊!!   先占个楼!!
作者: losyK    时间: 2015-10-24 23:48
果然还是看注释学js更快一些,希望能有战斗类的部分
总之支持一下
作者: tai_tan    时间: 2015-10-25 00:13
出的真够快的,mv管理脚本简单了好多,不用再各种加注释无效化了
作者: MonsterJohnCN    时间: 2015-10-25 00:53
本帖最后由 MonsterJohnCN 于 2015-10-25 02:39 编辑

JAVASCRIPT 代码复制
  1. //=============================================================================
  2. // JumpBeginScene.js
  3. // Last Updated: 2015.10.25
  4. //=============================================================================
  5.  
  6. /*:
  7.  * @plugindesc Jump game begin scene, quickily start debug.
  8.  */
  9.  
  10. (function() {
  11.  
  12.     Scene_Title.prototype.initialize = function() {                 // 重定义标题场景初始化函数
  13.         Scene_Base.prototype.initialize.call(this);                     // 调用基础场景的初始化
  14.     };
  15.  
  16.     Scene_Title.prototype.create = function() {                     // 重定义标题场景创建函数
  17.         Scene_Base.prototype.create.call(this);                         // 调用基础场景的创建
  18.     };
  19.  
  20.     Scene_Title.prototype.start = function() {                      // 重定义标题场景开始函数
  21.         Scene_Base.prototype.start.call(this);                          // 调用基础场景的开始
  22.         DataManager.setupNewGame();                                     // 配置新游戏
  23.         SceneManager.goto(Scene_Map);                                   // 调用场景管理器,跳转到游戏地图场景
  24.     };
  25.  
  26.     Scene_Title.prototype.update = function() {                     // 重定义标题场景更新函数
  27.         Scene_Base.prototype.update.call(this);                         // 调用基础场景的更新
  28.     };
  29.  
  30.     Scene_Title.prototype.terminate = function() {                  // 重定义标题场景结束函数
  31.         Scene_Base.prototype.terminate.call(this);                      // 调用基础场景的结束
  32.     };
  33.  
  34.     Scene_Title.prototype.isBusy = function() {                     // 重定义标题场景繁忙检测函数
  35.         return false;                                                   // 返回:不忙
  36.     };
  37.  
  38. })();

作者: MonsterJohnCN    时间: 2015-10-25 13:09
emgame 发表于 2015-10-25 11:39
楼主我可以加一个么.
[fold=AltMenuScreen3]//========================================================= ...

正在汉化这个,今天会出
作者: MonsterJohnCN    时间: 2015-10-25 17:13
本帖最后由 MonsterJohnCN 于 2015-10-25 17:22 编辑

JAVASCRIPT 代码复制
  1. //=============================================================================
  2. // AltMenuScreen3.js
  3. //=============================================================================
  4.  
  5. /*:
  6.  * @plugindesc Yet Another menu screen layout.
  7.  * @author Sasuke KANNAZUKI, Yoji Ojima
  8.  *
  9.  * @param bgBitmapMenu
  10.  * @desc background bitmap file at menu scene. put at img/pictures.
  11.  * @default
  12.  *
  13.  * @param bgBitmapItem
  14.  * @desc background bitmap file at item scene. put at img/pictures.
  15.  * @default
  16.  *
  17.  * @param bgBitmapSkill
  18.  * @desc background bitmap file at skill scene. put at img/pictures.
  19.  * @default
  20.  *
  21.  * @param bgBitmapEquip
  22.  * @desc background bitmap file at equip scene. put at img/pictures.
  23.  * @default
  24.  *
  25.  * @param bgBitmapStatus
  26.  * @desc background bitmap file at status scene. put at img/pictures.
  27.  * @default
  28.  *
  29.  * @param bgBitmapOptions
  30.  * @desc background bitmap file at option scene. put at img/pictures.
  31.  * @default
  32.  *
  33.  * @param bgBitmapFile
  34.  * @desc background bitmap file at save/load scene. put at img/pictures.
  35.  * @default
  36.  *
  37.  * @param bgBitmapGameEnd
  38.  * @desc background bitmap file at gameEnd scene. put at img/pictures.
  39.  * @default
  40.  *
  41.  * @param maxColsMenu
  42.  * @desc max column at menu window
  43.  * @default 4
  44.  *
  45.  * @param commandRows
  46.  * @desc number of visible rows at command window
  47.  * @default 2
  48.  *
  49.  * @param isDisplayStatus
  50.  * @desc whether display status or not. (1 = yes, 0 = no)
  51.  * @default 1
  52.  *
  53.  * @help This plugin does not provide plugin commands.
  54.  *  The differences with AltMenuscreen are follows:
  55.  *   - windows are transparent at all menu scene.
  56.  *   - it can set the background bitmap for each scenes at menu.
  57.  *   - picture is actors' original
  58.  *
  59.  * Actor' note:
  60.  * <stand_picture:filename> set actor's standing picture at menu.
  61.  *   put file at img/pictures.
  62.  *
  63.  * preferred size of actor's picture:
  64.  * width: 174px(maxColsMenu=4), 240px(maxColsMenu=3)
  65.  * height: 408px(commandRows=2), 444px(commandRows=1)
  66.  */
  67.  
  68. /*:ja
  69.  * @plugindesc レイアウトの異なるメニュー画面
  70.  * @author 神無月サスケ, Yoji Ojima
  71.  *
  72.  * @param bgBitmapMenu
  73.  * @desc メニュー背景にするビットマップファイルです。
  74.  * img/pictures に置いてください。
  75.  * @default
  76.  *
  77.  * @param bgBitmapItem
  78.  * @desc アイテム画面背景にするビットマップファイルです。
  79.  * img/pictures に置いてください。
  80.  * @default
  81.  *
  82.  * @param bgBitmapSkill
  83.  * @desc スキル画面背景にするビットマップファイルです。
  84.  * img/pictures に置いてください。
  85.  * @default
  86.  *
  87.  * @param bgBitmapEquip
  88.  * @desc 装備画面背景にするビットマップファイルです。
  89.  * img/pictures に置いてください。
  90.  * @default
  91.  *
  92.  * @param bgBitmapStatus
  93.  * @desc ステータス画面背景にするビットマップファイルです。
  94.  * img/pictures に置いてください。
  95.  * @default
  96.  *
  97.  * @param bgBitmapOptions
  98.  * @desc オプション画面背景にするビットマップファイルです。
  99.  * img/pictures に置いてください。
  100.  * @default
  101.  *
  102.  * @param bgBitmapFile
  103.  * @desc セーブ/ロード画面背景にするビットマップファイルです。
  104.  * img/pictures に置いてください。
  105.  * @default
  106.  *
  107.  * @param bgBitmapGameEnd
  108.  * @desc ゲーム終了画面背景にするビットマップファイルです。
  109.  * img/pictures に置いてください。
  110.  * @default
  111.  *
  112.  * @param maxColsMenu
  113.  * @desc アクターを表示するウィンドウの1画面の登録最大数です。
  114.  * @default 4
  115.  *
  116.  * @param commandRows
  117.  * @desc コマンドウィンドウの行数です。
  118.  * @default 2
  119.  *
  120.  * @param isDisplayStatus
  121.  * @desc ステータスを表示するかしないかを選びます。(1 = yes, 0 = no)
  122.  * @default 1
  123.  *
  124.  * @help このプラグインには、プラグインコマンドはありません。
  125.  *
  126.  *  AltMenuscreen との違いは以下です:
  127.  *  - メニュー画面すべてのウィンドウが透明です
  128.  *  - メニューそれぞれのシーンに背景ビットマップを付けることが出来ます。
  129.  *  - アクターに立ち絵を利用します。
  130.  *
  131.  * アクターのメモに以下のように書いてください:
  132.  * <stand_picture:ファイル名> ファイル名が、そのアクターの立ち絵になります。
  133.  *   ファイルは img/pictures に置いてください。
  134.  *
  135.  * 望ましいアクター立ち絵のサイズ:
  136.  * 幅:3列:240px, 4列:174px
  137.  * 高さ: コマンドウィンドウ 1行:444px 2行:408px
  138.  *
  139.  */
  140.  
  141. /*:ch
  142.  * @plugindesc
  143.  * 比AltMenuScreen2更厉害的ESC菜单布局插件
  144.  *
  145.  * @author
  146.  * Sasuke KANNAZUKI, Yoji Ojima
  147.  *
  148.  * @param bgBitmapMenu
  149.  * @desc 菜单界面背景图,将图片资源放在img/pictures文件夹下。
  150.  * @default
  151.  *
  152.  * @param bgBitmapItem
  153.  * @desc 物品界面背景图,将图片资源放在img/pictures文件夹下。
  154.  * @default
  155.  *
  156.  * @param bgBitmapSkill
  157.  * @desc 技能界面背景图,将图片资源放在img/pictures文件夹下。
  158.  * @default
  159.  *
  160.  * @param bgBitmapEquip
  161.  * @desc 装备界面背景图,将图片资源放在img/pictures文件夹下。
  162.  * @default
  163.  *
  164.  * @param bgBitmapStatus
  165.  * @desc 状态界面背景图,将图片资源放在img/pictures文件夹下。
  166.  * @default
  167.  *
  168.  * @param bgBitmapOptions
  169.  * @desc 设置界面背景图,将图片资源放在img/pictures文件夹下。
  170.  * @default
  171.  *
  172.  * @param bgBitmapFile
  173.  * @desc 存读档界面背景图,将图片资源放在img/pictures文件夹下。
  174.  * @default
  175.  *
  176.  * @param bgBitmapGameEnd
  177.  * @desc 游戏结束界面背景图,将图片资源放在img/pictures文件夹下。
  178.  * @default
  179.  *
  180.  * @param maxColsMenu
  181.  * @desc 菜单窗口的显示项目的最大列数。
  182.  * @default 4
  183.  *
  184.  * @param commandRows
  185.  * @desc 指令窗口的显示项目的最大行数。
  186.  * @default 2
  187.  *
  188.  * @param isDisplayStatus
  189.  * @desc 是否显示角色状态信息。(1 = 显示, 0 = 不显示)
  190.  * @default 1
  191.  *
  192.  * 本插件与AltMenuScreen插件的不同有以下几点:
  193.  * - 默认所有窗口背景图都是不可见的
  194.  * - 可以自己设定窗口背景图
  195.  * - 可定制角色的菜单显示图(默认为脸图)
  196.  *   - 在角色的备注内填写<stand_picture:filename>,即可设置角色的菜单显示图
  197.  *   - 注意图片应当放置在img/pictures目录下
  198.  *   - filename不含后缀
  199.  *
  200.  * 角色的菜单显示图的最佳尺寸:
  201.  * - 菜单最大列数为4时,宽度为174像素。
  202.  * - 菜单最大列数为3时,宽度为240像素。
  203.  * - 指令选项行数为2时,高度为408像素。
  204.  * - 指令选项行数为1时,高度为444像素。
  205.  */
  206.  
  207. (function() {
  208.  
  209.     // set parameters                                                                   // 获取参数
  210.     var parameters = PluginManager.parameters('AltMenuScreen3');                        // 获取插件管理器中AltMenuScreen3的参数列表
  211.     var bgBitmapMenu = parameters['bgBitmapMenu'] || '';                                // 获取菜单界面背景图地址,如果没有,则标记为空
  212.     var bgBitmapItem = parameters['bgBitmapItem'] || '';                                // 获取物品界面背景图地址,如果没有,则标记为空
  213.     var bgBitmapSkill = parameters['bgBitmapSkill'] || '';                              // 获取技能界面背景图地址,如果没有,则标记为空
  214.     var bgBitmapEquip = parameters['bgBitmapEquip'] || '';                              // 获取装备界面背景图地址,如果没有,则标记为空
  215.     var bgBitmapStatus = parameters['bgBitmapStatus'] || '';                            // 获取状态界面背景图地址,如果没有,则标记为空
  216.     var bgBitmapOptions = parameters['bgBitmapOptions'] || '';                          // 获取设置界面背景图地址,如果没有,则标记为空
  217.     var bgBitmapFile = parameters['bgBitmapFile'] || '';                                // 获取存读档界面背景图地址,如果没有,则标记为空
  218.     var bgBitmapGameEnd = parameters['bgBitmapGameEnd'] || '';                          // 获取游戏结束界面背景图地址,如果没有,则标记为空
  219.     var maxColsMenuWnd = Number(parameters['maxColsMenu'] || 4);                        // 菜单窗口项目最大列数
  220.     var rowsCommandWnd = Number(parameters['commandRows'] || 2);                        // 指令窗口项目最大行数
  221.     var isDisplayStatus = !!Number(parameters['isDisplayStatus']);                      // 是否显示角色状态内容
  222.  
  223.     //                                                                                  //
  224.     // make transparent windows for each scenes in menu.                                // 设置所有菜单界面中的窗口的透明度
  225.     //                                                                                  //
  226.     var _Scene_Menu_create = Scene_Menu.prototype.create;                               // 用_Scene_Menu_create指向原始的创建菜单界面函数
  227.     Scene_Menu.prototype.create = function() {                                          // 追加用于本插件的创建菜单界面函数
  228.         _Scene_Menu_create.call(this);                                                      // 调用原始的创建菜单界面函数
  229.         this._statusWindow.x = 0;                                                           // 设置状态窗口的X坐标为0
  230.         this._statusWindow.y = this._commandWindow.height;                                  // 设置状态窗口的Y坐标为指令窗口的高度
  231.         this._goldWindow.x = Graphics.boxWidth - this._goldWindow.width;                    // 设置金币窗口的X坐标为游戏窗口的宽度 - 金币窗口的宽度
  232.         // make transparent for all windows at menu scene.                                  // 注释:设置ESC菜单界面内的所有窗口的透明度为0
  233.         this._statusWindow.opacity = 0;                                                     // 设置状态窗口的透明度为0
  234.         this._goldWindow.opacity = 0;                                                       // 设置金币窗口的透明度为0
  235.         this._commandWindow.opacity = 0;                                                    // 设置指令窗口的透明度为0
  236.     };
  237.  
  238.     var _Scene_Item_create = Scene_Item.prototype.create;                               // 用_Scene_Item_create指向原始的创建物品界面函数
  239.     Scene_Item.prototype.create = function() {                                          // 追加用于本插件的创建物品界面函数
  240.         _Scene_Item_create.call(this);                                                      // 调用原始的创建物品界面函数
  241.         this._helpWindow.opacity = 0;                                                       // 设置帮助窗口的透明度为0
  242.         this._categoryWindow.opacity = 0;                                                   // 设置对话窗口的透明度为0
  243.         this._itemWindow.opacity = 0;                                                       // 设置物品窗口的透明度为0
  244.         this._actorWindow.opacity = 0;                                                      // 设置角色窗口的透明度为0
  245.     };
  246.  
  247.     var _Scene_Skill_create = Scene_Skill.prototype.create;                             // 用_Scene_Skill_create指向原始的创建技能界面函数
  248.     Scene_Skill.prototype.create = function() {                                         // 追加用于本插件的创建技能界面函数
  249.         _Scene_Skill_create.call(this);                                                     // 调用原始的创建技能界面函数
  250.         this._helpWindow.opacity = 0;                                                       // 设置帮助窗口的透明度为0
  251.         this._skillTypeWindow.opacity = 0;                                                  // 设置技能类型窗口的透明度为0
  252.         this._statusWindow.opacity = 0;                                                     // 设置状态窗口的透明度为0
  253.         this._itemWindow.opacity = 0;                                                       // 设置物品窗口的透明度为0
  254.         this._actorWindow.opacity = 0;                                                      // 设置角色窗口的透明度为0
  255.     };
  256.  
  257.     var _Scene_Equip_create = Scene_Equip.prototype.create;                             // 用_Scene_Equip_create指向原始的创建装备界面函数
  258.     Scene_Equip.prototype.create = function() {                                         // 追加用于本插件的创建装备界面函数
  259.         _Scene_Equip_create.call(this);                                                     // 调用原始的创建装备界面函数
  260.         this._helpWindow.opacity = 0;                                                       // 设置帮助窗口的透明度为0
  261.         this._statusWindow.opacity = 0;                                                     // 设置状态窗口的透明度为0
  262.         this._commandWindow.opacity = 0;                                                    // 设置指令窗口的透明度为0
  263.         this._slotWindow.opacity = 0;                                                       // 设置装备槽窗口的透明度为0
  264.         this._itemWindow.opacity = 0;                                                       // 设置物品窗口的透明度为0
  265.     };
  266.  
  267.     var _Scene_Status_create = Scene_Status.prototype.create;                           // 用_Scene_Status_create指向原始的创建状态界面函数
  268.     Scene_Status.prototype.create = function() {                                        // 追加用于本插件的创建状态界面函数
  269.         _Scene_Status_create.call(this);                                                    // 调用原始的创建状态界面函数
  270.         this._statusWindow.opacity = 0;                                                     // 设置状态窗口的透明度为0
  271.     };
  272.  
  273.     var _Scene_Options_create = Scene_Options.prototype.create;                         // 用_Scene_Options_create指向原始的创建设置界面函数
  274.     Scene_Options.prototype.create = function() {                                       // 追加用于本插件的创建设置界面函数
  275.         _Scene_Options_create.call(this);                                                   // 调用原始的创建设置界面函数
  276.         this._optionsWindow.opacity = 0;                                                    // 设置设置窗口的透明度为0 ... 设置设置是什么鬼(╯‵□′)╯︵┻━┻
  277.     };
  278.  
  279.     var _Scene_File_create = Scene_File.prototype.create;                               // 用_Scene_File_create指向原始的创建存读档界面函数
  280.     Scene_File.prototype.create = function() {                                          // 追加用于本插件的创建存读档界面函数
  281.         _Scene_File_create.call(this);                                                      // 调用原始的创建存读档界面函数
  282.         this._helpWindow.opacity = 0;                                                       // 设置帮助窗口的透明度为0
  283.         this._listWindow.opacity = 0;                                                       // 设置列表窗口的透明度为0
  284.     };
  285.  
  286.     var _Scene_GameEnd_create = Scene_GameEnd.prototype.create;                         // 用_Scene_File_create指向原始的创建游戏结束界面函数
  287.     Scene_GameEnd.prototype.create = function() {                                       // 追加用于本插件的创建游戏结束界面函数
  288.         _Scene_GameEnd_create.call(this);                                                   // 调用原始的创建游戏结束界面函数
  289.         this._commandWindow.opacity = 0;                                                    // 设置指令窗口的透明度为0
  290.     };
  291.  
  292.     //                                                                                  //
  293.     // load bitmap that set in plugin parameters                                        // 载入插件参数数据中指定的图片
  294.     //                                                                                  //
  295.     var _Scene_Menu_createBackground = Scene_Menu.prototype.createBackground;           // 用_Scene_Menu_createBackground指向原始的创建游戏菜单界面背景函数
  296.     Scene_Menu.prototype.createBackground = function(){                                 // 追加用于本插件的创建游戏菜单界面背景函数
  297.         if(bgBitmapMenu){                                                                   // 如果游戏菜单界面背景图参数不是空的
  298.             this._backgroundSprite = new Sprite();                                              // 创建一个新的背景图精灵
  299.             this._backgroundSprite.bitmap = ImageManager.loadPicture(bgBitmapMenu);             // 调用图片管理器,为背景图精灵创建游戏菜单背景图
  300.             this.addChild(this._backgroundSprite);                                              // 将背景图精灵添加到游戏菜单界面
  301.             return;                                                                             // 结束本次调用
  302.         }
  303.         // if background file is invalid, it does original process.                         // 如果游戏菜单背景图参数是空的,就执行原本的逻辑
  304.         _Scene_Menu_createBackground.call(this);                                                // 调用原始的创建游戏菜单背景函数
  305.     };
  306.  
  307.     var _Scene_Item_createBackground = Scene_Item.prototype.createBackground;           // 用_Scene_Item_createBackground指向原始的创建游戏物品界面背景函数
  308.     Scene_Item.prototype.createBackground = function(){                                 // 追加用于本插件的创建游戏物品界面背景函数
  309.         if(bgBitmapItem){                                                                   // 如果游戏物品界面背景图参数不是空的
  310.             this._backgroundSprite = new Sprite();                                              // 创建一个新的背景图精灵
  311.             this._backgroundSprite.bitmap = ImageManager.loadPicture(bgBitmapItem);             // 调用图片管理器,为背景图精灵创建物品界面背景图
  312.             this.addChild(this._backgroundSprite);                                              // 将背景图精灵添加到游戏菜单界面
  313.             return;                                                                             // 结束本次调用
  314.         }
  315.         // if background file is invalid, it does original process.                         // 如果游戏物品界面背景图参数是空的,就执行原本的逻辑
  316.         _Scene_Item_createBackground.call(this);                                                // 调用原始的创建游戏物品界面背景函数
  317.     };
  318.  
  319.     var _Scene_Skill_createBackground = Scene_Skill.prototype.createBackground;         // 用_Scene_Skill_createBackground指向原始的创建游戏技能界面背景函数
  320.     Scene_Skill.prototype.createBackground = function(){                                // 追加用于本插件的创建游戏技能界面背景函数
  321.         if(bgBitmapSkill){                                                                  // 如果游戏技能界面背景图参数不是空的
  322.             this._backgroundSprite = new Sprite();                                              // 创建一个新的背景图精灵
  323.             this._backgroundSprite.bitmap = ImageManager.loadPicture(bgBitmapSkill);            // 调用图片管理器,为背景图精灵创建技能界面背景图
  324.             this.addChild(this._backgroundSprite);                                              // 将背景图精灵添加到游戏菜单界面
  325.             return;                                                                             // 结束本次调用
  326.         }
  327.         // if background file is invalid, it does original process.                         // 如果游戏技能界面背景图参数是空的,就执行原本的逻辑
  328.         _Scene_Skill_createBackground.call(this);                                                // 调用原始的创建游戏技能界面背景函数
  329.     };
  330.  
  331.     var _Scene_Equip_createBackground = Scene_Equip.prototype.createBackground;          // 用_Scene_Equip_createBackground指向原始的创建游戏装备界面背景函数
  332.     Scene_Equip.prototype.createBackground = function(){                                 // 追加用于本插件的创建游戏装备界面背景函数
  333.         if(bgBitmapEquip){                                                                   // 如果游戏装备界面背景图参数不是空的
  334.             this._backgroundSprite = new Sprite();                                               // 创建一个新的背景图精灵
  335.             this._backgroundSprite.bitmap = ImageManager.loadPicture(bgBitmapEquip);             // 调用图片管理器,为背景图精灵创建装备界面背景图
  336.             this.addChild(this._backgroundSprite);                                               // 将背景图精灵添加到游戏菜单界面
  337.             return;                                                                              // 结束本次调用
  338.         }
  339.         // if background file is invalid, it does original process.                          // 如果游戏装备界面背景图参数是空的,就执行原本的逻辑
  340.         _Scene_Equip_createBackground.call(this);                                                 // 调用原始的创建游戏装备界面背景函数
  341.     };
  342.  
  343.     var _Scene_Status_createBackground = Scene_Status.prototype.createBackground;       // 用_Scene_Status_createBackground指向原始的创建游戏状态界面背景函数
  344.     Scene_Status.prototype.createBackground = function(){                               // 追加用于本插件的创建游戏状态界面背景函数
  345.         if(bgBitmapStatus){                                                                 // 如果游戏状态界面背景图参数不是空的
  346.             this._backgroundSprite = new Sprite();                                              // 创建一个新的背景图精灵
  347.             this._backgroundSprite.bitmap = ImageManager.loadPicture(bgBitmapStatus);           // 调用图片管理器,为背景图精灵创建状态界面背景图
  348.             this.addChild(this._backgroundSprite);                                              // 将背景图精灵添加到游戏菜单界面
  349.             return;                                                                             // 结束本次调用
  350.         }
  351.         // if background file is invalid, it does original process.s                        // 如果游戏状态界面背景图参数是空的,就执行原本的逻辑
  352.         _Scene_Status_createBackground.call(this);                                               // 调用原始的创建游戏状态界面背景函数
  353.     };
  354.  
  355.     var _Scene_Options_createBackground = Scene_Options.prototype.createBackground;     // 用_Scene_Options_createBackground指向原始的创建游戏设置界面背景函数
  356.     Scene_Options.prototype.createBackground = function(){                              // 追加用于本插件的创建游戏设置界面背景函数
  357.         if(bgBitmapOptions){                                                                // 如果游戏设置界面背景图参数不是空的
  358.             this._backgroundSprite = new Sprite();                                              // 创建一个新的背景图精灵
  359.             this._backgroundSprite.bitmap = ImageManager.loadPicture(bgBitmapOptions);          // 调用图片管理器,为背景图精灵创建设置界面背景图
  360.             this.addChild(this._backgroundSprite);                                              // 将背景图精灵添加到游戏菜单界面
  361.             return;                                                                             // 结束本次调用
  362.         }
  363.         // if background file is invalid, it does original process.                         // 如果游戏设置界面背景图参数是空的,就执行原本的逻辑
  364.         _Scene_Options_createBackground.call(this);                                              // 调用原始的创建游戏设置界面背景函数
  365.     };
  366.  
  367.     var _Scene_File_createBackground = Scene_File.prototype.createBackground;           // 用_Scene_File_createBackground指向原始的创建游戏存读档界面背景函数
  368.     Scene_File.prototype.createBackground = function(){                                 // 追加用于本插件的创建游戏存读档界面背景函数
  369.         if(bgBitmapFile){                                                                   // 如果游戏存读档界面背景图参数不是空的
  370.             this._backgroundSprite = new Sprite();                                              // 创建一个新的背景图精灵
  371.             this._backgroundSprite.bitmap = ImageManager.loadPicture(bgBitmapFile);             // 调用图片管理器,为背景图精灵创建存读档界面背景图
  372.             this.addChild(this._backgroundSprite);                                              // 将背景图精灵添加到游戏菜单界面
  373.             return;                                                                             // 结束本次调用
  374.         }
  375.         // if background file is invalid, it does original process.                         // 如果游戏存读档界面背景图参数是空的,就执行原本的逻辑
  376.         _Scene_File_createBackground.call(this);                                                 // 调用原始的创建游戏存读档界面背景函数
  377.     };
  378.  
  379.     var _Scene_GameEnd_createBackground = Scene_GameEnd.prototype.createBackground;     // 用_Scene_GameEnd_createBackground指向原始的创建游戏结束界面背景函数
  380.     Scene_GameEnd.prototype.createBackground = function(){                              // 追加用于本插件的创建游戏结束界面背景函数
  381.         if(bgBitmapGameEnd){                                                                // 如果游戏结束界面背景图参数不是空的
  382.             this._backgroundSprite = new Sprite();                                              // 创建一个新的背景图精灵
  383.             this._backgroundSprite.bitmap = ImageManager.loadPicture(bgBitmapGameEnd);          // 调用图片管理器,为背景图精灵创建结束界面背景图
  384.             this.addChild(this._backgroundSprite);                                              // 将背景图精灵添加到游戏菜单界面
  385.             return;                                                                             // 结束本次调用
  386.         }
  387.         // if background file is invalid, it does original process.                         // 如果游戏结束界面背景图参数是空的,就执行原本的逻辑
  388.         _Scene_GameEnd_createBackground.call(this);                                              // 调用原始的创建游戏结束界面背景函数
  389.     };
  390.  
  391.     //                                                                                  //
  392.     // alt menu screen processes                                                        // 修改菜单界面的实际逻辑进程
  393.     //                                                                                  //
  394.     Window_MenuCommand.prototype.windowWidth = function() {                             // 重定义指令窗口的宽度
  395.         return Graphics.boxWidth;                                                           // 返回游戏窗口宽度
  396.     };
  397.  
  398.     Window_MenuCommand.prototype.maxCols = function() {                                 // 重定义指令窗口项目的最大列数
  399.         return 4;                                                                           // 返回⑨
  400.     };
  401.  
  402.     Window_MenuCommand.prototype.numVisibleRows = function() {                          // 重定义指令窗口项目的可见行数
  403.         return rowsCommandWnd;                                                              // 返回“指令行数(参数)”
  404.     };
  405.  
  406.     Window_MenuStatus.prototype.windowWidth = function() {                              // 重定义状态窗口的宽度
  407.         return Graphics.boxWidth;                                                           // 返回游戏窗口宽度
  408.     };
  409.  
  410.     Window_MenuStatus.prototype.windowHeight = function() {                             // 重定义状态窗口的高度
  411.         var h1 = this.fittingHeight(1);                                                     // 【?】自动适配1行项目的高度
  412.         var h2 = this.fittingHeight(rowsCommandWnd);                                        // 【?】自动适配“指令行数(参数)”行项目的高度
  413.         return Graphics.boxHeight - h1 - h2;                                                // 返回游戏窗口高度-【?】-【?】
  414.     };
  415.  
  416.     Window_MenuStatus.prototype.maxCols = function() {                                  // 重定义状态窗口的最大列数
  417.         return maxColsMenuWnd;                                                              // 返回“指令列数(参数)”
  418.     };
  419.  
  420.     Window_MenuStatus.prototype.numVisibleRows = function() {                           // 重定义状态窗口的可见行数
  421.         return 1;                                                                           // 返回奥特曼变身器
  422.     };
  423.  
  424.     Window_MenuStatus.prototype.drawItemImage = function(index) {                       // 重定义状态窗口的项目图片绘制函数
  425.         var actor = $gameParty.members()[index];                                            // 获取角色队伍中排序为index的角色
  426.         var rect = this.itemRectForText(index);                                             // 获取排序为index的项目图片绘制区域
  427.         // load stand_picture                                                               // 注释:读取标准角色图
  428.         var bitmapName = $dataActors[actor.actorId()].meta.stand_picture;                   // 【?】读取当前角色的标准角色图名字
  429.         var bitmap = bitmapName ? ImageManager.loadPicture(bitmapName) : null;              // 如果角色图名字不为空,则载入角色图,否则不载入图片
  430.         var w = Math.min(rect.width, (bitmapName ? bitmap.width : 144));                    // 如果角色图名字不为空,则读取项目图片绘制区域或角色图的宽度中较小的一个,如果没有角色图,则认为角色图宽度为144
  431.         var h = Math.min(rect.height, (bitmapName ? bitmap.height : 144));                  // 如果角色图名字不为空,则读取项目图片绘制区域或角色图的高度中较小的一个,如果没有角色图,则认为角色图高度为144
  432.         var lineHeight = this.lineHeight();                                                 // 读取状态窗口的行高
  433.         this.changePaintOpacity(actor.isBattleMember());                                    // 【?】改变绘制功能的透明度
  434.         if(bitmap){                                                                         // 如果存在角色图
  435.             var sx = (bitmap.width > w) ? (bitmap.width - w) / 2 : 0;                           // 一套算法,用于计算出适配角色图的区域坐标
  436.             var sy = (bitmap.height > h) ? (bitmap.height - h) / 2 : 0;                         // ...
  437.             var dx = (bitmap.width > rect.width) ? rect.x :                                     // ...
  438.                 rect.x + (rect.width - bitmap.width) / 2;                                       // ...
  439.             var dy = (bitmap.height > rect.height) ? rect.y :                                   // ...
  440.                 rect.y + (rect.height - bitmap.height) / 2;                                     // ...
  441.             this.contents.blt(bitmap, sx, sy, w, h, dx, dy);                                    // ...
  442.         } else { // when bitmap is not set, do the original process.                        // 如果不存在角色图,则调用原始的状态窗口的项目图片绘制函数
  443.             this.drawActorFace(actor, rect.x, rect.y + lineHeight * 2.5, w, h);                 // 为当前角色绘制角色图(脸图)
  444.         }
  445.         this.changePaintOpacity(true);                                                      // 【?】恢复绘制功能的透明度
  446.     };
  447.  
  448.     Window_MenuStatus.prototype.drawItemStatus = function(index) {                      // 重定义状态窗口的项目属性绘制函数
  449.         if(!isDisplayStatus){                                                               // 如果“是否显示角色状态(参数)”为否
  450.             return;                                                                             // 结束本次调用
  451.         }
  452.         var actor = $gameParty.members()[index];                                            // 读取角色队伍中排序为index的角色
  453.         var rect = this.itemRectForText(index);                                             // 读取排序为index的项目图片绘制区域
  454.         var x = rect.x;                                                                     // 获取排序为index的项目图片绘制区域的X坐标
  455.         var y = rect.y;                                                                     // 获取排序为index的项目图片绘制区域的Y坐标
  456.         var width = rect.width;                                                             // 获取排序为index的项目图片绘制区域的宽度
  457.         var bottom = y + rect.height;                                                       // 获取排序为index的项目图片绘制区域的底部坐标
  458.         var lineHeight = this.lineHeight();                                                 // 获取状态窗口的行高
  459.         this.drawActorName(actor, x, y + lineHeight * 0, width);                            // 绘制排序为index的角色姓名
  460.         this.drawActorLevel(actor, x, y + lineHeight * 1, width);                           // 绘制排序为index的角色等级
  461.         this.drawActorClass(actor, x, bottom - lineHeight * 4, width);                      // 绘制排序为index的角色职业
  462.         this.drawActorHp(actor, x, bottom - lineHeight * 3, width);                         // 绘制排序为index的角色生命值
  463.         this.drawActorMp(actor, x, bottom - lineHeight * 2, width);                         // 绘制排序为index的角色魔法值
  464.         this.drawActorIcons(actor, x, bottom - lineHeight * 1, width);                      // 【?】绘制排序为index的角色状态图标
  465.     };
  466.  
  467.     var _Window_MenuActor_initialize = Window_MenuActor.prototype.initialize;           // 用_Window_MenuActor_initialize指向原始的菜单角色初始化函数
  468.     Window_MenuActor.prototype.initialize = function() {                                // 重定义菜单角色初始化函数
  469.         _Window_MenuActor_initialize.call(this);                                            // 调用原始的菜单角色初始化函数
  470.         this.y = this.fittingHeight(2);                                                     // 【?】设置菜单角色的Y坐标为两行项目的行高
  471.     };
  472.  
  473. })();

作者: Front    时间: 2015-10-26 00:34
本帖最后由 Front 于 2015-10-26 17:27 编辑

回炉重新整理!!!{:2_269:}
作者: doranikofu    时间: 2015-10-26 01:11
菜单用图片背景神马的最赞了
作者: grayuncle    时间: 2015-10-26 01:43
游戏运行中按F8会出现什么东西?脚本编辑器?
作者: MonsterJohnCN    时间: 2015-10-26 03:36
grayuncle 发表于 2015-10-26 01:43
游戏运行中按F8会出现什么东西?脚本编辑器?

你可以理解为一个在游戏中直接测试脚本的工具。
可以临时模拟所有你能通过脚本实现的事情。
作者: 肚子饿    时间: 2015-10-30 00:13
本帖最后由 肚子饿 于 2015-10-30 00:15 编辑

先顶一个!!!汉化原插件还有DLC的脚本插件确实是坑,希望能坚持下去
作者: MonsterJohnCN    时间: 2015-10-30 01:38
本帖最后由 MonsterJohnCN 于 2015-10-30 01:54 编辑
肚子饿 发表于 2015-10-30 00:13
先顶一个!!!汉化原插件还有DLC的脚本插件确实是坑,希望能坚持下去


不过汉化过程中我发现RMMV不少原有&DLC插件的实用价值相对来说并不算高,实际汉化还是要做做筛选

后续主要打算汉化RMMV原生库,拟出结构,相比之下感觉实用价值、学习价值以及对个人的能力提升都更有用。


另外PIXI这玩意儿倒是很棒{:2_275:}
作者: 余烬之中    时间: 2015-11-22 09:42
主楼是原创脚本,下面的楼层基本上是汉化么
如果你把他们拆开的话,我就可以发两次糖了
先给原创糖
作者: 淮南的坏男子    时间: 2016-2-23 15:30
  1. //=============================================================================
  2. // PictureCallCommon.js
  3. // ----------------------------------------------------------------------------
  4. // Copyright (c) 2015 Triacontane
  5. // This plugin is released under the MIT License.
  6. // http://opensource.org/licenses/mit-license.php
  7. // ----------------------------------------------------------------------------
  8. // Version
  9. // 1.3.0 2016/01/24 ピクチャをなでなでする機能を追加
  10. //                  トリガーにマウスムーブを追加
  11. //                  ピクチャが回転しているときに正しく位置を補足できるよう修正
  12. // 1.2.1 2016/01/21 呼び出すコモンイベントの上限を100から1000(DB上の最大値)に修正
  13. //                  競合対策(YEP_MessageCore.js)
  14. // 1.2.0 2016/01/14 ホイールクリック、ダブルクリックなどトリガーを10種類に拡充
  15. // 1.1.3 2016/01/02 競合対策(TDDP_BindPicturesToMap.js)
  16. // 1.1.2 2015/12/20 長押しイベント発生時に1秒間のインターバルを設定するよう仕様変更
  17. // 1.1.1 2015/12/10 ピクチャを消去後にマウスオーバーするとエラーになる現象を修正
  18. // 1.1.0 2015/11/23 コモンイベントを呼び出した対象のピクチャ番号を特定する機能を追加
  19. //                  設定で透明色を考慮する機能を追加
  20. //                  トリガーとして「右クリック」や「長押し」を追加
  21. // 1.0.0 2015/11/14 初版
  22. // ----------------------------------------------------------------------------
  23. // [Blog]   : http://triacontane.blogspot.jp/
  24. // [Twitter]: https://twitter.com/triacontane/
  25. // [GitHub] : https://github.com/triacontane/
  26. //=============================================================================

  27. /*:ja
  28. * @plugindesc ピクチャのボタン化プラグイン
  29. * @author トリアコンタン
  30. *
  31. * @param 透明色を考慮
  32. * @desc クリックされた箇所が透明色だった場合は、クリックを無効にする。
  33. * @default OFF
  34. *
  35. * @param ピクチャ番号の変数番号
  36. * @desc コモンイベント呼び出し時にピクチャ番号を格納するゲーム変数の番号。
  37. * @default 0
  38. *
  39. * @param ポインタX座標の変数番号
  40. * @desc マウスカーソルもしくはタッチした位置のX座標を常に格納するゲーム変数の番号
  41. * @default 0
  42. *
  43. * @param ポインタY座標の変数番号
  44. * @desc マウスカーソルもしくはタッチした位置のY座標を常に格納するゲーム変数の番号
  45. * @default 0
  46. *
  47. * @help ピクチャをクリックすると、指定したコモンイベントが
  48. * 呼び出されるようになるプラグインコマンドを提供します。
  49. * このプラグインを利用すれば、javascriptの知識がなくても
  50. * 誰でも簡単にクリックやタッチを主体にしたゲームを作れます。
  51. *
  52. * 注意!
  53. * 一度関連づけたピクチャとコモンイベントはピクチャを消去しても有効です。
  54. * ピクチャが存在しなければどこをクリックしても反応しませんが、
  55. * 同じ番号で再度、ピクチャの表示を行うと反応するようになります。
  56. *
  57. * プラグインコマンド詳細
  58. *  イベントコマンド「プラグインコマンド」から実行。
  59. *  (引数の間は半角スペースで区切る)
  60. *
  61. *  ピクチャのボタン化 or
  62. *  P_CALL_CE [ピクチャ番号] [コモンイベントID] [トリガー]:
  63. *      ピクチャの領域内でトリガー条件を満たした場合に呼び出されるコモンイベントを関連づけます。
  64. *    トリガーは以下の通りです。(省略すると 1 になります)
  65. *      1  : クリックした場合
  66. *      2  : 右クリックした場合
  67. *      3  : 長押しした場合
  68. *      4  : マウスをピクチャに重ねた場合
  69. *      5  : マウスをピクチャから放した場合
  70. *      6  : クリックを解放(リリース)した場合
  71. *      7  : クリックした場合(かつ長押しの際の繰り返しを考慮)
  72. *      8  : クリックしている間ずっと
  73. *      9  : ホイールクリックした場合(PCの場合のみ有効)
  74. *      10 : ダブルクリックした場合
  75. *      11 : マウスを移動した場合
  76. *
  77. *  例:P_CALL_CE 1 3 7
  78. *   :ピクチャのボタン化 \v[1] \v[2] \v[3]
  79. *
  80. *  ピクチャのボタン化解除 or
  81. *  P_CALL_CE_REMOVE [ピクチャ番号] :
  82. *      ピクチャとコモンイベントの関連づけを解除します。
  83. *      全てのトリガーが削除対象です。
  84. *
  85. *  例:P_CALL_CE_REMOVE 1
  86. *   :ピクチャのボタン化解除 \v[1]
  87. *
  88. *  ピクチャのなでなで設定 or
  89. *  P_STROKE [ピクチャ番号] [変数番号]
  90. *    指定したピクチャの上でマウスやタッチを動かすと、
  91. *    速さに応じた値が指定した変数に値が加算されるようになります。
  92. *    この設定はピクチャを差し替えたり、一時的に非表示にしても有効です。
  93. *    10秒でだいたい1000くらいまで溜まります。
  94. *
  95. *  例:P_STROKE 1 2
  96. *   :ピクチャのなでなで設定 \v[1] \v[2] \v[3]
  97. *
  98. *  ピクチャのなでなで解除 or
  99. *  P_STROKE_REMOVE [ピクチャ番号]
  100. *    指定したピクチャのなでなで設定を解除します。
  101. *
  102. *  例:P_STROKE_REMOVE 1
  103. *   :ピクチャのなでなで解除 \v[1]
  104. *
  105. *  ピクチャのポインタ化 or
  106. *  P_POINTER [ピクチャ番号]
  107. *    指定したピクチャがタッチ座標を自動で追従するようになります。
  108. *    タッチしていないと自動で非表示になります。
  109. *
  110. *  例:P_POINTER 1
  111. *   :ピクチャのポインタ化 \v[1]
  112. *
  113. *  ピクチャのポインタ化解除 or
  114. *  P_POINTER_REMOVE [ピクチャ番号]
  115. *    指定したピクチャのポインタ化を解除します。
  116. *
  117. *  例:P_POINTER_REMOVE 1
  118. *   :ピクチャのポインタ化解除 \v[1]
  119. *
  120. * 利用規約:
  121. *  作者に無断で改変、再配布が可能で、利用形態(商用、18禁利用等)
  122. *  についても制限はありません。
  123. *  このプラグインはもうあなたのものです。
  124. */
  125. /*:
  126. * @plugindesc Clickable picture plugin
  127. * @author triacontane
  128. *
  129. * @param TransparentConsideration
  130. * @desc if click position is transparent, click is disabled.
  131. * @default OFF
  132. *
  133. * @param GameVariablePictureNum
  134. * @desc Game variable number that stores the picture number when common event called.
  135. * @default 0
  136. *
  137. * @param GameVariableTouchX
  138. * @desc Game variable number that stores touch x position
  139. * @default 0
  140. *
  141. * @param GameVariableTouchY
  142. * @desc Game variable number that stores touch y position
  143. * @default 0
  144. *
  145. * @help When clicked picture, call common event.
  146. *
  147. * Plugin Command
  148. *
  149. *  P_CALL_CE [Picture number] [Common event ID] [Trigger]:
  150. *      When picture was clicked, assign common event id.
  151. *    Trigger are As below(if omit, It is specified to 1)
  152. *      1  : Left click
  153. *      2  : Right click
  154. *      3  : Long click
  155. *      4  : Mouse over
  156. *      5  : Mouse out
  157. *      6  : Mouse release
  158. *      7  : Mouse repeat click
  159. *      8  : Mouse press
  160. *      9  : Wheel click
  161. *      10 : Double click
  162. *      11 : Mouse move
  163. *
  164. *  P_CALL_CE_REMOVE [Picture number] :
  165. *      break relation from picture to common event.
  166. *
  167. *  This plugin is released under the MIT License.
  168. */
  169. (function () {
  170.     'use strict';
  171.     var pluginName = 'PictureCallCommon';

  172.     var getParamOther = function(paramNames) {
  173.         if (!Array.isArray(paramNames)) paramNames = [paramNames];
  174.         for (var i = 0; i < paramNames.length; i++) {
  175.             var name = PluginManager.parameters(pluginName)[paramNames[i]];
  176.             if (name) return name;
  177.         }
  178.         return null;
  179.     };

  180.     var getParamBoolean = function(paramNames) {
  181.         var value = getParamOther(paramNames);
  182.         return (value || '').toUpperCase() == 'ON';
  183.     };

  184.     var getParamNumber = function(paramNames, min, max) {
  185.         var value = getParamOther(paramNames);
  186.         if (arguments.length < 2) min = -Infinity;
  187.         if (arguments.length < 3) max = Infinity;
  188.         return (parseInt(value, 10) || 0).clamp(min, max);
  189.     };

  190.     var getCommandName = function(command) {
  191.         return (command || '').toUpperCase();
  192.     };

  193.     var getArgNumber = function (arg, min, max) {
  194.         if (arguments.length < 2) min = -Infinity;
  195.         if (arguments.length < 3) max = Infinity;
  196.         return (parseInt(convertEscapeCharacters(arg), 10) || 0).clamp(min, max);
  197.     };

  198.     var convertEscapeCharacters = function(text) {
  199.         if (text == null) text = '';
  200.         var window = SceneManager._scene._windowLayer.children[0];
  201.         return window ? window.convertEscapeCharacters(text) : text;
  202.     };

  203.     if (!Object.prototype.hasOwnProperty('iterate')) {
  204.         Object.defineProperty(Object.prototype, 'iterate', {
  205.             value: function(handler) {
  206.                 Object.keys(this).forEach(function(key, index) {
  207.                     handler.call(this, key, this[key], index);
  208.                 }, this);
  209.             }
  210.         });
  211.     }

  212.     //=============================================================================
  213.     // Game_Interpreter
  214.     //  プラグインコマンド[P_CALL_CE]などを追加定義します。
  215.     //=============================================================================
  216.     var _Game_Interpreter_pluginCommand      = Game_Interpreter.prototype.pluginCommand;
  217.     Game_Interpreter.prototype.pluginCommand = function (command, args) {
  218.         _Game_Interpreter_pluginCommand.call(this, command, args);
  219.         var pictureId, commonId, trigger, variableNum;
  220.         switch (getCommandName(command)) {
  221.             case 'P_CALL_CE' :
  222.             case 'ピクチャのボタン化':
  223.                 pictureId = getArgNumber(args[0], 1, $gameScreen.maxPictures());
  224.                 commonId  = getArgNumber(args[1], 1, $dataCommonEvents.length - 1);
  225.                 trigger   = getArgNumber(args[2], 1, 11);
  226.                 $gameScreen.setPictureCallCommon(pictureId, commonId, trigger);
  227.                 break;
  228.             case 'P_CALL_CE_REMOVE' :
  229.             case 'ピクチャのボタン化解除':
  230.                 pictureId = getArgNumber(args[0], 1, $gameScreen.maxPictures());
  231.                 $gameScreen.setPictureRemoveCommon(pictureId);
  232.                 break;
  233.             case 'P_STROKE' :
  234.             case 'ピクチャのなでなで設定':
  235.                 pictureId = getArgNumber(args[0], 1, $gameScreen.maxPictures());
  236.                 variableNum  = getArgNumber(args[1], 1, $dataSystem.variables.length - 1);
  237.                 $gameScreen.setPictureStroke(pictureId, variableNum);
  238.                 break;
  239.             case 'P_STROKE_REMOVE' :
  240.             case 'ピクチャのなでなで解除':
  241.                 pictureId = getArgNumber(args[0], 1, $gameScreen.maxPictures());
  242.                 $gameScreen.removePictureStroke(pictureId);
  243.                 break;
  244.             case 'P_POINTER' :
  245.             case 'ピクチャのポインタ化':
  246.                 pictureId = getArgNumber(args[0], 1, $gameScreen.maxPictures());
  247.                 $gameScreen.setPicturePointer(pictureId);
  248.                 break;
  249.             case 'P_POINTER_REMOVE' :
  250.             case 'ピクチャのポインタ化解除':
  251.                 pictureId = getArgNumber(args[0], 1, $gameScreen.maxPictures());
  252.                 $gameScreen.removePicturePointer(pictureId);
  253.                 break;
  254.         }
  255.     };

  256.     //=============================================================================
  257.     // Game_Temp
  258.     //  呼び出し予定のコモンイベントIDのフィールドを追加定義します。
  259.     //=============================================================================
  260.     var _Game_Temp_initialize = Game_Temp.prototype.initialize;
  261.     Game_Temp.prototype.initialize = function() {
  262.         _Game_Temp_initialize.call(this);
  263.         this.clearPictureCallInfo();
  264.     };

  265.     Game_Temp.prototype.clearPictureCallInfo = function() {
  266.         this.setPictureCallInfo(0, 0);
  267.     };

  268.     Game_Temp.prototype.setPictureCallInfo = function(pictureCommonId, pictureNum) {
  269.         this._pictureCommonId = pictureCommonId;
  270.         this._pictureNum      = pictureNum;
  271.     };

  272.     Game_Temp.prototype.pictureCommonId = function() {
  273.         return this._pictureCommonId;
  274.     };

  275.     Game_Temp.prototype.pictureNum = function() {
  276.         return this._pictureNum;
  277.     };

  278.     //=============================================================================
  279.     // Game_Map
  280.     //  ピクチャがタッチされたときのコモンイベント呼び出し処理を追加定義します。
  281.     //=============================================================================
  282.     var _Game_Map_setupStartingEvent = Game_Map.prototype.setupStartingEvent;
  283.     Game_Map.prototype.setupStartingEvent = function() {
  284.         var result = _Game_Map_setupStartingEvent.call(this);
  285.         return result || this.setupPictureCommonEvent();
  286.     };

  287.     Game_Map.prototype.setupPictureCommonEvent = function() {
  288.         var commonId = $gameTemp._pictureCommonId;
  289.         var event    = $dataCommonEvents[commonId];
  290.         var result   = false;
  291.         if (commonId > 0 && !this.isEventRunning() && event) {
  292.             var gameValueNum = getParamNumber(['GameVariablePictureNum', 'ピクチャ番号の変数番号'],
  293.                 0, $dataSystem.variables.length);
  294.             if (gameValueNum !== 0) $gameVariables.setValue(gameValueNum, $gameTemp.pictureNum());
  295.             this._interpreter.setup(event.list);
  296.             result = true;
  297.         }
  298.         $gameTemp.clearPictureCallInfo();
  299.         return result;
  300.     };

  301.     //=============================================================================
  302.     // Game_Troop
  303.     //  ピクチャがタッチされたときのコモンイベント呼び出し処理を追加定義します。
  304.     //=============================================================================
  305.     Game_Troop.prototype.setupPictureCommonEvent = function() {
  306.         var commonId = $gameTemp.pictureCommonId();
  307.         var event = $dataCommonEvents[commonId];
  308.         if (commonId > 0 && !this.isEventRunning() && event) {
  309.             var gameValueNum = getParamNumber(['GameVariablePictureNum', 'ピクチャ番号の変数番号'],
  310.                 0, $dataSystem.variables.length);
  311.             if (gameValueNum !== 0) $gameVariables.setValue(gameValueNum, $gameTemp.pictureNum());
  312.             this._interpreter.setup(event.list);
  313.         }
  314.         $gameTemp.clearPictureCallInfo();
  315.     };

  316.     //=============================================================================
  317.     // Game_Screen
  318.     //  ピクチャに対応するコモンイベント呼び出し用のID配列を追加定義します。
  319.     //=============================================================================
  320.     var _Game_Screen_initialize = Game_Screen.prototype.initialize;
  321.     Game_Screen.prototype.initialize = function() {
  322.         _Game_Screen_initialize.call(this);
  323.         this._pictureCidArray = [];
  324.         this._pictureSidArray = [];
  325.         this._picturePidArray = [];
  326.     };

  327.     var _Game_Screen_update = Game_Screen.prototype.update;
  328.     Game_Screen.prototype.update = function() {
  329.         _Game_Screen_update.apply(this, arguments);
  330.         this.updatePointer();
  331.     };

  332.     Game_Screen.prototype.updatePointer = function() {
  333.         var paramTouchX = getParamNumber(['GameVariableTouchX', 'ポインタX座標の変数番号'],
  334.             0, $dataSystem.variables.length);
  335.         var paramTouchY = getParamNumber(['GameVariableTouchY', 'ポインタY座標の変数番号'],
  336.             0, $dataSystem.variables.length);
  337.         if (paramTouchX > 0) $gameVariables.setValue(paramTouchX, TouchInput.x);
  338.         if (paramTouchY > 0) $gameVariables.setValue(paramTouchY, TouchInput.y);
  339.     };

  340.     Game_Screen.prototype.setPictureCallCommon = function(pictureId, commonId, trigger) {
  341.         var realPictureId = this.realPictureId(pictureId);
  342.         if (this._pictureCidArray[realPictureId] == null) this._pictureCidArray[realPictureId] = [];
  343.         this._pictureCidArray[realPictureId][trigger] = commonId;
  344.     };

  345.     Game_Screen.prototype.setPictureRemoveCommon = function(pictureId) {
  346.         var realPictureId = this.realPictureId(pictureId);
  347.         this._pictureCidArray[realPictureId] = [];
  348.     };

  349.     Game_Screen.prototype.setPictureStroke = function(pictureId, variableNum) {
  350.         var realPictureId = this.realPictureId(pictureId);
  351.         this._pictureSidArray[realPictureId] = variableNum;
  352.     };

  353.     Game_Screen.prototype.removePictureStroke = function(pictureId) {
  354.         var realPictureId = this.realPictureId(pictureId);
  355.         this._pictureSidArray[realPictureId] = null;
  356.     };

  357.     Game_Screen.prototype.setPicturePointer = function(pictureId) {
  358.         var realPictureId = this.realPictureId(pictureId);
  359.         this._picturePidArray[realPictureId] = true;
  360.     };

  361.     Game_Screen.prototype.removePicturePointer = function(pictureId) {
  362.         var realPictureId = this.realPictureId(pictureId);
  363.         this._picturePidArray[realPictureId] = null;
  364.     };

  365.     Game_Screen.prototype.getPictureCid = function(pictureId) {
  366.         var realPictureId = this.realPictureId(pictureId);
  367.         return this._pictureCidArray[realPictureId];
  368.     };

  369.     Game_Screen.prototype.getPictureSid = function(pictureId) {
  370.         var realPictureId = this.realPictureId(pictureId);
  371.         return this._pictureSidArray[realPictureId];
  372.     };

  373.     Game_Screen.prototype.getPicturePid = function(pictureId) {
  374.         var realPictureId = this.realPictureId(pictureId);
  375.         return this._picturePidArray[realPictureId];
  376.     };

  377.     //=============================================================================
  378.     // Scene_Map
  379.     //  ピクチャのタッチ状態からのコモンイベント呼び出し予約を追加定義します。
  380.     //=============================================================================
  381.     var _Scene_Map_update = Scene_Map.prototype.update;
  382.     Scene_Map.prototype.update = function() {
  383.         if (!$gameMap.isEventRunning()) this.updateTouchPictures();
  384.         _Scene_Map_update.call(this);
  385.     };

  386.     Scene_Map.prototype.updateTouchPictures = function() {
  387.         this._spriteset.callTouchPictures();
  388.     };

  389.     var _Scene_Map_isMapTouchOk = Scene_Map.prototype.isMapTouchOk;
  390.     Scene_Map.prototype.isMapTouchOk = function() {
  391.         return _Scene_Map_isMapTouchOk.call(this) && $gameTemp.pictureCommonId() === 0;
  392.     };

  393.     //=============================================================================
  394.     // Scene_Battle
  395.     //  ピクチャのタッチ状態からのコモンイベント呼び出し予約を追加定義します。
  396.     //=============================================================================
  397.     var _Scene_Battle_update = Scene_Battle.prototype.update;
  398.     Scene_Battle.prototype.update = function() {
  399.         this.updateTouchPictures();
  400.         $gameTroop.setupPictureCommonEvent();
  401.         _Scene_Battle_update.call(this);
  402.     };

  403.     Scene_Battle.prototype.updateTouchPictures = function() {
  404.         this._spriteset.callTouchPictures();
  405.     };

  406.     //=============================================================================
  407.     // Spriteset_Base
  408.     //  ピクチャのタッチ状態からのコモンイベント呼び出し予約を追加定義します。
  409.     //=============================================================================
  410.     Spriteset_Base.prototype.callTouchPictures = function() {
  411.         var containerChildren = this._pictureContainer.children;
  412.         if (!Array.isArray(containerChildren))  {
  413.             this._pictureContainer.iterate(function (property) {
  414.                 if (this._pictureContainer[property].hasOwnProperty('children')) {
  415.                     containerChildren = this._pictureContainer[property].children;
  416.                     this._callTouchPicturesSub(containerChildren);
  417.                 }
  418.             }.bind(this));
  419.         } else {
  420.             this._callTouchPicturesSub(containerChildren);
  421.         }
  422.     };

  423.     Spriteset_Base.prototype._callTouchPicturesSub = function(containerChildren) {
  424.         containerChildren.forEach(function(picture) {
  425.             if (typeof picture.callTouch === 'function') picture.callTouch();
  426.         }, this);
  427.     };

  428.     //=============================================================================
  429.     // Sprite_Picture
  430.     //  ピクチャのタッチ状態からのコモンイベント呼び出し予約を追加定義します。
  431.     //=============================================================================
  432.     var _Sprite_Picture_initialize = Sprite_Picture.prototype.initialize;
  433.     Sprite_Picture.prototype.initialize = function(pictureId) {
  434.         _Sprite_Picture_initialize.call(this, pictureId);
  435.         this._triggerHandler = [];
  436.         this._triggerHandler[1]        = this.isTriggered;
  437.         this._triggerHandler[2]        = this.isCancelled;
  438.         this._triggerHandler[3]        = this.isLongPressed;
  439.         this._triggerHandler[4]        = this.isOnFocus;
  440.         this._triggerHandler[5]        = this.isOutFocus;
  441.         this._triggerHandler[6]        = this.isReleased;
  442.         this._triggerHandler[7]        = this.isRepeated;
  443.         this._triggerHandler[8]        = this.isPressed;
  444.         this._triggerHandler[9]        = this.isWheelTriggered;
  445.         this._triggerHandler[10]       = this.isDoubleTriggered;
  446.         this._triggerHandler[11]       = this.isMoved;
  447.         this._onMouse                  = false;
  448.         this._outMouse                 = false;
  449.         this._wasOnMouse               = false;
  450.         this._transparentConsideration = getParamBoolean(['TransparentConsideration', '透明色を考慮']);
  451.     };

  452.     var _Sprite_update = Sprite_Picture.prototype.update;
  453.     Sprite_Picture.prototype.update = function() {
  454.         _Sprite_update.call(this);
  455.         this.updateMouseMove();
  456.         this.updateStroke();
  457.         this.updatePointer();
  458.     };

  459.     Sprite_Picture.prototype.updateMouseMove = function() {
  460.         this._onMouse  = false;
  461.         this._outMouse = false;
  462.         if (TouchInput.isMoved()) {
  463.             if (this.isTouchable() && this.isTouchPosInRect() && !this.isTransparent()) {
  464.                 if (!this._wasOnMouse) {
  465.                     this._onMouse    = true;
  466.                     this._wasOnMouse = true;
  467.                 }
  468.             } else {
  469.                 if (this._wasOnMouse) {
  470.                     this._outMouse   = true;
  471.                     this._wasOnMouse = false;
  472.                 }
  473.             }
  474.         }
  475.     };

  476.     Sprite_Picture.prototype.updateStroke = function() {
  477.         var strokeNum = $gameScreen.getPictureSid(this._pictureId);
  478.         if (strokeNum > 0 && TouchInput.isPressed()) {
  479.             var value = $gameVariables.value(strokeNum);
  480.             $gameVariables.setValue(strokeNum, value + TouchInput.pressedDistance);
  481.         }
  482.     };

  483.     Sprite_Picture.prototype.updatePointer = function() {
  484.         var strokeNum = $gameScreen.getPicturePid(this._pictureId);
  485.         if (strokeNum > 0) {
  486.             this.opacity = TouchInput.isPressed() ? 255 : 0;
  487.             this.x = TouchInput.x;
  488.             this.y = TouchInput.y;
  489.             this.anchor.x = 0.5;
  490.             this.anchor.y = 0.5;
  491.         }
  492.     };

  493.     Sprite_Picture.prototype.callTouch = function() {
  494.         var commandIds = $gameScreen.getPictureCid(this._pictureId);
  495.         if (commandIds == null) return;
  496.         this._triggerHandler.iterate(function(i, handler) {
  497.             if (handler && commandIds[i] != null && handler.call(this) && (i === 5 || i === 4 || !this.isTransparent())) {
  498.                 if (i === 3) TouchInput._pressedTime = -60;
  499.                 $gameTemp.setPictureCallInfo(commandIds[i], this._pictureId);
  500.             }
  501.         }.bind(this));
  502.     };

  503.     Sprite_Picture.prototype.isTransparent = function () {
  504.         if (!this._transparentConsideration) return false;
  505.         var dx = TouchInput.x - this.x;
  506.         var dy = TouchInput.y - this.y;
  507.         var sin = Math.sin(-this.rotation);
  508.         var cos = Math.cos(-this.rotation);
  509.         var bx = Math.floor(dx * cos + dy * -sin) / this.scale.x + this.anchor.x * this.width;
  510.         var by = Math.floor(dx * sin + dy * cos)  / this.scale.y + this.anchor.y * this.height;
  511.         return this.bitmap.getAlphaPixel(bx, by) === 0;
  512.     };

  513.     Sprite_Picture.prototype.screenWidth = function() {
  514.         return (this.width || 0) * this.scale.x;
  515.     };

  516.     Sprite_Picture.prototype.screenHeight = function() {
  517.         return (this.height || 0) * this.scale.y;
  518.     };

  519.     Sprite_Picture.prototype.screenX = function() {
  520.         return (this.x || 0) - this.anchor.x * this.screenWidth();
  521.     };

  522.     Sprite_Picture.prototype.screenY = function() {
  523.         return (this.y || 0) - this.anchor.y * this.screenHeight();
  524.     };

  525.     Sprite_Picture.prototype.minX = function() {
  526.         return Math.min(this.screenX(), this.screenX() + this.screenWidth());
  527.     };

  528.     Sprite_Picture.prototype.minY = function() {
  529.         return Math.min(this.screenY(), this.screenY() + this.screenHeight());
  530.     };

  531.     Sprite_Picture.prototype.maxX = function() {
  532.         return Math.max(this.screenX(), this.screenX() + this.screenWidth());
  533.     };

  534.     Sprite_Picture.prototype.maxY = function() {
  535.         return Math.max(this.screenY(), this.screenY() + this.screenHeight());
  536.     };

  537.     Sprite_Picture.prototype.isTouchPosInRect = function () {
  538.         var dx = TouchInput.x - this.x;
  539.         var dy = TouchInput.y - this.y;
  540.         var sin = Math.sin(-this.rotation);
  541.         var cos = Math.cos(-this.rotation);
  542.         var rx = this.x + Math.floor(dx * cos + dy * -sin);
  543.         var ry = this.y + Math.floor(dx * sin + dy * cos);
  544.         return (rx >= this.minX() && rx <= this.maxX() &&
  545.                 ry >= this.minY() && ry <= this.maxY());
  546.     };

  547.     Sprite_Picture.prototype.isTouchable = function() {
  548.         return this.bitmap != null && this.visible && this.scale.x !== 0 && this.scale.y !== 0;
  549.     };

  550.     Sprite_Picture.prototype.isTriggered = function() {
  551.         return this.isTouchEvent(TouchInput.isTriggered);
  552.     };

  553.     Sprite_Picture.prototype.isCancelled = function() {
  554.         return this.isTouchEvent(TouchInput.isCancelled);
  555.     };

  556.     Sprite_Picture.prototype.isLongPressed = function() {
  557.         return this.isTouchEvent(TouchInput.isLongPressed);
  558.     };

  559.     Sprite_Picture.prototype.isPressed = function() {
  560.         return this.isTouchEvent(TouchInput.isPressed);
  561.     };

  562.     Sprite_Picture.prototype.isReleased = function() {
  563.         return this.isTouchEvent(TouchInput.isReleased);
  564.     };

  565.     Sprite_Picture.prototype.isRepeated = function() {
  566.         return this.isTouchEvent(TouchInput.isRepeated);
  567.     };

  568.     Sprite_Picture.prototype.isOnFocus = function() {
  569.         return this._onMouse;
  570.     };

  571.     Sprite_Picture.prototype.isOutFocus = function() {
  572.         return this._outMouse;
  573.     };

  574.     Sprite_Picture.prototype.isMoved = function() {
  575.         return this.isTouchEvent(TouchInput.isMoved);
  576.     };

  577.     Sprite_Picture.prototype.isWheelTriggered = function() {
  578.         return this.isTouchEvent(TouchInput.isWheelTriggered);
  579.     };

  580.     Sprite_Picture.prototype.isDoubleTriggered = function() {
  581.         return this.isTouchEvent(TouchInput.isDoubleTriggered);
  582.     };

  583.     Sprite_Picture.prototype.isTouchEvent = function(triggerFunc) {
  584.         return this.isTouchable() && triggerFunc.call(TouchInput) && this.isTouchPosInRect();
  585.     };

  586.     //=============================================================================
  587.     // TouchInput
  588.     //  ホイールクリック、ダブルクリック等を実装
  589.     //=============================================================================
  590.     TouchInput.keyDoubleClickInterval = 300;
  591.     TouchInput._pressStartX = -1;
  592.     TouchInput._pressStartY = -1;
  593.     TouchInput._pressedDistance = 0;
  594.     TouchInput._prevX = -1;
  595.     TouchInput._prevY = -1;

  596.     TouchInput.getPressStartPos = function() {
  597.         return new Position(this._pressStartX, this._pressStartY);
  598.     };

  599.     Object.defineProperty(TouchInput, 'pressedDistance', {
  600.         get: function() {
  601.             return this._pressedDistance;
  602.         },
  603.         configurable: true
  604.     });

  605.     TouchInput._onMouseMove = function(event) {
  606.         var x = Graphics.pageToCanvasX(event.pageX);
  607.         var y = Graphics.pageToCanvasY(event.pageY);
  608.         this._onMove(x, y);
  609.     };

  610.     var _TouchInput_clear = TouchInput.clear;
  611.     TouchInput.clear = function() {
  612.         _TouchInput_clear.apply(this, arguments);
  613.         this._events.wheelTriggered = false;
  614.         this._events.doubleTriggered = false;
  615.     };

  616.     var _TouchInput_update = TouchInput.update;
  617.     TouchInput.update = function() {
  618.         _TouchInput_update.apply(this, arguments);
  619.         this._wheelTriggered = this._events.wheelTriggered;
  620.         this._doubleTriggered = this._events.doubleTriggered;
  621.         this._events.wheelTriggered = false;
  622.         this._events.doubleTriggered = false;
  623.     };

  624.     TouchInput.isWheelTriggered = function() {
  625.         return this._wheelTriggered;
  626.     };

  627.     TouchInput.isDoubleTriggered = function() {
  628.         return this._doubleTriggered;
  629.     };

  630.     var _TouchInput_onMiddleButtonDown = TouchInput._onMiddleButtonDown;
  631.     TouchInput._onMiddleButtonDown = function(event) {
  632.         _TouchInput_onMiddleButtonDown.apply(this, arguments);
  633.         var x = Graphics.pageToCanvasX(event.pageX);
  634.         var y = Graphics.pageToCanvasY(event.pageY);
  635.         if (Graphics.isInsideCanvas(x, y)) {
  636.             this._onWheelTrigger(x, y);
  637.         }
  638.     };

  639.     TouchInput._onWheelTrigger = function(x, y) {
  640.         this._events.wheelTriggered = true;
  641.         this._x = x;
  642.         this._y = y;
  643.     };

  644.     var _TouchInput_onTrigger = TouchInput._onTrigger;
  645.     TouchInput._onTrigger = function(x, y) {
  646.         if (this._date && Date.now() - this._date < this.keyDoubleClickInterval)
  647.             this._events.doubleTriggered = true;
  648.         this._pressStartX = x;
  649.         this._pressStartY = y;
  650.         this._pressedDistance = 0;
  651.         this._prevX = x;
  652.         this._prevY = y;
  653.         _TouchInput_onTrigger.apply(this, arguments);
  654.     };

  655.     var _TouchInput_onMove = TouchInput._onMove;
  656.     TouchInput._onMove = function(x, y) {
  657.         if (this.isPressed()) this._pressedDistance = Math.abs(this._prevX - x) + Math.abs(this._prevY - y);
  658.         this._prevX = x;
  659.         this._prevY = y;
  660.         _TouchInput_onMove.apply(this, arguments);
  661.     };

  662.     var _TouchInput_onRelease = TouchInput._onRelease;
  663.     TouchInput._onRelease = function(x, y) {
  664.         this._pressStartX = 0;
  665.         this._pressStartY = 0;
  666.         this._pressedDistance = 0;
  667.         this._prevX = x;
  668.         this._prevY = y;
  669.         _TouchInput_onRelease.apply(this, arguments);
  670.     };
  671. })();
复制代码
求翻译




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1