查看: 3351|回复: 5

[有事请教] RPGmv 关于战斗ui的问题

[复制链接]
梦石
0
星屑
99
在线时间
42 小时
注册时间
2021-5-14
回帖
28
发表于 2021-5-29 15:33:17 | 显示全部楼层 |阅读模式

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

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

×
求教大佬,每次进入战斗,系统默认显示包含(攻击,技能,道具,逃跑)选项的窗口
选取了对应指令之后调用对应窗口,我该怎么才能屏蔽掉系统默认的这些窗口,进入战斗之后只调用自己的窗口呢
想要从零开始学ui
梦石
10
星屑
7635
在线时间
684 小时
注册时间
2017-1-9
回帖
596

我没有哭开拓者

发表于 2021-5-29 21:03:30 | 显示全部楼层
首先得从程序学起(认真)
想做自己的内容的话,绝对绕不开程序
这个B天天摸鱼,快点来个谁把他从被窝里拖出来
回复

使用道具 举报

梦石
0
星屑
99
在线时间
42 小时
注册时间
2021-5-14
回帖
28
 楼主| 发表于 2021-5-30 09:17:13 | 显示全部楼层
世界第一中二 发表于 2021-5-29 21:03
首先得从程序学起(认真)
想做自己的内容的话,绝对绕不开程序

已经在看源码了
回复

使用道具 举报

梦石
0
星屑
1566
在线时间
120 小时
注册时间
2021-4-3
回帖
192
发表于 2021-5-30 13:23:47 | 显示全部楼层
本帖最后由 ABXY-Kenobi 于 2021-5-30 14:12 编辑

分享一个可设置UⅠ位置的插件,原帖找不到了
  1. //=============================================================================
  2. // GraphicalDesignMode.js
  3. // ----------------------------------------------------------------------------
  4. // (C)2016 Triacontane
  5. // This software is released under the MIT License.
  6. // [url]http://opensource.org/licenses/mit-license.php[/url]
  7. // ----------------------------------------------------------------------------
  8. // Version
  9. // 2.10.3 2019/11/02 デザインモード設定時はクリックでメッセージウィンドウを送れないよう修正
  10. // 2.10.2 2019/02/27 初期状態でスクロールされているウィンドウの行高さを変更した場合に、スクロールの初期表示がずれる現象を修正
  11. // 2.10.1 2018/11/06 BattleFormation.jsとの競合を解消
  12. // 2.10.0 2018/08/18 メッセージウィンドウおよびサブウィンドウを本プラグインから触れないようにする設定を追加
  13. // 2.9.1 2018/07/10 コアスクリプト1.6.1以降で装備スロットウィンドウを動かした状態で装備画面を起動するとエラーになる問題を修正
  14. // 2.9.0 2018/06/27 ウィンドウが閉じている最中にGDM_LOCK_MESSAGE_WINDOWが実行されたとき、閉じ終わるまで実行を待機するよう修正
  15. // 2.8.2 2018/05/20 YEP_BattleEngineCore.jsとの併用時、デザインモードで一部ウィンドウで透明状態の切り替えが機能しない競合を解消
  16. // 2.8.1 2018/01/30 最新のNW.jsで動作するよう修正
  17. // 2.8.0 2017/07/26 コンソールからの関数実行で直前に編集したウィンドウの位置を変更できる機能を追加
  18. // 2.7.0 2017/04/11 2.6.0の修正で追加ウィンドウの位置変更が正常に動作しない問題を修正
  19. //                  選択肢ウィンドウについて位置変更を一時的に無効化するプラグインコマンドを追加
  20. // 2.6.0 2017/04/07 追加したピクチャやウィンドウについて任意のスイッチがONのときのみ表示できる機能を追加
  21. // 2.5.0 2017/03/11 ウィンドウを非表示にできる機能を追加
  22. // 2.4.0 2017/01/09 カスタムウィンドウに表示する内容に揃えを指定できる機能を追加しました。
  23. // 2.3.1 2016/11/30 RPGアツマールで画面がNowLoadingから進まなくなる場合がある問題を修正しました。
  24. // 2.3.0 2016/11/25 メッセージウィンドウの背景の表示可否を固定にできる機能を追加しました。
  25. // 2.2.1 2016/11/12 Macの場合、Ctrlキーの代わりにoptionキーを使用するようヘルプを追記
  26. // 2.2.0 2016/11/03 ウィンドウごとに使用するフォントを設定できる機能を追加
  27. // 2.1.0 2016/09/28 アイコンサイズをフォントサイズに合わせて自動で拡縮できる機能を追加
  28. //                  操作対象のウィンドウにフォーカスしたときに枠の色を変えて明示する機能を追加
  29. //                  数値項目のプロパティを設定する際にJavaScript計算式を適用できる機能を追加
  30. // 2.0.0 2016/08/22 本体v1.3.0によりウィンドウ透過の実装が変更されたので対応
  31. // 1.1.3 2016/08/05 本体v1.3.0にて表示される警告を抑制
  32. // 1.1.2 2016/07/20 一部のウィンドウでプロパティロード後にコンテンツが再作成されない問題を修正
  33. // 1.1.1 2016/07/17 余白とフォントサイズの変更が、画面切り替え後に元に戻ってしまう問題を修正
  34. // 1.1.0 2016/07/11 メッセージウィンドウのみ位置変更を一時的に無効化するプラグインコマンドを追加
  35. // 1.0.2 2016/04/02 liply_memoryleak_patch.jsとの競合を解消
  36. // 1.0.1 2016/03/28 一部のウィンドウのプロパティを変更しようとするとエラーが発生する現象の修正
  37. // 1.0.0 2016/03/13 初版
  38. // 0.9.0 2016/03/05 ベータ版
  39. // ----------------------------------------------------------------------------
  40. // [Blog]   : [url]https://triacontane.blogspot.jp/[/url]
  41. // [Twitter]: [url]https://twitter.com/triacontane/[/url]
  42. // [GitHub] : [url]https://github.com/triacontane/[/url]
  43. //=============================================================================

  44. /*:
  45. * @plugindesc GUI画面デザインプラグイン
  46. * パラメータを変更したら「プロジェクトの保存」(Ctrl+S)
  47. * @author トリアコンタン
  48. *
  49. * @param デザインモード
  50. * @desc 在设计模式下启动游戏。(ON/OFF)
  51. * 在模式中,您可以通过拖放来调整位置。
  52. * @default true
  53. * @type boolean
  54. *
  55. * @param 自動保存
  56. * @desc 更改位置时自动保存更改。(ON/OFF)
  57. * 通常,使用Ctrl + S保存。
  58. * @default false
  59. * @type boolean
  60. *
  61. * @param モバイル版作成
  62. * @desc 另外创建移动版的窗口配置。(ON/OFF)
  63. * 仅当您想要在移动版和PC版之间改变窗口配置时,才将其设置为ON。
  64. * @default false
  65. * @type boolean
  66. *
  67. * @param モバイル偽装
  68. * @desc 模拟移动执行。(ON/OFF)
  69. * 在创建或测试移动版窗口时将其打开。
  70. * @default false
  71. * @type boolean
  72. *
  73. * @param ウィンドウ透過
  74. * @desc 窗口重叠时透明显示。(ON/OFF)
  75. * 如果在其他插件中实现了同样的功能,则关闭。
  76. * @default false
  77. * @type boolean
  78. *
  79. * @param グリッドサイズ
  80. * @desc 在窗口调整期间以指定的大小显示网格。
  81. * 如果指定0,它将被隐藏。
  82. * @default 48
  83. * @type number
  84. *
  85. * @param パディング
  86. * @desc 窗口边缘的默认值。如果输入,则启用。默认:18
  87. * @default 0
  88. * @type number
  89. *
  90. * @param フォントサイズ
  91. * @desc 窗口字体大小的默认值。如果输入,则启用。默认:28
  92. * @default 0
  93. * @type number
  94. *
  95. * @param 行の高さ
  96. * @desc 窗口行高度的默认值。如果输入,则适用。默认:36
  97. * @default 0
  98. * @type number
  99. *
  100. * @param 背景透明度
  101. * @desc 窗口的背景透明度默认值。如果输入,则适用。默认:192
  102. * @default 0
  103. * @type number
  104. *
  105. * @param アイコンサイズ調整
  106. * @desc 当字体大小改变时,自动调整图标的大小。
  107. * @default false
  108. * @type boolean
  109. *
  110. * @param 背景表示可否固定
  111. * @desc 在有关事件的信息所在的窗口中,指定个别情况下的指令背景,并固定插入的信息。
  112. * @default false
  113. * @type boolean
  114. *
  115. * @param 右クリックで消去
  116. * @desc 在设计模式下右键单击时隐藏整个窗口。(OFF时只删除框)
  117. * @default false
  118. * @type boolean
  119. *
  120. * @param メッセージウィンドウを無視
  121. * @desc 请勿使用此插件触摸消息,选项和数字输入窗口。 更改后的位置不会重置。
  122. * @default false
  123. * @type boolean
  124. *
  125. * @help 您可以通过拖放来微调每个屏幕窗口和图像(例如菜单屏幕
  126. * 和战斗屏幕)的显示位置,从而以图形方式设计屏幕的外观。
  127. * 您可以在屏幕上更改宽度,高度,边距,背景图像等。
  128. *
  129. * 除了默认屏幕外,您还可以自定义插件添加的屏幕的位置。
  130. *
  131. * (但是,不能保证操作,因为它取决于另一方的实现。)
  132. *
  133. * 请按照以下步骤操作。
  134. *
  135. * 1. 将参数“设计模式”设置为“开”。
  136. *   - 默认情况下为“ON”。
  137. *
  138. * 2. 开始测试游戏、战斗测试和事件测试。
  139. *
  140. * 3. 用鼠标抓住对象并将其放置在您喜欢的地方。
  141. *   - 鼠标的正常窗口操作将被禁用。
  142. *   - 自动捕捉到其他窗口或屏幕边缘。(Shift禁用)
  143. *   - 按住Ctrl键可捕捉到网格。(对于Mac,option键)
  144. *   - 使用Ctrl + Z撤消上一次更改。
  145. *   - Ctrl + Shift + Enter初始化当前场景中的所有更改。
  146. *   - 在窗口中右键单击以在透明和不透明之间切换框架。
  147. *     如果更改了参数,则显示或隐藏整个窗口。
  148. *     一旦隐藏,就无法在不重置整个屏幕的情况下重新显示它。
  149. *   - 您可以在窗口中按数字键(※)来更改每个属性。
  150. *   - 如果在控制台中键入【changePos(x, y);】(x:X坐标,
  151. *     y:Y坐标),则可以更改刚刚编辑的窗口的位置。
  152. *
  153. * 4. 使用Ctrl + S保存您自己的位置。
  154. *
  155. * 5. 正常测试游戏时,将“设计模式”设置为“关”。
  156. *
  157. * ※数字和属性的对应关系(不是数字键的数字键)
  158. *
  159. * 1. 窗口的横向宽度(※1)
  160. * 2. 窗口的高度(直接指定)(※1)
  161. * 3. 窗口的边缘(※2)
  162. * 4. 窗口的字体大小(※2)
  163. * 5. 窗口一行的高度(※2)
  164. * 6. 窗口的背景透明度(※2)
  165. * 7. 窗口中的行数(※2)
  166. * 8. 窗口背景图片文件名
  167. * 9. 窗口字体名称
  168. *
  169. * ※1 可以应用JS公式。 该公式仅被动态评估一次。
  170. * ※2 可以应用JS计算公式。计算公式将被保存,并在每次屏幕显示时重新评估。
  171. * 如果不知道的话,像以前一样设定数值就没有问题了。
  172. * ※3 您需要加载字体。请使用“字体加载插件”。
  173. * 入手先:raw.githubusercontent.com/triacontane/RPGMakerMV/master/FontLoad.js
  174. * ※4 对于Mac,请用option键替代Ctrl键。(用命令键不响应)
  175. *
  176. * 另外,可以额外显示任何图片或窗口。
  177. * 有关详细信息,请参阅源代码的“用户重写区域”「ユーザ書き換え領域」。
  178. * 您还可以通过拖放来调整附加显示的位置。
  179. *
  180. * 可以使用以下控制字符来更改窗口中显示的内容的对齐方式。
  181. * \\AL[left]   # 左对齐(如果留空,则将其左对齐)
  182. * \\AL[0]      # 同上
  183. * \\AL[center] # 中央揃え
  184. * \\AL[1]      # 同上
  185. * \\AL[right]  # 右揃え
  186. * \\AL[2]      # 同上
  187. *
  188. * 保存的内容保存在“data/ContainerProperties.json”中。
  189. * 也可以用JSON编辑器等进行编辑。
  190. *
  191. * 此外,您还可以为移动设备定义不同的窗口配置。
  192. * 移动的配置信息保存在“data/ContainerPropertiesMobile.json”中。
  193. *
  194. * 启用移动伪装选项后,您可以在PC上复制移动设备上的运行。
  195. * 当再现移动运行时,音频和视频文件的使用格式可能会发生变
  196. * 化,或者音频文件将不再被播放。
  197. *
  198. * 此后已无法重新定位使用此插件重新定位的Windows。
  199. * 因此,如果您使用本插件将位置固定到游戏期间动态更改位置的窗口,
  200. * 则可能无法正常显示。
  201. *
  202. * 在这种情况下,如果显示错误,建议您执行一次
  203. * Ctrl + Shift + Enter,以初始化屏幕上的所有窗口。
  204. *
  205. * 要注意! 在部署期间,添加的图片可能会作为未使用的文件排除在外。
  206. *
  207. * 在这种情况下,必须采取措施,例如重新插入已删除的文件。
  208. *
  209. * 注意!
  210. * 根据其他插件的使用情况,窗口位置和大小可能无法正确保存。
  211. *
  212. *
  213. * 插件命令详细信息
  214. *  从事件命令“插件命令”执行。
  215. *  (用空格分隔参数。)
  216. *
  217. * GDM取消_消息窗口
  218. * GDM_UNLOCK_MESSAGE_WINDOW
  219. *  暂时取消消息窗口的位置更改。
  220. *  在插件中更改的坐标将被禁用,
  221. *  并启用事件“消息显示”中指定的窗口位置。
  222. *
  223. * GDM固定_消息窗口
  224. * GDM_LOCK_MESSAGE_WINDOW
  225. *  再次启用消息窗口的位置更改。
  226. *  在插件中更改的坐标将被启用,
  227. *  并且事件“消息显示”中指定的窗口位置将被忽略。
  228. *
  229. * GDM取消_选项窗口
  230. * GDM_UNLOCK_CHOICE_WINDOW
  231. *  暂时取消选项窗口中的位置更改。
  232. *  プラグインで変更した座標が無効になり
  233. *  在插件中更改的坐标将被禁用,并且在事件“显示选项”中指定的窗口位置将被启用。
  234. *
  235. * GDM固定_选项窗口
  236. * GDM_LOCK_CHOICE_WINDOW
  237. *  再次启用消息窗口的位置更改。
  238. *  在插件中更改的坐标将被启用,
  239. *  并且事件“显示选项”中指定的窗口位置将被忽略。
  240. *
  241. * 利用規約:
  242. *  作者に無断で改変、再配布が可能で、利用形態(商用、18禁利用等)
  243. *  についても制限はありません。
  244. *  このプラグインはもうあなたのものです。
  245. */
  246. var $dataContainerProperties = null;

  247. (function() {
  248.     'use strict';
  249.     //=============================================================================
  250.     // 用户重写区域 - 開始 -
  251.     //  pictures : 在每个屏幕上显示的图片信息
  252.     //  windows  : 在每个屏幕上显示的窗口信息
  253.     // (此处指定的文件名在部署时可能会被
  254.     //  排除为未使用的文件)
  255.     // ※为了便于复制和粘贴,我们还给最后一个项目添加了逗号。
  256.     //=============================================================================
  257.     var settings = {
  258.         /* 标题画面的追加信息 */
  259.         Scene_Title   : {
  260.             /* pictures:要添加到场景中的图片。 无条件显示。 */
  261.             pictures: [
  262.                 /* file:指定「img/pictures/」目录下不带扩展的文件  switchId: 显示条件的开关ID*/
  263.                 {file: '', switchId: 0},
  264.             ],
  265.             /* windows:这是要添加到场景中的窗口。*/
  266.             windows : [
  267.                 /* lines:显示内容数组。 可以使用控制字符。「\\i[n]」と「\」をひとつ多く指定してください。*/
  268.                 /* switchId:这是出现条件的开关ID。 */
  269.                 /* 若要在调整位置后添加新窗口,请务必“添加到数组末尾” */
  270.                 {lines: [], switchId: 0},
  271.             ],
  272.         },
  273.         /* 主菜单屏幕的附加信息 */
  274.         Scene_Menu    : {
  275.             pictures: [
  276.                 {file: '', switchId: 0},
  277.             ],
  278.             windows : [
  279.                 {lines: [], switchId: 0},
  280.             ],
  281.         },
  282.         /* 战斗画面的追加信息 */
  283.         Scene_Battle  : {
  284.             pictures: [
  285.                 {file: '', switchId: 0},
  286.             ],
  287.             windows : [
  288.                 {lines: [], switchId: 0},
  289.             ],
  290.         },
  291.         /* 项目菜单屏幕上的附加信息 */
  292.         Scene_Item    : {
  293.             pictures: [
  294.                 {file: '', switchId: 0},
  295.             ],
  296.             windows : [
  297.                 {lines: [], switchId: 0},
  298.             ],
  299.         },
  300.         /* 技能菜单屏幕上的其他信息 */
  301.         Scene_Skill   : {
  302.             pictures: [
  303.                 {file: '', switchId: 0},
  304.             ],
  305.             windows : [
  306.                 {lines: [], switchId: 0},
  307.             ],
  308.         },
  309.         /* 装备菜单画面的追加信息 */
  310.         Scene_Equip   : {
  311.             pictures: [
  312.                 {file: '', switchId: 0},
  313.             ],
  314.             windows : [
  315.                 {lines: [], switchId: 0},
  316.             ],
  317.         },
  318.         /* 状态菜单屏幕上的附加信息 */
  319.         Scene_Status  : {
  320.             pictures: [
  321.                 {file: '', switchId: 0},
  322.             ],
  323.             windows : [
  324.                 {lines: [], switchId: 0},
  325.             ],
  326.         },
  327.         /* 选项屏幕的附加信息 */
  328.         Scene_Options : {
  329.             pictures: [
  330.                 {file: '', switchId: 0},
  331.             ],
  332.             windows : [
  333.                 {lines: [], switchId: 0},
  334.             ],
  335.         },
  336.         /* 保存屏幕的附加信息 */
  337.         Scene_Save    : {
  338.             pictures: [
  339.                 {file: '', switchId: 0},
  340.             ],
  341.             windows : [
  342.                 {lines: [], switchId: 0},
  343.             ],
  344.         },
  345.         /* 加载屏幕的附加信息 */
  346.         Scene_Load    : {
  347.             pictures: [
  348.                 {file: '', switchId: 0},
  349.             ],
  350.             windows : [
  351.                 {lines: [], switchId: 0},
  352.             ],
  353.         },
  354.         /* 商店屏幕的附加信息 */
  355.         Scene_Shop    : {
  356.             pictures: [
  357.                 {file: '', switchId: 0},
  358.             ],
  359.             windows : [
  360.                 {lines: [], switchId: 0},
  361.             ],
  362.         },
  363.         /* 名称输入屏幕上的其他信息 */
  364.         Scene_Name    : {
  365.             pictures: [
  366.                 {file: '', switchId: 0},
  367.             ],
  368.             windows : [
  369.                 {lines: [], switchId: 0},
  370.             ],
  371.         },
  372.         /* ゲームオーバー画面の追加情報 */
  373.         Scene_Gameover: {
  374.             pictures: [
  375.                 {file: '', switchId: 0},
  376.             ],
  377.             windows : [
  378.                 {lines: [], switchId: 0},
  379.             ],
  380.         },
  381.     };
  382.     //=============================================================================
  383.     // ユーザ書き換え領域 - 終了 -
  384.     //=============================================================================
  385.     var pluginName    = 'GraphicalDesignMode';
  386.     var metaTagPrefix = 'GDM';

  387.     if (!Utils.RPGMAKER_VERSION || Utils.RPGMAKER_VERSION.match(/^1\.2./)) {
  388.         alert('!!!このプラグインは本体バージョン1.3系以降でないと使用できません。!!!');
  389.         return;
  390.     }

  391.     var getParamNumber = function(paramNames, min, max) {
  392.         var value = getParamOther(paramNames);
  393.         if (value == null) return null;
  394.         if (arguments.length < 2) min = -Infinity;
  395.         if (arguments.length < 3) max = Infinity;
  396.         return (parseInt(value, 10) || 0).clamp(min, max);
  397.     };

  398.     var getParamBoolean = function(paramNames) {
  399.         var value = getParamOther(paramNames);
  400.         return value.toUpperCase() === 'ON' || value.toUpperCase() === 'TRUE';
  401.     };

  402.     var getParamOther = function(paramNames) {
  403.         if (!Array.isArray(paramNames)) paramNames = [paramNames];
  404.         for (var i = 0; i < paramNames.length; i++) {
  405.             var name = PluginManager.parameters(pluginName)[paramNames[i]];
  406.             if (name) return name;
  407.         }
  408.         return null;
  409.     };

  410.     var getArgString = function(arg, upperFlg) {
  411.         arg = convertEscapeCharacters(arg);
  412.         return upperFlg ? arg.toUpperCase() : arg;
  413.     };

  414.     var getArgEval = function(arg, min, max) {
  415.         if (arguments.length < 2) min = -Infinity;
  416.         if (arguments.length < 3) max = Infinity;
  417.         return (eval(convertEscapeCharacters(arg)) || 0).clamp(min, max);
  418.     };

  419.     var convertEscapeCharacters = function(text) {
  420.         if (text == null) text = '';
  421.         var window = SceneManager._scene._windowLayer.children[0];
  422.         return window ? window.convertEscapeCharacters(text) : text;
  423.     };

  424.     var checkTypeFunction = function(value) {
  425.         return checkType(value, 'Function');
  426.     };

  427.     var checkType = function(value, typeName) {
  428.         return Object.prototype.toString.call(value).slice(8, -1) === typeName;
  429.     };

  430.     var getClassName = function(object) {
  431.         return object.constructor.toString().replace(/function\s+(.*)\s*\([\s\S]*/m, '$1');
  432.     };

  433.     var getCommandName = function(command) {
  434.         return (command || '').toUpperCase();
  435.     };

  436.     var paramDesignMode      = getParamBoolean(['DesignMode', 'デザインモード']);
  437.     var paramThroughWindow   = getParamBoolean(['ThroughWindow', 'ウィンドウ透過']);
  438.     var paramAutoSave        = getParamBoolean(['AutoSave', '自動保存']);
  439.     var paramGridSize        = getParamNumber(['GridSize', 'グリッドサイズ'], 0) || 0;
  440.     var paramPadding         = getParamNumber(['Padding', 'パディング']);
  441.     var paramFontSize        = getParamNumber(['FontSize', 'フォントサイズ']);
  442.     var paramLineHeight      = getParamNumber(['LineHeight', '行の高さ']);
  443.     var paramBackOpacity     = getParamNumber(['LineHeight', '背景透明度']);
  444.     var paramMobileMake      = getParamBoolean(['MobileMake', 'モバイル版作成']);
  445.     var paramFakeMobile      = getParamBoolean(['FakeMobile', 'モバイル偽装']);
  446.     var paramIconSizeScale   = getParamBoolean(['IconSizeScale', 'アイコンサイズ調整']);
  447.     var paramBackgroundFixed = getParamBoolean(['BackgroundFixed', '背景表示可否固定']);
  448.     var paramRightClickHide  = getParamBoolean(['RightClickHide', '右クリックで消去']);
  449.     var paramIgnoreMesWindow = getParamBoolean(['IgnoreMesWindow', 'メッセージウィンドウを無視']);

  450.     //=============================================================================
  451.     // Utils
  452.     //  デザインモード判定を追加します。
  453.     //=============================================================================
  454.     Utils.isDesignMode = function() {
  455.         return (this.isOptionValid('test') || this.isOptionValid('btest') || this.isOptionValid('etest')) &&
  456.             this.isNwjs() && paramDesignMode;
  457.     };

  458.     //=============================================================================
  459.     // デザインモードの場合のみ実装する
  460.     //=============================================================================
  461.     if (Utils.isDesignMode()) {

  462.         //=============================================================================
  463.         // グローバル関数
  464.         //=============================================================================
  465.         window.changePos = function(x, y) {
  466.             SceneManager.setLastWindowPosition(x, y);
  467.         };

  468.         //=============================================================================
  469.         // Input
  470.         //  コピーと上書き保存用のボタンを追加定義します。
  471.         //=============================================================================
  472.         Input.keyMapper[67] = 'copy';
  473.         Input.keyMapper[83] = 'save';
  474.         for (var i = 49; i < 58; i++) {
  475.             Input.keyMapper[i] = 'num' + (i - 48);
  476.         }

  477.         var _Input__wrapNwjsAlert = Input._wrapNwjsAlert;
  478.         Input._wrapNwjsAlert      = function() {
  479.             _Input__wrapNwjsAlert.apply(this, arguments);
  480.             var _prompt   = window.prompt;
  481.             window.prompt = function() {
  482.                 var gui    = require('nw.gui');
  483.                 var win    = gui.Window.get();
  484.                 var result = _prompt.apply(this, arguments);
  485.                 win.focus();
  486.                 Input.clear();
  487.                 return result;
  488.             };
  489.         };

  490.         var _Input_isRepeated = Input.isRepeated;
  491.         Input.isRepeated      = function(keyName) {
  492.             if (keyName === 'ok' && this.isPressed('control')) {
  493.                 return false;
  494.             }
  495.             return _Input_isRepeated.apply(this, arguments);
  496.         };

  497.         //=============================================================================
  498.         // TouchInput
  499.         //  ポインタ位置を常に記憶します。
  500.         //=============================================================================
  501.         TouchInput._onMouseMove = function(event) {
  502.             var x = Graphics.pageToCanvasX(event.pageX);
  503.             var y = Graphics.pageToCanvasY(event.pageY);
  504.             this._onMove(x, y);
  505.         };

  506.         //=============================================================================
  507.         // SceneManager
  508.         //  ウィンドウポジションをjson形式で保存する処理を追加定義します。
  509.         //=============================================================================
  510.         SceneManager.controlNumber = 0;

  511.         var _SceneManager_initialize = SceneManager.initialize;
  512.         SceneManager.initialize      = function() {
  513.             _SceneManager_initialize.call(this);
  514.             this.lastWindowX            = null;
  515.             this.lastWindowY            = null;
  516.             this._lastWindow            = null;
  517.             this._windowPositionChanged = false;
  518.             this.infoWindow             = '';
  519.             this.infoExtend             = '';
  520.             this._copyCount             = 0;
  521.             this._infoHelp              = 'デザインモードで起動しています。 ';
  522.             this._documentTitle         = '';
  523.             this._changeStack           = [];
  524.             this.showDevToolsForGdm();
  525.         };

  526.         SceneManager.setLastWindow = function(windowObject) {
  527.             this._lastWindow = windowObject;
  528.         };

  529.         SceneManager.setLastWindowPosition = function(x, y) {
  530.             if (!this._lastWindow) {
  531.                 this.setInfoExtend('直前に触れたオブジェクトが存在しないため、この操作は無効です。', 0);
  532.                 return;
  533.             }
  534.             this._lastWindow.position.x = x;
  535.             this._lastWindow.position.y = y;
  536.             this._windowPositionChanged = true;
  537.         };

  538.         SceneManager.isWindowPositionChanged = function(windowObject) {
  539.             if (this._windowPositionChanged && windowObject === this._lastWindow) {
  540.                 this._windowPositionChanged = false;
  541.                 return true;
  542.             }
  543.             return false;
  544.         };

  545.         SceneManager.showDevToolsForGdm = function() {
  546.             var nwWin = require('nw.gui').Window.get();
  547.             if (nwWin.isDevToolsOpen) {
  548.                 if (!nwWin.isDevToolsOpen()) {
  549.                     var devTool = nwWin.showDevTools();
  550.                     devTool.moveTo(0, 0);
  551.                     devTool.resizeTo(window.screenX + window.outerWidth, window.screenY + window.outerHeight);
  552.                     nwWin.focus();
  553.                 }
  554.             } else {
  555.                 nwWin.showDevTools();
  556.             }
  557.             this.outputStartLog();
  558.         };

  559.         SceneManager.outputStartLog = function() {
  560.             var logValue = [
  561.                 '☆☆☆ようこそ、デザインモードで起動しました。☆☆☆\n',
  562.                 'デザインモードでは、オブジェクトの配置やプロパティを自由に設定して実際のゲーム画面上から画面設計できます。\n',
  563.                 '--------------------操 作 方 法----------------------------------------------------------------------\n',
  564.                 'ドラッグ&ドロップ : ウィンドウや画像を掴んで好きな場所に再配置します。\n',
  565.                 'Ctrl+マウス : ウィンドウや画像がグリッドにスナップします。(Macの場合はoptionキー)\n',
  566.                 'Shift+マウス : ウィンドウや画像がオブジェクトや画面端にスナップしなくなります。\n',
  567.                 'コンソールに「changePos(x, y);」(x:X座標、y:Y座標)と打ち込むと直前に編集したウィンドウ位置を変更できます。\n',
  568.                 'Ctrl+S : 全ての変更を保存します。\n',
  569.                 'Ctrl+C : 直前に操作した座標をクリップボードにコピーします。\n',
  570.                 'Ctrl+Z : 直前に行った操作を元に戻します。\n',
  571.                 'Ctrl+Shift+Enter : 表示している画面の配置を全てリセットしてロードし直します。\n',
  572.                 '右クリック : ウィンドウの枠(もしくはウィンドウ全体)の表示/非表示を切り替えます。\n',
  573.                 '数字キー : ウィンドウの範囲内で押下すると、以下のとおり対応するプロパティを変更できます。\n',
  574.                 ' 1. ウィンドウの横幅(※1)\n',
  575.                 ' 2. ウィンドウの高さ(直接指定)(※1)\n',
  576.                 ' 3. ウィンドウの余白(※2)\n',
  577.                 ' 4. ウィンドウのフォントサイズ(※2)\n',
  578.                 ' 5. ウィンドウの1行のあたりの高さ(※2)\n',
  579.                 ' 6. ウィンドウの背景透明度(※2)\n',
  580.                 ' 7. ウィンドウの行数(※2)\n',
  581.                 ' 8. ウィンドウの背景画像ファイル名\n',
  582.                 ' 9. ウィンドウのフォント名(※3)\n',
  583.                 '※1 JS計算式を適用できます。計算式は入力したその場で1回だけ評価されます。\n',
  584.                 '※2 JS計算式を適用できます。計算式は保存され、画面表示のたびに再評価されます。\n',
  585.                 '分からない場合、今まで通り数値を設定すれば問題ありません。\n',
  586.                 '※3 あらかじめフォントをロードする必要があります。「フォントロードプラグイン」をお使いください。\n',
  587.                 '入手先:raw.githubusercontent.com/triacontane/RPGMakerMV/master/FontLoad.js\n',
  588.                 '※4 Macの場合、Ctrlキーはoptionキーで代用してください。(commandキーでは反応しません)\n',
  589.                 '-----------------------------------------------------------------------------------------------------\n',
  590.                 '以下の操作ログが表示されます。\n'
  591.             ];
  592.             console.log.apply(console, logValue);
  593.         };

  594.         var _SceneManager_onSceneCreate = SceneManager.onSceneCreate;
  595.         SceneManager.onSceneCreate      = function() {
  596.             _SceneManager_onSceneCreate.apply(this, arguments);
  597.             this._changeStack = [];
  598.         };

  599.         SceneManager.pushChangeStack = function(child) {
  600.             var index = child.parent.getChildIndex(child);
  601.             var info  = {parent: child.parent, index: index};
  602.             child.saveProperty(info);
  603.             this._changeStack.push(info);
  604.         };

  605.         SceneManager.popChangeStack = function() {
  606.             var info = this._changeStack.pop();
  607.             if (info) {
  608.                 var child = info.parent.children[info.index];
  609.                 if (child) {
  610.                     child.loadProperty(info);
  611.                     child.saveContainerInfo();
  612.                     return true;
  613.                 }
  614.             }
  615.             return false;
  616.         };

  617.         var _SceneManager_update = SceneManager.updateMain;
  618.         SceneManager.updateMain  = function() {
  619.             _SceneManager_update.apply(this, arguments);
  620.             this.updateDragInfo();
  621.         };

  622.         SceneManager.updateDragInfo = function() {
  623.             if (Input.isPressed('control') && Input.isTriggered('copy')) {
  624.                 SoundManager.playOk();
  625.                 if (this.lastWindowX == null || this.lastWindowY == null) return;
  626.                 var clipboard = require('nw.gui').Clipboard.get();
  627.                 var copyValue = '';
  628.                 if (this._copyCount % 2 === 0) {
  629.                     copyValue = this.lastWindowX.toString();
  630.                     this.setInfoExtend('X座標[' + copyValue + ']をクリップボードにコピーしました。', 0);
  631.                 } else {
  632.                     copyValue = this.lastWindowY.toString();
  633.                     this.setInfoExtend('Y座標[' + copyValue + ']をクリップボードにコピーしました。', 0);
  634.                 }
  635.                 clipboard.set(copyValue, 'text');
  636.                 this._copyCount++;
  637.             }
  638.             if (Input.isPressed('control') && Input.isTriggered('save')) {
  639.                 SoundManager.playSave();
  640.                 DataManager.saveDataFileWp();
  641.                 this.setInfoExtend('すべての変更を保存しました。', 0);
  642.             }
  643.             if (Input.isPressed('control') && Input.isTriggered('ok')) {
  644.                 if (this.popChangeStack()) {
  645.                     SoundManager.playCancel();
  646.                     this.setInfoExtend('左記の番号の操作を元に戻しました。', -1);
  647.                     if (paramAutoSave) DataManager.saveDataFileWp();
  648.                 }
  649.             }
  650.             if (Input.isPressed('control') && Input.isPressed('shift') && Input.isPressed('ok')) {
  651.                 $dataContainerProperties[this.getSceneName()] = {};
  652.                 DataManager.saveDataFileWp();
  653.                 location.reload();
  654.             }
  655.             var docTitle        = this._infoHelp + this.infoWindow + this.infoExtend;
  656.             document.title      = docTitle;
  657.             this._documentTitle = docTitle;
  658.         };

  659.         SceneManager.setInfoExtend = function(value, add) {
  660.             this.controlNumber += add;
  661.             this.infoExtend = ' ' + value;
  662.             console.log(add ? this.controlNumber + (add < 0 ? 1 : 0) + ' : ' + value : value);
  663.             if (paramAutoSave && add !== 0) {
  664.                 console.log('自動保存により変更が保存されました。');
  665.             }
  666.         };

  667.         //=============================================================================
  668.         // DataManager
  669.         //  ウィンドウポジションをjson形式で保存する処理を追加定義します。
  670.         //=============================================================================
  671.         DataManager.saveDataFileWp = function() {
  672.             StorageManager.saveToLocalDataFile(this._databaseFileCp.src, window[this._databaseFileCp.name]);
  673.         };

  674.         //=============================================================================
  675.         // StorageManager
  676.         //  ウィンドウポジションをjson形式で保存する処理を追加定義します。
  677.         //=============================================================================
  678.         StorageManager.saveToLocalDataFile = function(fileName, json) {
  679.             var data     = JSON.stringify(json);
  680.             var fs       = require('fs');
  681.             var dirPath  = this.localDataFileDirectoryPath();
  682.             var filePath = dirPath + fileName;
  683.             if (!fs.existsSync(dirPath)) {
  684.                 fs.mkdirSync(dirPath);
  685.             }
  686.             fs.writeFileSync(filePath, data);
  687.         };

  688.         StorageManager.localDataFileDirectoryPath = function() {
  689.             var path = require('path');
  690.             var base = path.dirname(process.mainModule.filename);
  691.             return path.join(base, 'data/');
  692.         };

  693.         //=============================================================================
  694.         // Scene_Base
  695.         //  ウィンドウをドラッグ&ドロップします。
  696.         //=============================================================================
  697.         var _Scene_Base_update      = Scene_Base.prototype.update;
  698.         Scene_Base.prototype.update = function() {
  699.             _Scene_Base_update.apply(this, arguments);
  700.             if (this._windowLayer) this.updateDrag();
  701.         };

  702.         Scene_Base.prototype.updateDrag = function() {
  703.             this._windowLayer.isFrameChanged = false;

  704.             var result = this._windowLayer.children.clone().reverse().some(function(container) {
  705.                 return checkTypeFunction(container.processDesign) && container.processDesign();
  706.             }, this);
  707.             if (result) return;
  708.             this.children.clone().reverse().some(function(container) {
  709.                 return checkTypeFunction(container.processDesign) && container.processDesign();
  710.             }, this);
  711.         };

  712.         var _Scene_Base_createWindowLayer      = Scene_Base.prototype.createWindowLayer;
  713.         Scene_Base.prototype.createWindowLayer = function() {
  714.             if (!(this instanceof Scene_Boot) && !(this instanceof Scene_Map)) this.createGridSprite();
  715.             _Scene_Base_createWindowLayer.apply(this, arguments);
  716.         };

  717.         Scene_Base.prototype.createGridSprite = function() {
  718.             var size = paramGridSize;
  719.             if (size === 0) return;
  720.             var width        = Graphics.boxWidth;
  721.             var height       = Graphics.boxHeight;
  722.             this._gridSprite = new Sprite();
  723.             this._gridSprite.setFrame(0, 0, width, height);
  724.             var bitmap = new Bitmap(width, height);
  725.             for (var x = 0; x < width; x += size) {
  726.                 bitmap.fillRect(x, 0, 1, height, 'rgba(255,255,255,1.0)');
  727.             }
  728.             for (var y = 0; y < height; y += size) {
  729.                 bitmap.fillRect(0, y, width, 1, 'rgba(255,255,255,1.0)');
  730.             }
  731.             this._gridSprite.bitmap      = bitmap;
  732.             this._gridSprite.moveDisable = true;
  733.             this.addChild(this._gridSprite);
  734.         };

  735.         //=============================================================================
  736.         // PIXI.Container およびそのサブクラス
  737.         //  コンテナをドラッグ&ドロップします。
  738.         //=============================================================================
  739.         var _PIXI_DisplayObjectContainer_initialize = PIXI.Container.prototype.initialize;
  740.         PIXI.Container.prototype.initialize         = function(x, y, width, height) {
  741.             _PIXI_DisplayObjectContainer_initialize.apply(this, arguments);
  742.             this._holding      = false;
  743.             this._dx           = 0;
  744.             this._dy           = 0;
  745.             this.moveDisable   = false;
  746.             this._positionLock = false;
  747.         };

  748.         PIXI.Container.prototype.processDesign = function() {
  749.             var result = false;
  750.             if (!this.moveDisable) {
  751.                 if (this.processPosition()) {
  752.                     var info                 = 'X:[' + this.x + '] Y:[' + this.y + ']';
  753.                     SceneManager.lastWindowX = this.x;
  754.                     SceneManager.lastWindowY = this.y;
  755.                     SceneManager.infoWindow  = info;
  756.                     SceneManager.infoCopy    = '';
  757.                     if (!this._holding) SceneManager.setInfoExtend('位置を変更しました。' + info, 1);
  758.                     result = true;
  759.                 }
  760.                 if (this.processOpacity()) {
  761.                     SceneManager.setInfoExtend('背景の表示/非表示を変更しました。', 1);
  762.                     result = true;
  763.                 }
  764.                 if (this.processInput()) {
  765.                     SceneManager.setInfoExtend(this._propLabel + 'の値を' + this._propValue + 'に変更しました。', 1);
  766.                     result = true;
  767.                 }
  768.                 this.processFrameChange();
  769.             }
  770.             return result;
  771.         };

  772.         if (paramIgnoreMesWindow) {
  773.             Window_Message.prototype.processDesign = function() {};
  774.             Window_NumberInput.prototype.processDesign = function() {};
  775.             Window_ChoiceList.prototype.processDesign = function() {};
  776.         }

  777.         PIXI.Container.prototype.processPosition = function() {
  778.             if (SceneManager.isWindowPositionChanged(this)) {
  779.                 return true;
  780.             }
  781.             if (this.isTouchEvent(TouchInput.isTriggered) || (this._holding && TouchInput.isPressed())) {
  782.                 if (!this._holding) this.hold();
  783.                 var x = TouchInput.x - this._dx;
  784.                 var y = TouchInput.y - this._dy;
  785.                 if (Input.isPressed('control')) {
  786.                     var size = paramGridSize;
  787.                     if (size !== 0) {
  788.                         x += (x % size > size / 2 ? size - x % size : -(x % size));
  789.                         y += (y % size > size / 2 ? size - y % size : -(y % size));
  790.                     }
  791.                 } else if (!Input.isPressed('shift') && !this.isAnchorChanged()) {
  792.                     x = this.updateSnapX(x);
  793.                     y = this.updateSnapY(y);
  794.                 }
  795.                 this.position.x    = x;
  796.                 this.position.y    = y;
  797.                 this._positionLock = true;
  798.                 return true;
  799.             } else if (this._holding) {
  800.                 this.release();
  801.                 return true;
  802.             }
  803.             return false;
  804.         };

  805.         PIXI.Container.prototype.processFrameChange = function() {};

  806.         Window_Base.prototype.processFrameChange = function() {
  807.             if (this._holding || !TouchInput.isMoved()) return;
  808.             if (this.isPreparedEvent() && !this.parent.isFrameChanged) {
  809.                 this._windowFrameSprite.setBlendColor([255, 128, 0, 192]);
  810.                 this.parent.isFrameChanged = true;
  811.                 SceneManager.setLastWindow(this);
  812.             } else {
  813.                 this._windowFrameSprite.setBlendColor([0, 0, 0, 0]);
  814.             }
  815.         };

  816.         PIXI.Container.prototype.processOpacity = function() {};

  817.         Window_Base.prototype.processOpacity = function() {
  818.             if (this.isTouchEvent(TouchInput.isCancelled)) {
  819.                 SoundManager.playMiss();
  820.                 SceneManager.pushChangeStack(this);
  821.                 if (paramRightClickHide) {
  822.                     this.visible = !this.visible;
  823.                 } else {
  824.                     this.opacity = (this.opacity === 255 ? 0 : 255);
  825.                 }
  826.                 this.saveContainerInfo();
  827.                 return true;
  828.             }
  829.             return false;
  830.         };

  831.         PIXI.Container.prototype.processInput = function() {};

  832.         Window_Base.prototype.processInput = function() {
  833.             if (this.isPreparedEvent()) {
  834.                 var params = [
  835.                     ['num1', '横幅', 'width', 1, 2000, null],
  836.                     ['num2', '高さ', 'height', 1, 2000, null],
  837.                     ['num3', 'パディング', '_customPadding', 1, 100, this.updatePadding.bind(this), true],
  838.                     ['num4', 'フォントサイズ', '_customFontSize', 1, 100, this.resetFontSettings.bind(this), true],
  839.                     ['num5', '行の高さ', '_customLineHeight', 1, 2000, this.setFittingHeight.bind(this), true],
  840.                     ['num6', '背景の透明度', '_customBackOpacity', 0, 255, this.updateBackOpacity.bind(this), true],
  841.                     ['num7', '行数', '_customLineNumber', 0, 999, this.setFittingHeight.bind(this), true],
  842.                     ['num8', '背景画像のファイル名', '_customBackFileName', null, null, this.createBackSprite.bind(this), true],
  843.                     ['num9', 'フォント名', '_customFontFace', null, null, this.resetFontSettings.bind(this), true]
  844.                 ];
  845.                 return params.some(function(param) {
  846.                     return this.processSetProperty.apply(this, param);
  847.                 }.bind(this));
  848.             }
  849.             return false;
  850.         };

  851.         Window_Base.prototype.setFittingHeight = function() {
  852.             if (this._customLineNumber) this.height = this.fittingHeight(this._customLineNumber);
  853.         };

  854.         Window_Base.prototype.processSetProperty = function(keyCode, propLabel, propName, min, max,
  855.                                                             callBack, stringFlg) {
  856.             if (this[propName] === undefined) return null;
  857.             if (Input.isTriggered(keyCode)) {
  858.                 var result = window.prompt(propLabel + 'を入力してください。', this[propName].toString());
  859.                 if (result || (stringFlg && result === '')) {
  860.                     this._windowFrameSprite.setBlendColor([0, 0, 0, 0]);
  861.                     SceneManager.pushChangeStack(this);
  862.                     this[propName] = stringFlg ? getArgString(result) : getArgEval(result, min, max);
  863.                     if (callBack) callBack();
  864.                     this.reDrawContents();
  865.                     SoundManager.playMagicEvasion();
  866.                     this.saveContainerInfo();
  867.                     this._propLabel = propLabel;
  868.                     this._propValue = this[propName];
  869.                     return true;
  870.                 }
  871.             }
  872.             return null;
  873.         };

  874.         Window_Base.prototype.reDrawContents = function() {
  875.             this.createContents();
  876.             this.refresh();
  877.         };

  878.         Window_Selectable.prototype.reDrawContents = function() {
  879.             Window_Base.prototype.reDrawContents.apply(this, arguments);
  880.             this.updateCursor();
  881.         };

  882.         PIXI.Container.prototype.isAnchorChanged = function() {
  883.             return false;
  884.         };

  885.         Sprite.prototype.isAnchorChanged = function() {
  886.             return this.anchor.x !== 0 || this.anchor.y !== 0;
  887.         };

  888.         PIXI.Container.prototype.hold = function() {
  889.             this._holding = true;
  890.             this._dx      = TouchInput.x - this.x;
  891.             this._dy      = TouchInput.y - this.y;
  892.             SceneManager.pushChangeStack(this);
  893.         };

  894.         Window_Base.prototype.hold = function() {
  895.             PIXI.Container.prototype.hold.call(this);
  896.             this._windowBackSprite.setBlendColor([255, 255, 255, 192]);
  897.             this._windowContentsSprite.setBlendColor([255, 128, 0, 192]);
  898.         };

  899.         Sprite.prototype.hold = function() {
  900.             PIXI.Container.prototype.hold.call(this);
  901.             this.setBlendColor([255, 255, 255, 192]);
  902.         };

  903.         PIXI.Container.prototype.release = function() {
  904.             this._holding = false;
  905.             this.saveContainerInfo();
  906.         };

  907.         Window_Base.prototype.release = function() {
  908.             PIXI.Container.prototype.release.call(this);
  909.             this._windowBackSprite.setBlendColor([0, 0, 0, 0]);
  910.             this._windowContentsSprite.setBlendColor([0, 0, 0, 0]);
  911.         };

  912.         Sprite.prototype.release = function() {
  913.             PIXI.Container.prototype.release.call(this);
  914.             this.setBlendColor([0, 0, 0, 0]);
  915.         };

  916.         PIXI.Container.prototype.updateSnapX = function(x) {
  917.             var minDistanceL = 16, minIndexL = -1, minDistanceR = 16, minIndexR = -1;
  918.             var children     = this.parent.children, endX = x + this.width;
  919.             for (var i = 0, n = children.length; i < n; i++) {
  920.                 var child = children[i];
  921.                 if (child !== this && this.isSameInstance(child) && child.isTouchable() && child.isOverlapY(this)) {
  922.                     var distanceL = Math.abs(x - child.endX);
  923.                     if (minDistanceL > distanceL) {
  924.                         minDistanceL = distanceL;
  925.                         minIndexL    = i;
  926.                     }
  927.                     var distanceR = Math.abs(endX - child.x);
  928.                     if (minDistanceR > distanceR) {
  929.                         minDistanceR = distanceR;
  930.                         minIndexR    = i;
  931.                     }
  932.                 }
  933.             }
  934.             if (minDistanceL > Math.abs(x)) return 0;
  935.             if (minDistanceR > Math.abs(Graphics.boxWidth - endX)) return Graphics.boxWidth - this.width;
  936.             if (minDistanceR > minDistanceL) {
  937.                 return minIndexL === -1 ? x : children[minIndexL].endX;
  938.             } else {
  939.                 return minIndexR === -1 ? x : children[minIndexR].x - this.width;
  940.             }
  941.         };

  942.         PIXI.Container.prototype.updateSnapY = function(y) {
  943.             var minDistanceU = 16, minIndexU = -1, minDistanceD = 16, minIndexD = -1;
  944.             var children     = this.parent.children, endY = y + this.height;
  945.             for (var i = 0, n = children.length; i < n; i++) {
  946.                 var child = children[i];
  947.                 if (child !== this && this.isSameInstance(child) && child.isTouchable() && child.isOverlapX(this)) {
  948.                     var distanceU = Math.abs(y - child.endY);
  949.                     if (minDistanceU > distanceU) {
  950.                         minDistanceU = distanceU;
  951.                         minIndexU    = i;
  952.                     }
  953.                     var distanceD = Math.abs(endY - child.y);
  954.                     if (minDistanceD > distanceD) {
  955.                         minDistanceD = distanceD;
  956.                         minIndexD    = i;
  957.                     }
  958.                 }
  959.             }
  960.             if (minDistanceU > Math.abs(y)) return 0;
  961.             if (minDistanceD > Math.abs(Graphics.boxHeight - endY)) return Graphics.boxHeight - this.height;
  962.             if (minDistanceD > minDistanceU) {
  963.                 return minIndexU === -1 ? y : children[minIndexU].endY;
  964.             } else {
  965.                 return minIndexD === -1 ? y : children[minIndexD].y - this.height;
  966.             }
  967.         };

  968.         PIXI.Container.prototype.isSameInstance = function() {
  969.             return false;
  970.         };

  971.         Window_Base.prototype.isSameInstance = function(objectContainer) {
  972.             return objectContainer instanceof Window_Base;
  973.         };

  974.         Sprite.prototype.isSameInstance = function(objectContainer) {
  975.             return objectContainer instanceof Sprite;
  976.         };

  977.         PIXI.Container.prototype.isTouchPosInRect = function() {
  978.             var tx = TouchInput.x;
  979.             var ty = TouchInput.y;
  980.             return (tx >= this.x && tx <= this.endX &&
  981.             ty >= this.y && ty <= this.endY);
  982.         };

  983.         Sprite.prototype.isTouchPosInRect = function() {
  984.             if (this.isTransparent()) return false;
  985.             var dx  = TouchInput.x - this.x;
  986.             var dy  = TouchInput.y - this.y;
  987.             var sin = Math.sin(-this.rotation);
  988.             var cos = Math.cos(-this.rotation);
  989.             var rx  = this.x + Math.floor(dx * cos + dy * -sin);
  990.             var ry  = this.y + Math.floor(dx * sin + dy * cos);
  991.             return (rx >= this.minX() && rx <= this.maxX() &&
  992.             ry >= this.minY() && ry <= this.maxY());
  993.         };

  994.         Sprite.prototype.isTransparent = function() {
  995.             var dx  = TouchInput.x - this.x;
  996.             var dy  = TouchInput.y - this.y;
  997.             var sin = Math.sin(-this.rotation);
  998.             var cos = Math.cos(-this.rotation);
  999.             var bx  = Math.floor(dx * cos + dy * -sin) / this.scale.x + this.anchor.x * this.width;
  1000.             var by  = Math.floor(dx * sin + dy * cos) / this.scale.y + this.anchor.y * this.height;
  1001.             return this.bitmap.getAlphaPixel(bx, by) === 0;
  1002.         };

  1003.         Sprite.prototype.screenWidth = function() {
  1004.             return (this.width || 0) * this.scale.x;
  1005.         };

  1006.         Sprite.prototype.screenHeight = function() {
  1007.             return (this.height || 0) * this.scale.y;
  1008.         };

  1009.         Sprite.prototype.screenX = function() {
  1010.             return (this.x || 0) - this.anchor.x * this.screenWidth();
  1011.         };

  1012.         Sprite.prototype.screenY = function() {
  1013.             return (this.y || 0) - this.anchor.y * this.screenHeight();
  1014.         };

  1015.         Sprite.prototype.minX = function() {
  1016.             return Math.min(this.screenX(), this.screenX() + this.screenWidth());
  1017.         };

  1018.         Sprite.prototype.minY = function() {
  1019.             return Math.min(this.screenY(), this.screenY() + this.screenHeight());
  1020.         };

  1021.         Sprite.prototype.maxX = function() {
  1022.             return Math.max(this.screenX(), this.screenX() + this.screenWidth());
  1023.         };

  1024.         Sprite.prototype.maxY = function() {
  1025.             return Math.max(this.screenY(), this.screenY() + this.screenHeight());
  1026.         };

  1027.         PIXI.Container.prototype.isTouchable = function() {
  1028.             return false;
  1029.         };

  1030.         Window_Base.prototype.isTouchable = function() {
  1031.             return (this.opacity > 0 || this.contentsOpacity > 0) && this.visible && this.isOpen();
  1032.         };

  1033.         Window_BattleLog.prototype.isTouchable = function() {
  1034.             return Window.prototype.isTouchable.call(this) && this._lines.length > 0;
  1035.         };

  1036.         Sprite.prototype.isTouchable = function() {
  1037.             return this.visible && this.bitmap != null && this.scale.x !== 0 && this.scale.y !== 0;
  1038.         };

  1039.         PIXI.Container.prototype.isTouchEvent = function(triggerFunc) {
  1040.             return this.isTouchable() && triggerFunc.call(TouchInput) && this.isTouchPosInRect();
  1041.         };

  1042.         PIXI.Container.prototype.isPreparedEvent = function() {
  1043.             return this.isTouchable() && this.isTouchPosInRect();
  1044.         };

  1045.         PIXI.Container.prototype.isRangeX = function(x) {
  1046.             return this.x <= x && this.endX >= x;
  1047.         };

  1048.         PIXI.Container.prototype.isRangeY = function(y) {
  1049.             return this.y <= y && this.endY >= y;
  1050.         };

  1051.         PIXI.Container.prototype.isOverlapX = function(win) {
  1052.             return this.isRangeX(win.x) || this.isRangeX(win.endX) || win.isRangeX(this.x) || win.isRangeX(this.endX);
  1053.         };

  1054.         PIXI.Container.prototype.isOverlapY = function(win) {
  1055.             return this.isRangeY(win.y) || this.isRangeY(win.endY) || win.isRangeY(this.y) || win.isRangeY(this.endY);
  1056.         };

  1057.         Object.defineProperty(PIXI.Container.prototype, 'endX', {
  1058.             get: function() {
  1059.                 return this.x + this.width;
  1060.             },
  1061.             set: function(value) {
  1062.                 this.x = value - this.width;
  1063.             },

  1064.             configurable: true
  1065.         });

  1066.         Object.defineProperty(PIXI.Container.prototype, 'endY', {
  1067.             get: function() {
  1068.                 return this.y + this.height;
  1069.             },
  1070.             set: function(value) {
  1071.                 this.y = value - this.height;
  1072.             },

  1073.             configurable: true
  1074.         });

  1075.         //=============================================================================
  1076.         //  Window_Selectable
  1077.         //   通常のタッチ操作を無効化します。
  1078.         //=============================================================================
  1079.         Window_Selectable.prototype.processTouch = function() {};
  1080.         Window_BattleActor.prototype.processTouch = function() {};
  1081.         Window_BattleEnemy.prototype.processTouch = function() {};

  1082.         var _Window_Message_isTriggered = Window_Message.prototype.isTriggered;
  1083.         Window_Message.prototype.isTriggered = function() {
  1084.             if (TouchInput.isRepeated()) {
  1085.                 return false;
  1086.             } else {
  1087.                 return _Window_Message_isTriggered.apply(this, arguments);
  1088.             }
  1089.         };
  1090.     }

  1091.     //=============================================================================
  1092.     // ウィンドウを透過して重なり合ったときの表示を自然にします。
  1093.     //=============================================================================
  1094.     if (paramThroughWindow && !WindowLayer.throughWindow) {
  1095.         WindowLayer.throughWindow = true;
  1096.         //=============================================================================
  1097.         //  WindowLayer
  1098.         //   ウィンドウのマスク処理を除去します。
  1099.         //=============================================================================
  1100.         WindowLayer.prototype._maskWindow = function(window) {};

  1101.         WindowLayer.prototype._canvasClearWindowRect = function(renderSession, window) {};
  1102.     }

  1103.     if (paramFakeMobile) {
  1104.         Utils.isMobileDevice = function() {
  1105.             return true;
  1106.         };
  1107.     }

  1108.     //=============================================================================
  1109.     // Game_Interpreter
  1110.     //  プラグインコマンドを追加定義します。
  1111.     //=============================================================================
  1112.     var _Game_Interpreter_pluginCommand      = Game_Interpreter.prototype.pluginCommand;
  1113.     Game_Interpreter.prototype.pluginCommand = function(command, args) {
  1114.         _Game_Interpreter_pluginCommand.apply(this, arguments);
  1115.         if (!command.match(new RegExp('^' + metaTagPrefix))) return;
  1116.         this.pluginCommandGraphicalDesignMode(command.replace(metaTagPrefix, ''), args);
  1117.     };

  1118.     Game_Interpreter.prototype.pluginCommandGraphicalDesignMode = function(command) {
  1119.         switch (getCommandName(command)) {
  1120.             case '解除_メッセージウィンドウ' :
  1121.             case '_UNLOCK_MESSAGE_WINDOW':
  1122.                 SceneManager._scene._messageWindow.unlockPosition();
  1123.                 break;
  1124.             case '固定_メッセージウィンドウ' :
  1125.             case '_LOCK_MESSAGE_WINDOW':
  1126.                 var win = SceneManager._scene._messageWindow;
  1127.                 if (win.isClosing()) {
  1128.                     win.setCloseListener(win.lockPosition)
  1129.                 } else {
  1130.                     win.lockPosition();
  1131.                 }
  1132.                 break;
  1133.             case '解除_選択肢ウィンドウ' :
  1134.             case '_UNLOCK_CHOICE_WINDOW':
  1135.                 SceneManager._scene._messageWindow._choiceWindow.unlockPosition();
  1136.                 break;
  1137.             case '固定_選択肢ウィンドウ' :
  1138.             case '_LOCK_CHOICE_WINDOW':
  1139.                 var win = SceneManager._scene._messageWindow._choiceWindow;
  1140.                 if (win.isClosing()) {
  1141.                     win.setCloseListener(win.lockPosition)
  1142.                 } else {
  1143.                     win.lockPosition();
  1144.                 }
  1145.                 break;
  1146.         }
  1147.     };

  1148.     //=============================================================================
  1149.     // DataManager
  1150.     //  ContainerProperties.jsonの読み込み処理を追記します。
  1151.     //=============================================================================
  1152.     DataManager._databaseFileCp = {name: '$dataContainerProperties', src: 'ContainerProperties.json'};
  1153.     if (paramMobileMake && Utils.isMobileDevice()) {
  1154.         DataManager._databaseFileCp.src = 'ContainerPropertiesMobile.json';
  1155.     }

  1156.     var _DataManager_loadDatabase = DataManager.loadDatabase;
  1157.     DataManager.loadDatabase      = function() {
  1158.         _DataManager_loadDatabase.apply(this, arguments);
  1159.         var errorMessage = this._databaseFileCp.src + 'が見付かりませんでした。';
  1160.         this.loadDataFileAllowError(this._databaseFileCp.name, this._databaseFileCp.src, errorMessage);
  1161.     };

  1162.     DataManager.loadDataFileAllowError = function(name, src, errorMessage) {
  1163.         var xhr = new XMLHttpRequest();
  1164.         var url = 'data/' + src;
  1165.         xhr.open('GET', url);
  1166.         xhr.overrideMimeType('application/json');
  1167.         xhr.onload   = function() {
  1168.             if (xhr.status < 400) {
  1169.                 window[name] = JSON.parse(xhr.responseText);
  1170.                 DataManager.onLoad(window[name]);
  1171.             } else {
  1172.                 DataManager.onDataFileNotFound(name, errorMessage);
  1173.             }
  1174.         };
  1175.         xhr.onerror  = function() {
  1176.             DataManager.onDataFileNotFound(name, errorMessage);
  1177.         };
  1178.         window[name] = null;
  1179.         xhr.send();
  1180.     };

  1181.     DataManager.onDataFileNotFound = function(name, errorMessage) {
  1182.         window[name] = {};
  1183.         console.warn(errorMessage);
  1184.     };

  1185.     var _DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;
  1186.     DataManager.isDatabaseLoaded      = function() {
  1187.         return _DataManager_isDatabaseLoaded.apply(this, arguments) && window[this._databaseFileCp.name];
  1188.     };

  1189.     //=============================================================================
  1190.     // SceneManager
  1191.     //  現在のシーン名を返します。
  1192.     //=============================================================================
  1193.     SceneManager.getSceneName = function() {
  1194.         return getClassName(this._scene);
  1195.     };

  1196.     var _SceneManager_updateScene = SceneManager.updateScene;
  1197.     SceneManager.updateScene      = function() {
  1198.         _SceneManager_updateScene.apply(this, arguments);
  1199.         if (this._scene) {
  1200.             this._scene.updateCustomContainer();
  1201.         }
  1202.     };

  1203.     //=============================================================================
  1204.     // Scene_Base
  1205.     //  ウィンドウ追加時に位置をロードします。
  1206.     //=============================================================================
  1207.     var _Scene_Base_addWindow      = Scene_Base.prototype.addWindow;
  1208.     Scene_Base.prototype.addWindow = function(child) {
  1209.         _Scene_Base_addWindow.apply(this, arguments);
  1210.         child.loadContainerInfo();
  1211.     };

  1212.     var _Scene_Base_addChild      = Scene_Base.prototype.addChild;
  1213.     Scene_Base.prototype.addChild = function(child) {
  1214.         _Scene_Base_addChild.apply(this, arguments);
  1215.         child.loadContainerInfo();
  1216.     };

  1217.     var _Scene_Base_createWindowLayer2     = Scene_Base.prototype.createWindowLayer;
  1218.     Scene_Base.prototype.createWindowLayer = function() {
  1219.         this.createCustomPicture();
  1220.         _Scene_Base_createWindowLayer2.apply(this, arguments);
  1221.         this.createCustomWindow();
  1222.     };

  1223.     Scene_Base.prototype.createCustomPicture = function() {
  1224.         var setting = settings[getClassName(this)];
  1225.         if (setting) {
  1226.             var pictures         = setting.pictures;
  1227.             this._customPictures = [];
  1228.             if (pictures) {
  1229.                 pictures.forEach(function(picture) {
  1230.                     if (!picture.file) return;
  1231.                     var sprite    = new Sprite();
  1232.                     sprite.bitmap = ImageManager.loadPicture(picture.file, 0);
  1233.                     this._customPictures.push(sprite);
  1234.                     this.addChild(sprite);
  1235.                     sprite.switchId = picture.switchId || 0;
  1236.                 }.bind(this));
  1237.             }
  1238.         }
  1239.     };

  1240.     Scene_Base.prototype.createCustomWindow = function() {
  1241.         var setting = settings[getClassName(this)];
  1242.         if (setting) {
  1243.             var windows         = setting.windows;
  1244.             this._customWindows = [];
  1245.             if (windows) {
  1246.                 windows.forEach(function(windowItem) {
  1247.                     if (!windowItem.lines || windowItem.lines.length < 1) return;
  1248.                     var win = new Window_Custom(windowItem.lines);
  1249.                     this._customWindows.push(win);
  1250.                     win.switchId = windowItem.switchId || 0;
  1251.                 }.bind(this));
  1252.             }
  1253.             this.updateCustomWindowVisible();
  1254.         }
  1255.     };

  1256.     Scene_Base.prototype.updateCustomContainer = function() {
  1257.         if (this._customPictures) {
  1258.             this.updateCustomPicture();
  1259.         }
  1260.         if (this._customWindows) {
  1261.             this.updateCustomWindow();
  1262.         }
  1263.     };

  1264.     Scene_Base.prototype.updateCustomPicture = function() {
  1265.         this._customPictures.forEach(function(picture) {
  1266.             if (picture.switchId > 0) {
  1267.                 picture.visible = $gameSwitches.value(picture.switchId);
  1268.             }
  1269.         });
  1270.     };

  1271.     Scene_Base.prototype.updateCustomWindow = function() {
  1272.         this.updateCustomWindowVisible();
  1273.         if (!this._windowAdd) {
  1274.             this._customWindows.forEach(function(windowItem) {
  1275.                 this.addWindow(windowItem);
  1276.             }, this);
  1277.             this._windowAdd = true;
  1278.         }
  1279.     };

  1280.     Scene_Base.prototype.updateCustomWindowVisible = function() {
  1281.         this._customWindows.forEach(function(windowItem) {
  1282.             if (windowItem.switchId > 0) {
  1283.                 if ($gameSwitches.value(windowItem.switchId)) {
  1284.                     windowItem.show();
  1285.                 } else {
  1286.                     windowItem.hide();
  1287.                 }
  1288.             }
  1289.         }, this);
  1290.     };

  1291.     //=============================================================================
  1292.     // PIXI.Container
  1293.     //  表示位置のセーブとロードを行います。
  1294.     //=============================================================================
  1295.     Object.defineProperty(PIXI.Container.prototype, 'x', {
  1296.         get: function() {
  1297.             return this.position.x;
  1298.         },
  1299.         set: function(value) {
  1300.             if (this._positionLock) return;
  1301.             this.position.x = value;
  1302.         }
  1303.     });

  1304.     Object.defineProperty(PIXI.Container.prototype, 'y', {
  1305.         get: function() {
  1306.             return this.position.y;
  1307.         },
  1308.         set: function(value) {
  1309.             if (this._positionLock) return;
  1310.             this.position.y = value;
  1311.         }
  1312.     });

  1313.     PIXI.Container.prototype.loadContainerInfo = function() {
  1314.         var sceneName  = SceneManager.getSceneName();
  1315.         var parentName = getClassName(this.parent);
  1316.         var sceneInfo  = $dataContainerProperties[sceneName];
  1317.         if (sceneInfo) {
  1318.             var containerInfo = sceneInfo[parentName];
  1319.             var key           = [this.parent.getChildIndex(this), getClassName(this)];
  1320.             if (containerInfo && containerInfo[key]) {
  1321.                 this.loadProperty(containerInfo[key]);
  1322.                 this._positionLock = true;
  1323.             }
  1324.         }
  1325.     };

  1326.     PIXI.Container.prototype.unlockPosition = function() {
  1327.         this._positionLock    = false;
  1328.         this._customPositionX = this.position.x;
  1329.         this._customPositionY = this.position.y;
  1330.     };

  1331.     PIXI.Container.prototype.lockPosition = function() {
  1332.         this._positionLock = true;
  1333.         if (this._customPositionX) {
  1334.             this.position.x = this._customPositionX;
  1335.         }
  1336.         if (this._customPositionY) {
  1337.             this.position.y = this._customPositionY;
  1338.         }
  1339.     };

  1340.     PIXI.Container.prototype.loadProperty = function(containerInfo) {
  1341.         this.position.x = containerInfo.x;
  1342.         this.position.y = containerInfo.y;
  1343.     };

  1344.     Window_Base.prototype.loadProperty = function(containerInfo) {
  1345.         PIXI.Container.prototype.loadProperty.apply(this, arguments);
  1346.         this.width               = containerInfo.width;
  1347.         this.height              = containerInfo.height;
  1348.         this.opacity             = containerInfo.opacity;
  1349.         this.visible             = this.visible && !containerInfo.hidden;
  1350.         this._customFontSize     = containerInfo._customFontSize;
  1351.         this._customPadding      = containerInfo._customPadding;
  1352.         this._customLineHeight   = containerInfo._customLineHeight;
  1353.         this._customBackOpacity  = containerInfo._customBackOpacity;
  1354.         this._customBackFileName = containerInfo._customBackFileName;
  1355.         this._customFontFace     = containerInfo._customFontFace;
  1356.         this.updatePadding();
  1357.         this.resetFontSettings();
  1358.         this.updateBackOpacity();
  1359.         this.createContents();
  1360.         this.refresh();
  1361.         this.createBackSprite();
  1362.     };

  1363.     Window_Base.prototype.refresh = function() {};

  1364.     Window_Selectable.prototype.loadProperty = function(containerInfo) {
  1365.         var row;
  1366.         if (this._scrollY !== 0) {
  1367.             row = this.topRow();
  1368.         }
  1369.         Window_Base.prototype.loadProperty.apply(this, arguments);
  1370.         this.updateCursor();
  1371.         if (row) {
  1372.             this.setTopRow(row);
  1373.         }
  1374.     };

  1375.     PIXI.Container.prototype.saveContainerInfo = function() {
  1376.         var sceneName  = SceneManager.getSceneName();
  1377.         var parentName = getClassName(this.parent);
  1378.         if (!$dataContainerProperties[sceneName]) $dataContainerProperties[sceneName] = {};
  1379.         var sceneInfo = $dataContainerProperties[sceneName];
  1380.         if (!sceneInfo[parentName]) sceneInfo[parentName] = {};
  1381.         var containerInfo = sceneInfo[parentName];
  1382.         var key           = [this.parent.getChildIndex(this), getClassName(this)];
  1383.         if (!containerInfo[key]) containerInfo[key] = {};
  1384.         this.saveProperty(containerInfo[key]);
  1385.         if (paramAutoSave) {
  1386.             DataManager.saveDataFileWp();
  1387.         }
  1388.     };

  1389.     PIXI.Container.prototype.saveProperty = function(containerInfo) {
  1390.         containerInfo.x = this.x;
  1391.         containerInfo.y = this.y;
  1392.     };

  1393.     Window_Base.prototype.saveProperty = function(containerInfo) {
  1394.         PIXI.Container.prototype.saveProperty.apply(this, arguments);
  1395.         containerInfo.width               = this.width;
  1396.         containerInfo.height              = this.height;
  1397.         containerInfo.opacity             = this.opacity;
  1398.         containerInfo.hidden              = !this.visible;
  1399.         containerInfo._customFontSize     = this._customFontSize;
  1400.         containerInfo._customPadding      = this._customPadding;
  1401.         containerInfo._customLineHeight   = this._customLineHeight;
  1402.         containerInfo._customBackOpacity  = this._customBackOpacity;
  1403.         containerInfo._customBackFileName = this._customBackFileName;
  1404.         containerInfo._customFontFace     = this._customFontFace;
  1405.     };

  1406.     //=============================================================================
  1407.     // Window_Base
  1408.     //  プロパティの値をカスタマイズします。
  1409.     //=============================================================================
  1410.     var _Window_Base_initialize      = Window_Base.prototype.initialize;
  1411.     Window_Base.prototype.initialize = function(x, y, width, height) {
  1412.         _Window_Base_initialize.apply(this, arguments);
  1413.         this._customFontSize     = this.standardFontSize();
  1414.         this._customPadding      = this.standardPadding();
  1415.         this._customLineHeight   = this.lineHeight();
  1416.         this._customLineNumber   = 0;
  1417.         this._customBackOpacity  = this.standardBackOpacity();
  1418.         this._customBackSprite   = null;
  1419.         this._customBackFileName = '';
  1420.         this._customFontFace     = '';
  1421.     };

  1422.     Window_Base.prototype.createBackSprite = function() {
  1423.         if (this._customBackFileName) {
  1424.             if (!this._customBackSprite) {
  1425.                 this._customBackSprite = new Sprite();
  1426.                 this.addChildToBack(this._customBackSprite);
  1427.             }
  1428.             this._customBackSprite.bitmap = ImageManager.loadPicture(this._customBackFileName, 0);
  1429.         } else if (this._customBackSprite) {
  1430.             this.removeChild(this._customBackSprite);
  1431.             this._customBackSprite = null;
  1432.         }
  1433.         if (Utils.isDesignMode() && this._customBackSprite && this._customBackSprite.bitmap) {
  1434.             var bitmap            = this._customBackSprite.bitmap;
  1435.             bitmap._image.onerror = function() {
  1436.                 this._customBackFileName                 = '';
  1437.                 this._customBackSprite.bitmap._isLoading = false;
  1438.                 this._customBackSprite.bitmap            = null;
  1439.                 this._customBackSprite                   = null;
  1440.                 SceneManager.popChangeStack();
  1441.                 SceneManager.setInfoExtend('ファイルが見付からなかったので、左記の番号の変更を戻しました。', -1);
  1442.             }.bind(this);
  1443.         }
  1444.     };

  1445.     var _Window_Selectable_initialize      = Window_Selectable.prototype.initialize;
  1446.     Window_Selectable.prototype.initialize = function(x, y, width, height) {
  1447.         _Window_Selectable_initialize.apply(this, arguments);
  1448.         // Resolve conflict for BattleFormation.js
  1449.         this._customLineNumber = this.maxRows ? this.maxRows() : 0;
  1450.     };

  1451.     var _Window_Base_standardFontFace      = Window_Base.prototype.standardFontFace;
  1452.     Window_Base.prototype.standardFontFace = function() {
  1453.         return this._customFontFace ? this._customFontFace : _Window_Base_standardFontFace.apply(this, arguments);
  1454.     };

  1455.     var _Window_Base_standardFontSize      = Window_Base.prototype.standardFontSize;
  1456.     Window_Base.prototype.standardFontSize = function() {
  1457.         return this._customFontSize ? eval(this._customFontSize) :
  1458.             paramFontSize ? paramFontSize : _Window_Base_standardFontSize.apply(this, arguments);
  1459.     };

  1460.     var _Window_Base_standardPadding      = Window_Base.prototype.standardPadding;
  1461.     Window_Base.prototype.standardPadding = function() {
  1462.         return this._customPadding ? eval(this._customPadding) :
  1463.             paramPadding ? paramPadding : _Window_Base_standardPadding.apply(this, arguments);
  1464.     };

  1465.     var _Window_Base_lineHeight      = Window_Base.prototype.lineHeight;
  1466.     Window_Base.prototype.lineHeight = function() {
  1467.         return this._customLineHeight ? eval(this._customLineHeight) :
  1468.             paramLineHeight ? paramLineHeight : _Window_Base_lineHeight.apply(this, arguments);
  1469.     };

  1470.     var _Window_Base_standardBackOpacity      = Window_Base.prototype.standardBackOpacity;
  1471.     Window_Base.prototype.standardBackOpacity = function() {
  1472.         return this._customBackOpacity ? eval(this._customBackOpacity) :
  1473.             paramBackOpacity ? paramBackOpacity : _Window_Base_standardBackOpacity.apply(this, arguments);
  1474.     };

  1475.     Window_Base._iconSrcWidth  = Window_Base._iconWidth;
  1476.     Window_Base._iconSrcHeight = Window_Base._iconHeight;

  1477.     Window_Base.prototype.getIconScale = function() {
  1478.         var defaultFontSize = _Window_Base_standardFontSize.apply(this, arguments);
  1479.         var fontSize        = this.contents.fontSize;
  1480.         return paramIconSizeScale && defaultFontSize !== fontSize ? fontSize / defaultFontSize : null;
  1481.     };

  1482.     Window_Base.prototype.changeIconSize = function() {
  1483.         var iconScale = this.getIconScale();
  1484.         if (iconScale) {
  1485.             Window_Base._iconWidth *= iconScale;
  1486.             Window_Base._iconHeight *= iconScale;
  1487.         }
  1488.     };

  1489.     Window_Base.prototype.restoreIconSize = function() {
  1490.         var iconScale = this.getIconScale();
  1491.         if (iconScale) {
  1492.             Window_Base._iconWidth  = Window_Base._iconSrcWidth;
  1493.             Window_Base._iconHeight = Window_Base._iconSrcHeight;
  1494.         }
  1495.     };

  1496.     var _Window_Base_drawActorIcons      = Window_Base.prototype.drawActorIcons;
  1497.     Window_Base.prototype.drawActorIcons = function(actor, x, y, width) {
  1498.         this.changeIconSize();
  1499.         _Window_Base_drawActorIcons.apply(this, arguments);
  1500.         this.restoreIconSize();
  1501.     };

  1502.     var _Window_Base_drawItemName      = Window_Base.prototype.drawItemName;
  1503.     Window_Base.prototype.drawItemName = function(item, x, y, width) {
  1504.         this.changeIconSize();
  1505.         _Window_Base_drawItemName.apply(this, arguments);
  1506.         this.restoreIconSize();
  1507.     };

  1508.     var _Window_Base_processDrawIcon      = Window_Base.prototype.processDrawIcon;
  1509.     Window_Base.prototype.processDrawIcon = function(iconIndex, textState) {
  1510.         this.changeIconSize();
  1511.         _Window_Base_processDrawIcon.apply(this, arguments);
  1512.         this.restoreIconSize();
  1513.     };

  1514.     var _Window_Base_drawIcon      = Window_Base.prototype.drawIcon;
  1515.     Window_Base.prototype.drawIcon = function(iconIndex, x, y) {
  1516.         var iconScale = this.getIconScale();
  1517.         if (iconScale) {
  1518.             var bitmap = ImageManager.loadSystem('IconSet');
  1519.             var pw     = Window_Base._iconSrcWidth;
  1520.             var ph     = Window_Base._iconSrcHeight;
  1521.             var sx     = iconIndex % 16 * pw;
  1522.             var sy     = Math.floor(iconIndex / 16) * ph;
  1523.             var dw     = Math.floor(pw * iconScale);
  1524.             var dh     = Math.floor(ph * iconScale);
  1525.             var dx     = x;
  1526.             var dy     = y + (this.lineHeight() - dh) / 2 - 2;
  1527.             this.contents.blt(bitmap, sx, sy, pw, ph, dx, dy, dw, dh);
  1528.         } else {
  1529.             _Window_Base_drawIcon.apply(this, arguments);
  1530.         }
  1531.     };

  1532.     var _Window_Base_setBackgroundType      = Window_Base.prototype.setBackgroundType;
  1533.     Window_Base.prototype.setBackgroundType = function(type) {
  1534.         if (!paramBackgroundFixed) {
  1535.             _Window_Base_setBackgroundType.apply(this, arguments);
  1536.         }
  1537.     };

  1538.     var _Window_Base_updateClose = Window_Base.prototype.updateClose;
  1539.     Window_Base.prototype.updateClose = function() {
  1540.         var prevClose = this.isClosing();
  1541.         _Window_Base_updateClose.apply(this, arguments);
  1542.         if (this._callBack && prevClose && !this.isClosing()) {
  1543.             this._callBack();
  1544.             this._callBack = null;
  1545.         }
  1546.     };

  1547.     Window_Base.prototype.setCloseListener = function(callBack) {
  1548.         this._callBack = callBack;
  1549.     };

  1550.     // for RPG MV 1.6.1
  1551.     var _Window_EquipItem_refresh = Window_EquipItem.prototype.refresh;
  1552.     Window_EquipItem.prototype.refresh = function() {
  1553.         if (!this._actor) {
  1554.             return;
  1555.         }
  1556.         _Window_EquipItem_refresh.apply(this, arguments);
  1557.     };

  1558.     /**
  1559.      * Window_Custom
  1560.      * 任意配置可能なウィンドウです。
  1561.      * @constructor
  1562.      */
  1563.     function Window_Custom() {
  1564.         this.initialize.apply(this, arguments);
  1565.     }

  1566.     Window_Custom._textAligns = {
  1567.         'left'  : 0,
  1568.         '0'     : 0,
  1569.         'center': 1,
  1570.         '1'     : 1,
  1571.         'right' : 2,
  1572.         '2'     : 2
  1573.     };

  1574.     Window_Custom.prototype             = Object.create(Window_Selectable.prototype);
  1575.     Window_Custom.prototype.constructor = Window_Custom;

  1576.     Window_Custom.prototype.initialize = function(lines) {
  1577.         this._lines = lines || [];
  1578.         Window_Selectable.prototype.initialize.call(this, 0, 0, 320, this.fittingHeight(this._lines.length));
  1579.         this.refresh();
  1580.     };

  1581.     Window_Custom.prototype.refresh = function() {
  1582.         this.createContents();
  1583.         Window_Selectable.prototype.refresh.apply(this, arguments);
  1584.     };

  1585.     Window_Custom.prototype.drawItem = function(index) {
  1586.         var rect = this.itemRectForText(index);
  1587.         var text = this._lines[index];
  1588.         this.resetTextColor();
  1589.         text = this.changeTextAlign(text);
  1590.         if (this._textAlign > 0) {
  1591.             rect.x = this.getTextAlignStartX(text);
  1592.         }
  1593.         this.drawTextEx(text, rect.x, rect.y);
  1594.     };

  1595.     Window_Custom.prototype.getTextAlignStartX = function(text) {
  1596.         var width = this.drawTextEx(text, this.contentsWidth(), 0);
  1597.         if (this._textAlign === 1) {
  1598.             return this.contentsWidth() / 2 - width / 2;
  1599.         } else {
  1600.             return this.contentsWidth() - width;
  1601.         }
  1602.     };

  1603.     Window_Custom.prototype.maxItems = function() {
  1604.         return this._lines.length;
  1605.     };

  1606.     Window_Custom.prototype.changeTextAlign = function(text) {
  1607.         this._textAlign = 0;
  1608.         text            = text.replace(/\\al\[(.*)]/gi, function() {
  1609.             this._textAlign = Window_Custom._textAligns[arguments[1].toLowerCase()] || 0;
  1610.             return '';
  1611.         }.bind(this));
  1612.         return text;
  1613.     };

  1614. //    var _Scene_File_createListWindow = Scene_File.prototype.createListWindow;
  1615. //    Scene_File.prototype.createListWindow = function() {
  1616. //        _Scene_File_createListWindow.apply(this, arguments);
  1617. //        this._listWindow.setTopRow(this.firstSavefileIndex() - 2);
  1618. //    };
  1619. })();
复制代码

改UI图片的话,直接在工程文件的img文件夹里找并用Photoshop改就行
回复

使用道具 举报

梦石
0
星屑
99
在线时间
42 小时
注册时间
2021-5-14
回帖
28
 楼主| 发表于 2021-5-30 14:57:23 | 显示全部楼层
ABXY-Kenobi 发表于 2021-5-30 13:23
分享一个可设置UⅠ位置的插件,原帖找不到了
//======================================================= ...

万分感谢您的分享
回复

使用道具 举报

梦石
0
星屑
99
在线时间
42 小时
注册时间
2021-5-14
回帖
28
 楼主| 发表于 2021-5-30 14:57:57 | 显示全部楼层
ABXY-Kenobi 发表于 2021-5-30 13:23
分享一个可设置UⅠ位置的插件,原帖找不到了
//======================================================= ...

万分感谢您的分享
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部