查看: 3722|回复: 1

[有事请教] MV的气泡对话框里有没有带缓动进出的?

[复制链接]
梦石
20
星屑
13965
在线时间
1744 小时
注册时间
2017-1-12
回帖
1667

MZ评测员开拓者

发表于 2020-11-13 20:15:23 | 显示全部楼层 |阅读模式

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

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

×
因为有想用的插件,所以正在把工程从VA移到MV。然后现在问题来了,之前VA用的老鹰的对话框进入会有个对话框放大的效果,变更头像也会有个头像淡出淡入,这种细节简直难以难以舍弃......
请问有没有这种稍微细节一点的MV气泡对话框?
老鹰的对话框的链接:
https://github.com/OneEyedEagle/EAGLE-RGSS3
GIF.gif
MV气泡对话框现在用的是这个
  1. //=============================================================================
  2. // MessageWindowPopup.js
  3. // ----------------------------------------------------------------------------
  4. // (C) 2016 Triacontane
  5. // This software is released under the MIT License.
  6. // http://opensource.org/licenses/mit-license.php
  7. // ----------------------------------------------------------------------------
  8. // Version
  9. // 2.14.4 2019/06/23 フキダシウィンドウを無効化したときのX座標の値をデフォルトのコアスクリプトの動作に準拠するよう修正
  10. // 2.14.3 2019/06/18 MKR_MessageWindowCustom.jsとの連携で、フキダシウィンドウ有効時はフキダシの横幅と高さを優先するよう変更
  11. // 2.14.2 2019/06/16 FTKR_ExMessageWindow2.jsおよびPauseSignToTextEnd.jsとの連携で、フキダシウィンドウ表示時にポーズサインがはみ出してしまう競合を修正
  12. // 2.14.1 2019/06/16 2.14.0で追加したテール画像がフキダシウィンドウ無効のときも表示されていた問題を修正
  13. // 2.14.0 2019/06/10 テール画像を別途指定できる機能を追加
  14. // 2.13.0 2019/05/26 PauseSignToTextEnd.jsと完全に組み合わせて使用できるよう修正
  15. // 2.12.2 2019/04/14 フキダシウィンドウをキャラクター下に表示した際、Y座標の位置調整が効かなくなる問題を修正
  16. // 2.12.1 2019/02/07 GraphicalDesignMode.jsと併用し、かつフキダシウィンドウ無効時、カスタマイズしたウィンドウの横幅が反映されるよう修正
  17. // 2.12.0 2019/10/21 フキダシウィンドウの表示位置の上限と下限を設定できる機能を追加
  18. //                   フキダシウィンドウを画面上の任意の位置に表示できる機能を追加
  19. // 2.11.2 2018/11/26 ポップアップ用のウィンドウスキン設定後、ポップアップを解除してもスキンがそのままになってしまう場合がある問題を修正
  20. // 2.11.1 2018/11/26 MPP_MessageEX.jsとの競合を解消(ネームウィンドウの表示不整合)
  21. // 2.11.0 2018/11/11 ポップアップウィンドウの横幅と高さの最小値を変数から取得できる機能を追加
  22. // 2.10.2 2018/11/07 ポップアップ用のウィンドウスキン設定後、メニューを開くか場所移動すると設定が戻ってしまう問題を修正
  23. // 2.10.1 2018/06/15 ウィンドウ連携が有効かつ、フキダシウィンドウを1回も表示していない場合に選択肢ウィンドウが見えなくなる問題を修正
  24. // 2.10.0 2018/05/20 ポーズサインのテール化機能を使わない設定を追加しました。
  25. // 2.9.8 2018/03/19 プラグインを未適用の状態でセーブしたデータをロードするとエラーになる現象を修正
  26. // 2.9.7 2018/01/30 BetweenCharacters.jsとの競合を解消
  27. // 2.9.6 2018/01/15 MPP_MessageEX.jsとの競合を解消、パラメータの型指定誤りを修正、2.9.1の修正の取り込みが一部間違っていた問題を修正
  28. // 2.9.5 2018/01/12 KMS_DebugUtil.jsとの競合を解消
  29. // 2.9.4 2017/12/21 FTKR_ExMessageWindow2.jsとの連携で、上下にフキダシウィンドウを同時表示できるよう修正
  30. // 2.9.3 2017/12/14 2.9.2の修正で上方向に対する調整が抜けていたのを修正
  31. // 2.9.2 2017/12/10 フキダシ位置のY座標を調整する際にテール画像が表示されるように微調整
  32. // 2.9.1 2017/12/07 フキダシ表示を無効化後、メッセージの表示をする前に選択肢を表示すると位置がおかしくなる問題を修正(by 奏ねこまさん)
  33. // 2.9.0 2017/10/18 AltWindowFrame.jsとの競合を解消してMADOと連携できるようになりました。
  34. // 2.8.1 2017/08/14 ウィンドウの振動時間を設定できる機能を追加
  35. // 2.8.0 2017/08/14 ウィンドウを振動させる機能を追加
  36. //                  パラメータの型指定機能に対応
  37. // 2.7.0 2017/06/24 フキダシ位置を設定する機能で、イベント名で指定できる機能を追加
  38. //                  フキダシ有効化時にウィンドウ位置を設定できる機能を追加
  39. // 2.6.0 2017/06/21 ウィンドウが画面外に出ないように調整するパラメータを追加
  40. //                  フキダシの位置固定をイベントごとに設定できる機能で、イベント名で指定できる機能を追加
  41. // 2.5.1 2017/06/11 DP_MapZoom.js以外のマップズーム機能に対してフキダシ位置が正しく表示されていなかった問題を修正
  42. // 2.5.0 2017/06/05 マップズームに対してフキダシ位置が正しく表示されるよう対応
  43. //                  フキダシの位置固定をイベントごとに設定できる機能を追加
  44. // 2.4.1 2017/05/28 ウィンドウスキンを変更した直後の文字色のみ変更前の文字色になってしまう問題を修正(by 奏ねこまさん)
  45. //                  2行目以降の文字サイズを変更したときにウィンドウの高さが正しく計算されない問題を修正
  46. // 2.4.0 2017/05/16 並列実行のコモンイベントで「MWP_VALID 0」を実行したときに、実行中のマップイベントを対象とするよう修正
  47. // 2.3.2 2017/05/25 「FTKR_ExMessageWindow2.js」の連携機能の修正(byフトコロ)
  48. //                  ウィンドウを閉じた時にフキダシ無効化をする対象を、指定していたウィンドウIDのみに変更
  49. //                  フキダシ無効化コマンドにウィンドウIDを指定する機能追加
  50. //                  場所移動時にすべてのウィンドウIDのフキダシ無効化処理を追加
  51. //                  プラグインパラメータ[自動設定]をOFFに設定した場合、イベント起動時にフキダシ無効化する対象をウィンドウID0だけに変更
  52. // 2.3.1 2017/05/14 「FTKR_ExMessageWindow2.js」の連携機能の修正(byフトコロ)
  53. //                  ポップアップの初期化および、ポップアップ無効時の文章の表示位置の不具合修正
  54. //                  フキダシ有効化コマンドにウィンドウIDを指定する機能追加
  55. // 2.3.0 2017/05/01 フトコロさんの「FTKR_ExMessageWindow2.js」と連携してフキダシを複数表示できる機能を追加(byフトコロさん)
  56. // 2.2.0 2017/04/20 選択肢および数値ウィンドウをテール画像の右側に表示できるプラグインコマンドを追加
  57. // 2.1.0 2017/02/21 フキダシウィンドウ内で制御文字「\{」「\}」を指定したときの上限、下限、増減幅を設定できる機能を追加
  58. // 2.0.5 2017/01/23 ウィンドウスキンを変更しているデータをロード直後にフキダシメッセージを表示すると
  59. //                  文字が黒くなってしまう問題を修正
  60. // 2.0.4 2016/12/25 ウィンドウを閉じている最中にウィンドウ表示位置を変更するプラグインコマンドを実行すると、
  61. //                  一瞬だけ空ウィンドウが表示される問題を修正
  62. // 2.0.3 2016/10/22 デフォルト以外で制御文字と見なされる記述(\aaa[333]や\d<test>)を枠幅の計算から除外するよう修正
  63. // 2.0.2 2016/09/29 キャラクターの位置によってはネームポップが一部見切れてしまう現象を修正
  64. // 2.0.1 2016/08/25 フォントサイズを\{で変更して\}で戻さなかった場合の文字サイズがおかしくなっていた現象を修正
  65. // 2.0.0 2016/08/22 本体v1.3.0によりウィンドウ透過の実装が変更されたので対応
  66. // 1.3.3 2016/07/02 ポップアップ有効時は選択肢の最大表示数が8になるよう修正
  67. // 1.3.2 2016/06/02 YEP_MessageCore.jsとのウィンドウ位置に関する競合を解消
  68. // 1.3.1 2016/05/25 フォロワーにフキダシを表示できる機能を追加
  69. // 1.3.0 2016/03/21 ウィンドウの表示位置をキャラクターの高さに合わせて自動調整するよう修正
  70. //                  ポップアップウィンドウ専用のウィンドウスキンを使用する機能を追加
  71. //                  位置とサイズを微調整する機能を追加
  72. //                  選択肢と数値入力ウィンドウの表示方法を2種類追加
  73. // 1.2.3 2016/02/23 YEP_MessageCore.jsより上に配置した場合に発生するエラーを修正
  74. //                  (正常に動作しない点はそのままです)
  75. // 1.2.2 2016/02/20 YEP_MessageCore.js最新版に対応
  76. // 1.2.1 2016/02/20 YEP_MessageCore.jsのネームポップをポップアップウィンドウと連動するよう対応
  77. // 1.2.0 2016/02/13 並列処理のイベントが存在するときにポップアップ設定がクリアされてしまう
  78. //                  問題の修正
  79. //                  ウィンドウの表示位置を下に表示できる設定を追加
  80. // 1.1.3 2016/02/04 イベント終了時にポップアップ設定をクリアするよう修正
  81. // 1.1.2 2016/01/31 行間を調整できる機能を追加
  82. // 1.1.1 2016/01/30 選択肢と数値入力ウィンドウをポップアップと連携するよう修正
  83. //                  その他微調整と軽微な表示不良修正
  84. // 1.1.0 2016/01/29 高確率で競合するバグを修正
  85. //                  ポップアップウィンドウがキャラクターの移動に追従するよう修正
  86. //                  顔グラフィックが見切れないよう修正
  87. //                  実行中のイベントをポップアップ対象にできる機能を追加(0を指定)
  88. //                  英語対応
  89. // 1.0.0 2016/01/28 初版
  90. // ----------------------------------------------------------------------------
  91. // [Blog]   : https://triacontane.blogspot.jp/
  92. // [Twitter]: https://twitter.com/triacontane/
  93. // [GitHub] : https://github.com/triacontane/
  94. //=============================================================================

  95. /*:
  96. * @plugindesc Popup window plugin
  97. * @author triacontane
  98. *
  99. * @param FontSize
  100. * @desc Font size of popup window
  101. * @default 22
  102. * @type number
  103. *
  104. * @param Padding
  105. * @desc Padding of popup window
  106. * @default 10
  107. * @type number
  108. *
  109. * @param AutoPopup
  110. * @desc Popup set when event starting(ON/OFF)
  111. * @default true
  112. * @type boolean
  113. *
  114. * @param FaceScale
  115. * @desc Scale of face graphic of popup window(1-100%)
  116. * @default 75
  117. * @type number
  118. *
  119. * @param WindowLinkage
  120. * @desc Select window and Number input window is linkage with popup window(ON/OFF)
  121. * @default true
  122. * @type boolean
  123. *
  124. * @param BetweenLines
  125. * @desc Between the Lines
  126. * @default 4
  127. * @type number
  128. *
  129. * @param ThroughWindow
  130. * @desc Window through if overlap windows(ON/OFF)
  131. * @default false
  132. * @type boolean
  133. *
  134. * @param FontSizeRange
  135. * @desc フキダシウィンドウで制御文字「\{」「\}」を使用した場合のフォントサイズの増減幅です。デフォルトは12です。
  136. * @default 12
  137. * @type number
  138. *
  139. * @param FontUpperLimit
  140. * @desc フキダシウィンドウで制御文字「\{」「\}」を使用した場合のフォントサイズの上限値です。デフォルトは96です。
  141. * @default 96
  142. * @type number
  143. *
  144. * @param FontLowerLimit
  145. * @desc フキダシウィンドウで制御文字「\{」「\}」を使用した場合のフォントサイズの下限値です。デフォルトは24です。
  146. * @default 24
  147. * @type number
  148. *
  149. * @param InnerScreen
  150. * @desc 横方向だけでなく縦方向についても画面内にフキダシウィンドウが収まるように位置を調整します。
  151. * @default false
  152. * @type boolean
  153. *
  154. * @param ShakeSpeed
  155. * @desc ウィンドウを振動させる際の速さです。制御文字\v[n]が利用できます。
  156. * @default 5
  157. * @type number
  158. *
  159. * @param ShakeDuration
  160. * @desc ウィンドウを振動させる時間(フレーム)です。制御文字\v[n]が利用できます。0を指定するとずっと振動し続けます。
  161. * @default 60
  162. * @type number
  163. *
  164. * @param NoUseTail
  165. * @desc ポーズサインのテール化機能を無効化します。デフォルトの位置に表示されます。
  166. * @default false
  167. * @type boolean
  168. *
  169. * @param MinWidthVariableId
  170. * @desc 指定した番号の変数の値が、フキダシウィンドウの横幅の最小値(単位はピクセル数)となります。
  171. * @default 0
  172. * @type variable
  173. *
  174. * @param MinHeightVariableId
  175. * @desc 指定した番号の変数の値が、フキダシウィンドウの高さの最小値(単位はピクセル数)となります。
  176. * @default 0
  177. * @type variable
  178. *
  179. * @param lowerLimitX
  180. * @desc フキダシウィンドウの下限X座標です。
  181. * @default 0
  182. * @type number
  183. *
  184. * @param lowerLimitY
  185. * @desc フキダシウィンドウの下限Y座標です。
  186. * @default 0
  187. * @type number
  188. *
  189. * @param upperLimitX
  190. * @desc フキダシウィンドウの下限X座標です。
  191. * @default 0
  192. * @type number
  193. *
  194. * @param upperLimitY
  195. * @desc フキダシウィンドウの下限Y座標です。
  196. * @default 0
  197. * @type number
  198. *
  199. * @param tailImage
  200. * @desc テールに使う画像をピクチャから指定します。
  201. * @default
  202. * @require 1
  203. * @dir img/system/
  204. * @type file
  205. *
  206. * @help Change the message window from fixed to popup
  207. *
  208. * Plugin Command
  209. *
  210. * MWP_VALID [Character ID]
  211. *  Popup window valid
  212. *  Player:-1 Current event:0 Event:1...
  213. * ex:MWP_VALID 0
  214. *
  215. * MWP_INVALID
  216. *  Popup window invalid
  217. * ex:MWP_INVALID
  218. *
  219. * MWP_FREE 100 200
  220. * フキダシウィンドウフリー配置 100 200
  221. * 指定した任意の位置にフキダシウィンドウを表示します。
  222. *
  223. * MWP_SETTING [parameter]
  224. *  Popup window setting. parameter are...
  225. *   POS_UPPER
  226. *     Window position fixed upper.
  227. *
  228. *  POS_LOWER
  229. *     Window position fixed upper.
  230. *
  231. *  POS_AUTO
  232. *     Window position auto.
  233. *
  234. *   SKIN [File name(/img/system/...)]
  235. *     Setting window skin for popup message.
  236. *
  237. *   SUB_POS_PLAYER
  238. *     Choice window or NumberInput displays player.
  239. *
  240. *   SUB_POS_INNER
  241. *     Choice window or NumberInput displays internal message window.
  242. *
  243. *   SUB_POS_NORMAL
  244. *     Choice window or NumberInput displays normal position.
  245. *
  246. * MWP_ADJUST [parameter]
  247. *   Popup window adjust. parameter are...
  248. *
  249. *   POS [X] [Y]
  250. *     Popup window adjust relative position.
  251. *
  252. *  SIZE [Width] [Height]
  253. *   Popup window adjust relative size.
  254. *
  255. * ・使用可能な制御文字
  256. * \sh[5] # 強さ[5]でウィンドウを振動させます。
  257. *
  258. * This plugin is released under the MIT License.
  259. */
  260. /*:ja
  261. * @plugindesc フキダシウィンドウプラグイン
  262. * @author トリアコンタン
  263. *
  264. * @param フォントサイズ
  265. * @desc フキダシウィンドウのデフォルトフォントサイズ
  266. * 通常ウィンドウのフォントサイズ:28
  267. * @default 22
  268. * @type number
  269. *
  270. * @param 余白
  271. * @desc フキダシウィンドウの余白サイズ
  272. * 通常ウィンドウの余白:18
  273. * @default 10
  274. * @type number
  275. *
  276. * @param 自動設定
  277. * @desc イベント起動時にフキダシの対象が、起動したイベントに自動設定されます。(ON/OFF)
  278. * OFFの場合は通常のメッセージウィンドウに設定されます。
  279. * @default true
  280. * @type boolean
  281. *
  282. * @param フェイス倍率
  283. * @desc フキダシウィンドウの顔グラフィック表示倍率(1-100%)
  284. * @default 75
  285. * @type number
  286. *
  287. * @param ウィンドウ連携
  288. * @desc 選択肢ウィンドウと数値入力ウィンドウを
  289. * ポップアップウィンドウに連動させます。(ON/OFF)
  290. * @default true
  291. * @type boolean
  292. *
  293. * @param 行間
  294. * @desc 行と行の間のスペースをピクセル単位で設定します。
  295. * @default 4
  296. * @type number
  297. *
  298. * @param ウィンドウ透過
  299. * @desc ウィンドウが重なったときに透過表示します。(ON/OFF)
  300. * 選択肢をフキダシ内に表示する場合はONにしてください。
  301. * @default false
  302. * @type boolean
  303. *
  304. * @param フォントサイズ増減幅
  305. * @desc フキダシウィンドウで制御文字「\{」「\}」を使用した場合のフォントサイズの増減幅です。デフォルトは12です。
  306. * @default 12
  307. * @type number
  308. *
  309. * @param フォントサイズ上限
  310. * @desc フキダシウィンドウで制御文字「\{」「\}」を使用した場合のフォントサイズの上限値です。デフォルトは96です。
  311. * @default 96
  312. * @type number
  313. *
  314. * @param フォントサイズ下限
  315. * @desc フキダシウィンドウで制御文字「\{」「\}」を使用した場合のフォントサイズの下限値です。デフォルトは24です。
  316. * @default 24
  317. * @type number
  318. *
  319. * @param 画面内に収める
  320. * @desc 横方向だけでなく縦方向についても画面内にフキダシウィンドウが収まるように位置を調整します。
  321. * @default false
  322. * @type boolean
  323. *
  324. * @param 振動の速さ
  325. * @desc ウィンドウを振動させる際の速さです。制御文字\v[n]が利用できます。
  326. * @default 5
  327. * @type number
  328. *
  329. * @param 振動時間
  330. * @desc ウィンドウを振動させる時間(フレーム)です。制御文字\v[n]が利用できます。0を指定するとずっと振動し続けます。
  331. * @default 60
  332. * @type number
  333. *
  334. * @param テールを使わない
  335. * @desc ポーズサインのテール化機能を無効化します。デフォルトの位置に表示されます。
  336. * @default false
  337. * @type boolean
  338. *
  339. * @param 最小横幅取得変数ID
  340. * @desc 指定した番号の変数の値が、フキダシウィンドウの横幅の最小値(単位はピクセル数)となります。
  341. * @default 0
  342. * @type variable
  343. *
  344. * @param 最小高さ取得変数ID
  345. * @desc 指定した番号の変数の値が、フキダシウィンドウの高さの最小値(単位はピクセル数)となります。
  346. * @default 0
  347. * @type variable
  348. *
  349. * @param lowerLimitX
  350. * @text 下限X座標
  351. * @desc フキダシウィンドウの下限X座標です。
  352. * @default 0
  353. * @type number
  354. *
  355. * @param upperLimitX
  356. * @text 上限X座標
  357. * @desc フキダシウィンドウの上限X座標です。
  358. * @default 0
  359. * @type number
  360. *
  361. * @param lowerLimitY
  362. * @text 下限Y座標
  363. * @desc フキダシウィンドウの下限Y座標です。
  364. * @default 0
  365. * @type number
  366. *
  367. * @param upperLimitY
  368. * @text 上限Y座標
  369. * @desc フキダシウィンドウの上限Y座標です。
  370. * @default 0
  371. * @type number
  372. *
  373. * @param tailImage
  374. * @text テール画像
  375. * @desc テールに使う画像をシステム画像から指定します。
  376. * @default
  377. * @require 1
  378. * @dir img/system/
  379. * @type file
  380. *
  381. * @param tailImageAdjustY
  382. * @text テール画像Y座標
  383. * @desc テールに使う画像のY座標補正値です。
  384. * @default 0
  385. * @type number
  386. * @min -2000
  387. * @max 2000
  388. *
  389. * @help メッセージウィンドウを指定したキャラクターの頭上にフキダシで
  390. * 表示するよう変更します。
  391. *
  392. * YEP_MessageCore.jsのネームポップと併せて使用する場合は、
  393. * プラグイン管理画面で当プラグインをYEP_MessageCore.jsより
  394. * 下に配置してください。
  395. *
  396. * また、FTKR_ExMessageWindow2.jsの複数メッセージウィンドウ表示と
  397. * 併せて使用する場合は、プラグイン管理画面で当プラグインを
  398. * FTKR_ExMessageWindow2.jsより下に配置してください。
  399. *
  400. *
  401. * プラグインパラメータ[自動設定]詳細
  402. * FTKR_ExMessageWindow2.jsと併用する場合、
  403. * 自動設定で使用するメッセージウィンドウは、ウィンドウID0 です。
  404. * OFFの場合、ウィンドウID0 を通常の表示方法に戻します。
  405. *
  406. *
  407. * プラグインコマンド詳細
  408. *  イベントコマンド「プラグインコマンド」から実行。
  409. *  (パラメータの間は半角スペースで区切る)
  410. *
  411. * MWP_VALID [キャラクターID] [ウィンドウ位置] or
  412. * フキダシウィンドウ有効化 [キャラクターID] [ウィンドウ位置]
  413. *  メッセージウィンドウを指定したキャラクターIDの頭上に表示します。
  414. *  プレイヤー : -1 このイベント : 0 指定したIDのイベント : 1 ~
  415. *  フォロワー : -2, -3, -4
  416. *
  417. *  ウィンドウ位置
  418. *   0 : 自動(指定しなかった場合も含む)
  419. *   1 : キャラクターの上に表示
  420. *   2 : キャラクターの下に表示
  421. *
  422. * 例:MWP_VALID 0 1
  423. *   フキダシウィンドウ有効化 3 1
  424. *
  425. * MWP_VALID [イベント名] [ウィンドウ位置] or
  426. * フキダシウィンドウ有効化 [イベント名] [ウィンドウ位置]
  427. *  メッセージウィンドウを指定した名称と一致するイベントの頭上に表示します。
  428. *
  429. * 例:MWP_VALID test_event 1
  430. *   フキダシウィンドウ有効化 テストイベント 2
  431. *
  432. * !複数メッセージウィンドウ表示を使う場合!
  433. * MWP_VALID [キャラクターID] [ウィンドウID] [ウィンドウ位置] or
  434. * フキダシウィンドウ有効化 [キャラクターID] [ウィンドウID] [ウィンドウ位置]
  435. *  指定したメッセージウィンドウIDを指定したキャラクターIDの頭上に表示するようにします。
  436. *  プレイヤー : -1 このイベント : 0 指定したIDのイベント : 1 ~
  437. *  フォロワー : -2, -3, -4
  438. *  ウィンドウIDを指定しない(入力なし)場合は、ウィンドウID0を使用します。
  439. *
  440. * 例:MWP_VALID 0 1
  441. *   フキダシウィンドウ有効化 3 2
  442. *
  443. * MWP_INVALID or
  444. * フキダシウィンドウ無効化
  445. *  ウィンドウの表示方法を通常に戻します。
  446. *
  447. * 例:MWP_INVALID
  448. *   フキダシウィンドウ無効化
  449. *
  450. * !複数メッセージウィンドウ表示を使う場合!
  451. * MWP_INVALID [ウィンドウID]
  452. * フキダシウィンドウ無効化 [ウィンドウID]
  453. *  指定したメッセージウィンドウIDの表示方法を通常に戻します。
  454. *  入力無しはすべてのウィンドウIDの表示方法を通常に戻します。
  455. *
  456. * 例:MWP_INVALID 1
  457. *   フキダシウィンドウ無効化 2
  458. *   フキダシウィンドウ無効化
  459. *
  460. * MWP_FREE 100 200
  461. * フキダシウィンドウフリー配置 100 200
  462. * 指定した任意の位置にフキダシウィンドウを表示します。
  463. *
  464. * MWP_SETTING [設定内容] or
  465. * フキダシウィンドウ設定 [設定内容]
  466. *  フキダシウィンドウの設定を行います。設定内容に以下を入力。
  467. *
  468. *   POS_UPPER or 位置_上固定
  469. *   ウィンドウの位置をキャラクターの上で固定します。
  470. *
  471. *   POS_UPPER 1 or 位置_上固定 1
  472. *   イベントID[1]のみウィンドウの位置をキャラクターの上で固定します。
  473. *
  474. *   POS_UPPER aaa or 位置_上固定 aaa
  475. *   イベント名[aaa]のみウィンドウの位置をキャラクターの上で固定します。
  476. *
  477. *   POS_LOWER or 位置_下固定
  478. *   ウィンドウの位置をキャラクターの下で固定します。
  479. *
  480. *   POS_LOWER -1 or 位置_下固定 -1
  481. *   プレイヤーのみウィンドウの位置をキャラクターの下で固定します。
  482. *
  483. *   POS_LOWER aaa or 位置_下固定 aaa
  484. *   イベント名[aaa]のみウィンドウの位置をキャラクターの下で固定します。
  485. *
  486. *   POS_AUTO or 位置_自動
  487. *   通常はキャラクターの上に表示し、ウィンドウが上に見切れる場合のみ
  488. *   下に表示します。
  489. *
  490. *   SKIN or スキン [/img/system/以下に配置するスキンのファイル名]
  491. *     フキダシウィンドウ時専用のウィンドウスキンを設定します。
  492. *
  493. *   SUB_POS_PLAYER or サブ位置_プレイヤーの頭上
  494. *    選択肢および数値入力のウィンドウをプレイヤーの頭上に表示します。
  495. *    位置関係次第でウィンドウが被る場合があるので、必要に応じて
  496. *    ウィンドウ透過のパラメータを有効にしてください。
  497. *
  498. *   SUB_POS_INNER or サブ位置_メッセージウィンドウ内部
  499. *     選択肢および数値入力のウィンドウをメッセージウィンドウに含めます。
  500. *     この設定を使用する場合は必ずウィンドウ透過のパラメータを
  501. *     有効にしてください。
  502. *
  503. *   SUB_POS_NORMAL or サブ位置_通常
  504. *    選択肢および数値入力のウィンドウをフキダシウィンドウの下に表示します。
  505. *    特に設定を変更しない場合はこの設定になります。
  506. *
  507. *   SUB_POS_RIGHT or サブ位置_右
  508. *    選択肢および数値入力のウィンドウをフキダシウィンドウのテール部分の
  509. *    右側に表示します。
  510. *
  511. * 例:MWP_SETTING POS_UPPER
  512. *   フキダシウィンドウ設定 位置_自動
  513. *   MWP_SETTING SKIN window2
  514. *   フキダシウィンドウ設定 サブ位置_プレイヤーの頭上
  515. *
  516. * MWP_ADJUST [設定内容] or
  517. * フキダシウィンドウ調整 [設定内容]
  518. *  フキダシウィンドウの表示位置やサイズを微調整します。設定内容に以下を入力。
  519. *
  520. *  POS or 位置 [X座標] [Y座標]
  521. *   ウィンドウのX座標とY座標を調整します。指定するのは元の座標からの相対です。
  522. *
  523. *  SIZE or サイズ [横幅] [高さ]
  524. *   ウィンドウの横幅と高さを調整します。指定するのは元のサイズからの相対です。
  525. *
  526. * 例:MWP_ADJUST POS 5 -3
  527. *   フキダシウィンドウ調整 サイズ 20 -40
  528. *
  529. * !複数メッセージウィンドウ表示を使う場合!
  530. * フキダシウィンドウの設定や表示位置、サイズの調整結果は
  531. * すべてのウィンドウIDで共通です。
  532. *
  533. * ・使用可能な制御文字
  534. * \sh[5] # 強さ[5]でウィンドウを振動させます。
  535. *
  536. * 利用規約:
  537. *  作者に無断で改変、再配布が可能で、利用形態(商用、18禁利用等)
  538. *  についても制限はありません。
  539. *  このプラグインはもうあなたのものです。
  540. */

  541. (function() {
  542.     'use strict';
  543.     var pluginName = 'MessageWindowPopup';

  544.     var checkTypeFunction = function(value) {
  545.         return checkType(value, 'Function');
  546.     };

  547.     var checkType = function(value, typeName) {
  548.         return Object.prototype.toString.call(value).slice(8, -1) === typeName;
  549.     };

  550.     var getParamNumber = function(paramNames, min, max) {
  551.         var value = getParamString(paramNames);
  552.         if (arguments.length < 2) min = -Infinity;
  553.         if (arguments.length < 3) max = Infinity;
  554.         return (parseInt(value) || 0).clamp(min, max);
  555.     };

  556.     var getParamBoolean = function(paramNames) {
  557.         var value = getParamString(paramNames);
  558.         return (value || '').toUpperCase() === 'ON' || (value || '').toUpperCase() === 'TRUE';
  559.     };

  560.     var getParamString = function(paramNames) {
  561.         if (!Array.isArray(paramNames)) paramNames = [paramNames];
  562.         for (var i = 0; i < paramNames.length; i++) {
  563.             var name = PluginManager.parameters(pluginName)[paramNames[i]];
  564.             if (name) return name;
  565.         }
  566.         return null;
  567.     };

  568.     var getArgNumber = function(arg, min, max) {
  569.         if (arguments.length <= 2) min = -Infinity;
  570.         if (arguments.length <= 3) max = Infinity;
  571.         return (parseInt(convertEscapeCharacters(arg)) || 0).clamp(min, max);
  572.     };

  573.     var getArgString = function(arg, upperFlg) {
  574.         arg = convertEscapeCharacters(arg);
  575.         return upperFlg ? arg.toUpperCase() : arg;
  576.     };

  577.     var getCommandName = function(command) {
  578.         return (command || '').toUpperCase();
  579.     };

  580.     var convertEscapeCharacters = function(text) {
  581.         if (text == null) text = '';
  582.         var window = SceneManager._scene._windowLayer.children[0];
  583.         return window ? window.convertEscapeCharacters(text) : text;
  584.     };

  585.     //FTKR_ExMessageWindow2.jsを使用しているか
  586.     var imported_FTKR_EMW = function() {
  587.         return typeof Imported !== 'undefined' && Imported.FTKR_EMW;
  588.     };

  589.     var isExistPlugin = function(pluginName) {
  590.         return Object.keys(PluginManager.parameters(pluginName)).length > 0;
  591.     };

  592.     //=============================================================================
  593.     // パラメータのバリデーション
  594.     //=============================================================================
  595.     var paramThroughWindow       = getParamBoolean(['ThroughWindow', 'ウィンドウ透過']);
  596.     var paramFaceScale           = getParamNumber(['FaceScale', 'フェイス倍率'], 1, 100);
  597.     var paramFontSize            = getParamNumber(['FontSize', 'フォントサイズ'], 1);
  598.     var paramPadding             = getParamNumber(['Padding', '余白'], 1);
  599.     var paramLinkage             = getParamBoolean(['WindowLinkage', 'ウィンドウ連携']);
  600.     var paramBetweenLines        = getParamNumber(['BetweenLines', '行間'], 0);
  601.     var paramAutoPopup           = getParamBoolean(['AutoPopup', '自動設定']);
  602.     var paramFontSizeRange       = getParamNumber(['FontSizeRange', 'フォントサイズ増減幅'], 0);
  603.     var paramFontUpperLimit      = getParamNumber(['FontUpperLimit', 'フォントサイズ上限'], 0);
  604.     var paramFontLowerLimit      = getParamNumber(['FontLowerLimit', 'フォントサイズ下限'], 0);
  605.     var paramInnerScreen         = getParamBoolean(['InnerScreen', '画面内に収める']);
  606.     var paramShakeSpeed          = getParamString(['ShakeSpeed', '振動の速さ']);
  607.     var paramShakeDuration       = getParamString(['ShakeDuration', '振動時間']);
  608.     var paramNoUseTail           = getParamBoolean(['NoUseTail', 'テールを使わない']);
  609.     var paramMinWidthVariableId  = getParamNumber(['MinWidthVariableId', '最小横幅取得変数ID']);
  610.     var paramMinHeightVariableId = getParamNumber(['MinHeightVariableId', '最小高さ取得変数ID']);
  611.     var paramLowerLimitX         = getParamNumber(['lowerLimitX']);
  612.     var paramUpperLimitX         = getParamNumber(['upperLimitX']);
  613.     var paramLowerLimitY         = getParamNumber(['lowerLimitY']);
  614.     var paramUpperLimitY         = getParamNumber(['upperLimitY']);
  615.     var paramTailImage           = getParamString(['tailImage']);
  616.     var paramTailImageAdjustY    = getParamNumber(['tailImageAdjustY']);

  617.     //=============================================================================
  618.     // Game_Interpreter
  619.     //  プラグインコマンドを追加定義します。
  620.     //=============================================================================
  621.     var _Game_Interpreter_pluginCommand      = Game_Interpreter.prototype.pluginCommand;
  622.     Game_Interpreter.prototype.pluginCommand = function(command, args) {
  623.         _Game_Interpreter_pluginCommand.apply(this, arguments);
  624.         this.pluginCommandMessageWindowPopup(command, args);
  625.     };

  626.     Game_Interpreter.prototype.pluginCommandMessageWindowPopup = function(command, args) {
  627.         switch (getCommandName(command)) {
  628.             case 'MWP_VALID' :
  629.             case 'フキダシウィンドウ有効化':
  630.                 $gameSystem.clearMessagePopupFree();
  631.                 var eventId = this.getEventIdForMessagePopup(args[0]);
  632.                 if (isNaN(eventId)) {
  633.                     eventId = this.getEventIdFromEventName(eventId);
  634.                 }
  635.                 $gameSystem.setMessagePopup(eventId);
  636.                 var windowPosition;
  637.                 if (imported_FTKR_EMW() && args[1]) {
  638.                     var windowId = getArgNumber(args[1]);
  639.                     if (windowId >= 0) $gameSystem.setMessagePopupEx(windowId, eventId);
  640.                     windowPosition = getArgNumber(args[2]);
  641.                 } else {
  642.                     windowPosition = getArgNumber(args[1]);
  643.                 }
  644.                 if (windowPosition === 1) {
  645.                     $gameSystem.setPopupFixUpper(eventId);
  646.                 } else if (windowPosition === 2) {
  647.                     $gameSystem.setPopupFixLower(eventId);
  648.                 }
  649.                 break;
  650.             case 'MWP_FREE' :
  651.             case 'フキダシウィンドウフリー配置':
  652.                 var x = getArgNumber(args[0]) || 0;
  653.                 var y = getArgNumber(args[1]) || 0;
  654.                 $gameSystem.setMessagePopupFree(x, y);
  655.                 break;
  656.             case 'MWP_INVALID':
  657.             case 'フキダシウィンドウ無効化':
  658.                 $gameSystem.clearMessagePopupFree();
  659.                 if (imported_FTKR_EMW() && args[0]) {
  660.                     var windowId2 = getArgNumber(args[0]);
  661.                     if (windowId2 >= 0) $gameSystem.clearMessagePopupEx(windowId2);
  662.                 } else {
  663.                     $gameSystem.clearMessagePopup();
  664.                 }
  665.                 break;
  666.             case 'MWP_SETTING' :
  667.             case 'フキダシウィンドウ設定':
  668.                 switch (getCommandName(args[0])) {
  669.                     case 'POS_UPPER' :
  670.                     case '位置_上固定':
  671.                         $gameSystem.setPopupFixUpper(args[1] ? this.getEventIdForMessagePopup(args[1]) : null);
  672.                         break;
  673.                     case 'POS_LOWER' :
  674.                     case '位置_下固定':
  675.                         $gameSystem.setPopupFixLower(args[1] ? this.getEventIdForMessagePopup(args[1]) : null);
  676.                         break;
  677.                     case 'POS_AUTO' :
  678.                     case '位置_自動':
  679.                         $gameSystem.setPopupAuto(args[1] ? this.getEventIdForMessagePopup(args[1]) : null);
  680.                         break;
  681.                     case 'SKIN' :
  682.                     case 'スキン' :
  683.                         $gameSystem.setPopupWindowSkin(getArgString(args[1]));
  684.                         this.setWaitMode('image');
  685.                         break;
  686.                     case 'SUB_POS_NORMAL' :
  687.                     case 'サブ位置_通常':
  688.                         $gameSystem.setPopupSubWindowPosition(0);
  689.                         break;
  690.                     case 'SUB_POS_PLAYER' :
  691.                     case 'サブ位置_プレイヤーの頭上':
  692.                         $gameSystem.setPopupSubWindowPosition(1);
  693.                         break;
  694.                     case 'SUB_POS_INNER' :
  695.                     case 'サブ位置_メッセージウィンドウ内部':
  696.                         $gameSystem.setPopupSubWindowPosition(2);
  697.                         break;
  698.                     case 'SUB_POS_RIGHT' :
  699.                     case 'サブ位置_右':
  700.                         $gameSystem.setPopupSubWindowPosition(3);
  701.                         break;
  702.                 }
  703.                 break;
  704.             case 'MWP_ADJUST':
  705.             case 'フキダシウィンドウ調整':
  706.                 switch (getCommandName(args[0])) {
  707.                     case 'SIZE' :
  708.                     case 'サイズ':
  709.                         $gameSystem.setPopupAdjustSize(getArgNumber(args[1]), getArgNumber(args[2]));
  710.                         break;
  711.                     case 'POS' :
  712.                     case '位置':
  713.                         $gameSystem.setPopupAdjustPosition(getArgNumber(args[1]), getArgNumber(args[2]));
  714.                         break;
  715.                 }
  716.                 break;
  717.         }
  718.     };

  719.     Game_Interpreter.prototype.getEventIdForMessagePopup = function(arg) {
  720.         var convertedArg = convertEscapeCharacters(arg);
  721.         var eventId      = parseInt(convertedArg);
  722.         if (isNaN(eventId)) {
  723.             return convertedArg;
  724.         }
  725.         if (eventId === 0) {
  726.             eventId = this.eventId() || ($gameMap.isEventRunning() ? $gameMap._interpreter.eventId() : 0);
  727.         }
  728.         return eventId;
  729.     };

  730.     Game_Interpreter.prototype.getEventIdFromEventName = function(eventName) {
  731.         var eventId = 0;
  732.         $gameMap.events().some(function(event) {
  733.             if (event.event().name === eventName) {
  734.                 eventId = event.eventId();
  735.                 return true;
  736.             }
  737.             return false;
  738.         });
  739.         return eventId;
  740.     };

  741.     var _Game_Interpreter_terminate      = Game_Interpreter.prototype.terminate;
  742.     Game_Interpreter.prototype.terminate = function() {
  743.         _Game_Interpreter_terminate.apply(this, arguments);
  744.         if (this._depth === 0 && this.isGameMapInterpreter()) {
  745.             if (imported_FTKR_EMW()) {
  746.                 $gameSystem.clearMessagePopupEx(this.windowId());
  747.             } else {
  748.                 $gameSystem.clearMessagePopup();
  749.             }
  750.         }
  751.     };

  752.     Game_Interpreter.prototype.setGameMapInterpreter = function() {
  753.         this._gameMapInterpreter = true;
  754.     };

  755.     Game_Interpreter.prototype.isGameMapInterpreter = function() {
  756.         return this._gameMapInterpreter;
  757.     };

  758.     //=============================================================================
  759.     // Game_System
  760.     //  ポップアップフラグを保持します。
  761.     //=============================================================================
  762.     var _Game_System_initialize      = Game_System.prototype.initialize;
  763.     Game_System.prototype.initialize = function() {
  764.         _Game_System_initialize.apply(this, arguments);
  765.         this._messagePopupCharacterId       = 0;
  766.         this._messagePopupPosition          = null;
  767.         this._messagePopupAdjustSize        = null;
  768.         this._messagePopupAdjustPosition    = null;
  769.         this._messagePopupWindowSkin        = null;
  770.         this._messagePopupSubWindowPosition = 0;
  771.     };

  772.     Game_System.prototype.initMessagePositionEvents = function() {
  773.         if (!this._messagePopupPositionEvents) {
  774.             this._messagePopupPositionEvents = [];
  775.         }
  776.     };

  777.     Game_System.prototype.setPopupSubWindowPosition = function(position) {
  778.         this._messagePopupSubWindowPosition = position.clamp(0, 3);
  779.     };

  780.     Game_System.prototype.getPopupSubWindowPosition = function() {
  781.         return this._messagePopupSubWindowPosition;
  782.     };

  783.     Game_System.prototype.setPopupWindowSkin = function(fileName) {
  784.         this._messagePopupWindowSkin = fileName;
  785.         ImageManager.loadSystem(fileName);
  786.     };

  787.     Game_System.prototype.getPopupWindowSkin = function() {
  788.         return this._messagePopupWindowSkin;
  789.     };

  790.     Game_System.prototype.setMessagePopup = function(id) {
  791.         this._messagePopupCharacterId = id;
  792.     };

  793.     Game_System.prototype.clearMessagePopup = function() {
  794.         this._messagePopupCharacterId    = 0;
  795.         this._messagePopupPositionEvents = [];
  796.     };

  797.     Game_System.prototype.setMessagePopupFree = function(x, y) {
  798.         this._messagePopupFreeX       = x;
  799.         this._messagePopupFreeY       = y;
  800.         this._messagePopupCharacterId = 1;
  801.     };

  802.     Game_System.prototype.clearMessagePopupFree = function() {
  803.         this.setMessagePopupFree(undefined, undefined);
  804.     };

  805.     Game_System.prototype.getMessagePopupId = function() {
  806.         return this._messagePopupCharacterId !== 0 ? this._messagePopupCharacterId : null;
  807.     };

  808.     Game_System.prototype.getMessagePopupFree = function() {
  809.         if (this._messagePopupFreeX === undefined || this._messagePopupFreeY === undefined) {
  810.             return null;
  811.         }
  812.         return {x: this._messagePopupFreeX, y: this._messagePopupFreeY};
  813.     };

  814.     Game_System.prototype.setPopupFixUpper = function(characterId) {
  815.         this.setPopupFixPosition(characterId, 1);
  816.     };

  817.     Game_System.prototype.setPopupFixLower = function(characterId) {
  818.         this.setPopupFixPosition(characterId, 2);
  819.     };

  820.     Game_System.prototype.setPopupAuto = function(characterId) {
  821.         this.setPopupFixPosition(characterId, 0);
  822.     };

  823.     Game_System.prototype.setPopupFixPosition = function(characterId, position) {
  824.         if (characterId !== null) {
  825.             this.initMessagePositionEvents();
  826.             this._messagePopupPositionEvents[characterId] = position;
  827.         } else {
  828.             this._messagePopupPosition = position;
  829.         }
  830.     };

  831.     Game_System.prototype.setPopupAdjustSize = function(w, h) {
  832.         this._messagePopupAdjustSize = [w, h];
  833.     };

  834.     Game_System.prototype.getPopupAdjustSize = function() {
  835.         return this._messagePopupAdjustSize;
  836.     };

  837.     Game_System.prototype.setPopupAdjustPosition = function(x, y) {
  838.         this._messagePopupAdjustPosition = [x, y];
  839.     };

  840.     Game_System.prototype.getPopupAdjustPosition = function() {
  841.         return this._messagePopupAdjustPosition;
  842.     };

  843.     Game_System.prototype.isPopupFixUpper = function(eventId) {
  844.         return this.isPopupFixPosition(1, eventId);
  845.     };

  846.     Game_System.prototype.isPopupFixLower = function(eventId) {
  847.         return this.isPopupFixPosition(2, eventId);
  848.     };

  849.     Game_System.prototype.isPopupFixPosition = function(position, eventId) {
  850.         var id = eventId || this._messagePopupCharacterId;
  851.         this.initMessagePositionEvents();
  852.         var positionFixForId   = this._messagePopupPositionEvents[id];
  853.         var event              = $gameMap.event(id);
  854.         var positionFixForName = event ? this._messagePopupPositionEvents[event.event().name] : 0;
  855.         if (positionFixForId > 0) {
  856.             return positionFixForId === position;
  857.         } else if (positionFixForName > 0) {
  858.             return positionFixForName === position;
  859.         } else {
  860.             return this._messagePopupPosition === position;
  861.         }
  862.     };

  863.     //=============================================================================
  864.     // Game_Map
  865.     //  イベント起動時に自動設定を適用します。
  866.     //=============================================================================
  867.     var _Game_Map_setupStartingMapEvent      = Game_Map.prototype.setupStartingMapEvent;
  868.     Game_Map.prototype.setupStartingMapEvent = function() {
  869.         var result = _Game_Map_setupStartingMapEvent.apply(this, arguments);
  870.         if (result) {
  871.             if (paramAutoPopup) {
  872.                 $gameSystem.setMessagePopup(this._interpreter.eventId());
  873.             } else if (imported_FTKR_EMW()) {
  874.                 $gameSystem.clearMessagePopupEx(0);
  875.             } else {
  876.                 $gameSystem.clearMessagePopup();
  877.             }
  878.         }
  879.         return result;
  880.     };

  881.     var _Game_Map_setup      = Game_Map.prototype.setup;
  882.     Game_Map.prototype.setup = function(mapId) {
  883.         _Game_Map_setup.apply(this, arguments);
  884.         this._interpreter.setGameMapInterpreter();
  885.     };

  886.     //=============================================================================
  887.     // Game_Troop
  888.     //  戦闘開始時にポップアップフラグを解除します。
  889.     //=============================================================================
  890.     var _Game_Troop_setup      = Game_Troop.prototype.setup;
  891.     Game_Troop.prototype.setup = function(troopId) {
  892.         _Game_Troop_setup.apply(this, arguments);
  893.         $gameSystem.clearMessagePopup();
  894.     };

  895.     //=============================================================================
  896.     // Game_CharacterBase
  897.     //  キャラクターの高さを設定します。
  898.     //=============================================================================
  899.     var _Game_CharacterBase_initMembers      = Game_CharacterBase.prototype.initMembers;
  900.     Game_CharacterBase.prototype.initMembers = function() {
  901.         _Game_CharacterBase_initMembers.apply(this, arguments);
  902.         this.setSizeForMessagePopup(0, 0);
  903.     };

  904.     Game_CharacterBase.prototype.setSizeForMessagePopup = function(width, height) {
  905.         this._size = [width, height];
  906.     };

  907.     Game_CharacterBase.prototype.getHeightForPopup = function() {
  908.         return $gameScreen.zoomScale() * this._size[1];
  909.     };

  910.     Game_CharacterBase.prototype.getRealScreenX = function() {
  911.         return $gameScreen.convertRealX(this.screenX());
  912.     };

  913.     Game_CharacterBase.prototype.getRealScreenY = function() {
  914.         return $gameScreen.convertRealY(this.screenY());
  915.     };

  916.     //=============================================================================
  917.     // Game_Screen
  918.     //  画面座標をズームを考慮した座標に変換します。
  919.     //=============================================================================
  920.     Game_Screen.prototype.convertRealX = function(x) {
  921.         var scale = this.zoomScale();
  922.         return scale * x - (scale - 1.0) * this.zoomX();
  923.     };

  924.     Game_Screen.prototype.convertRealY = function(y) {
  925.         var scale = this.zoomScale();
  926.         return scale * y - (scale - 1.0) * this.zoomY();
  927.     };

  928.     //=============================================================================
  929.     // Scene_Map
  930.     //  ポップアップ用のウィンドウスキンをロードします。
  931.     //=============================================================================
  932.     var _Scene_Map_isReady      = Scene_Map.prototype.isReady;
  933.     Scene_Map.prototype.isReady = function() {
  934.         var ready   = _Scene_Map_isReady.apply(this, arguments);
  935.         var popSkin = $gameSystem.getPopupWindowSkin();
  936.         if (popSkin && ready) {
  937.             var bitmap = ImageManager.loadSystem(popSkin);
  938.             return bitmap.isReady();
  939.         }
  940.         return ready;
  941.     };

  942.     //=============================================================================
  943.     // Sprite_Character
  944.     //  キャラクターの高さを逆設定します。
  945.     //=============================================================================
  946.     var _Sprite_Character_updateBitmap      = Sprite_Character.prototype.updateBitmap;
  947.     Sprite_Character.prototype.updateBitmap = function() {
  948.         if (this.isImageChanged()) this._imageChange = true;
  949.         _Sprite_Character_updateBitmap.apply(this, arguments);
  950.         if (this._imageChange) {
  951.             this.bitmap.addLoadListener(function() {
  952.                 var width  = this.bitmap.width === 1 ? $gameMap.tileWidth() : this.patternWidth();
  953.                 var height = this.bitmap.height === 1 ? $gameMap.tileHeight() : this.patternHeight();
  954.                 this._character.setSizeForMessagePopup(width, height);
  955.             }.bind(this));
  956.             this._imageChange = false;
  957.         }
  958.     };

  959.     //=============================================================================
  960.     // Window_Base
  961.     //  共通処理を定義します。
  962.     //=============================================================================
  963.     var _Window_Base_loadWindowskin      = Window_Base.prototype.loadWindowskin;
  964.     Window_Base.prototype.loadWindowskin = function() {
  965.         var popSkin = $gameSystem.getPopupWindowSkin();
  966.         if (this.isPopup() && popSkin) {
  967.             this.windowskin = ImageManager.loadSystem(popSkin);
  968.         } else {
  969.             _Window_Base_loadWindowskin.apply(this, arguments);
  970.         }
  971.     };

  972.     Window_Base.prototype.setPauseSignToTail = function(lowerFlg) {
  973.         if (lowerFlg) {
  974.             this._windowPauseSignSprite.rotation = 180 * Math.PI / 180;
  975.             this._windowPauseSignSprite.y        = 12;
  976.             this._windowPauseSignSprite.anchor.y = 0;
  977.         } else {
  978.             this._windowPauseSignSprite.rotation = 0;
  979.             this._windowPauseSignSprite.y        = this.height + 12;
  980.             this._windowPauseSignSprite.anchor.y = 1;
  981.         }
  982.         this._pauseSignLower  = lowerFlg;
  983.         this._pauseSignToTail = true;
  984.     };

  985.     Window_Base.prototype.setPauseSignImageToTail = function(lowerFlg) {
  986.         this._windowPauseSignSprite.visible = false;
  987.         if (lowerFlg) {
  988.             this._messageTailImage.rotation = 180 * Math.PI / 180;
  989.             this._messageTailImage.y        = -paramTailImageAdjustY;
  990.             this._messageTailImage.anchor.y = 0;
  991.         } else {
  992.             this._messageTailImage.rotation = 0;
  993.             this._messageTailImage.y        = this.height + paramTailImageAdjustY;
  994.             this._messageTailImage.anchor.y = 0;
  995.         }
  996.     };

  997.     Window_Base.prototype.setPauseSignToNormal = function() {
  998.         this._windowPauseSignSprite.rotation = 0;
  999.         this._windowPauseSignSprite.anchor.y = 1.0;
  1000.         this._windowPauseSignSprite.move(this._width / 2, this._height);
  1001.         this._pauseSignToTail = false;
  1002.     };

  1003.     var _Window_Base_updatePauseSign       = Window_Base.prototype._updatePauseSign;
  1004.     Window_Base.prototype._updatePauseSign = function() {
  1005.         _Window_Base_updatePauseSign.apply(this, arguments);
  1006.         if (this._pauseSignToTail) this._windowPauseSignSprite.alpha = 1.0;
  1007.     };

  1008.     Window_Base.prototype.isPopupLower = function() {
  1009.         return $gameSystem.isPopupFixLower() || (!$gameSystem.isPopupFixUpper() && this.y < 0);
  1010.     };

  1011.     Window_Base.prototype.setPopupPosition = function(character) {
  1012.         this._popupCharacter = character;
  1013.         this._popupFreePos   = $gameSystem.getMessagePopupFree();
  1014.         this.setPopupBasePosition();
  1015.         this.setPopupLowerPosition();
  1016.         this.setPopupAdjustInnerScreen();
  1017.         if (this._shakePower > 0) {
  1018.             this.setPopupShakePosition();
  1019.         }
  1020.     };

  1021.     Window_Base.prototype.getPopupBaseX = function() {
  1022.         return this._popupFreePos ? this._popupFreePos.x : this._popupCharacter.getRealScreenX();
  1023.     };

  1024.     Window_Base.prototype.getPopupBaseY = function() {
  1025.         return this._popupFreePos ? this._popupFreePos.y : this._popupCharacter.getRealScreenY();
  1026.     };

  1027.     Window_Base.prototype.getHeightForPopup = function() {
  1028.         return this._popupFreePos ? 0 : (this._popupCharacter.getHeightForPopup() + 8);
  1029.     };

  1030.     Window_Base.prototype.setPopupBasePosition = function() {
  1031.         var pos = $gameSystem.getPopupAdjustPosition();
  1032.         this.x  = this.getPopupBaseX() - this.width / 2 + (pos ? pos[0] : 0);
  1033.         this.y  = this.getPopupBaseY() - this.height - this.getHeightForPopup() + (pos ? pos[1] : 0);
  1034.     };

  1035.     Window_Base.prototype.setPopupShakePosition = function() {
  1036.         var duration = getArgNumber(paramShakeDuration);
  1037.         if (duration && this._shakeCount > duration) {
  1038.             this.setWindowShake(0);
  1039.         }
  1040.         var speed    = getArgNumber(paramShakeSpeed, 1);
  1041.         var position = Math.sin(this._shakeCount / 10 * speed) * this._shakePower;
  1042.         this.x += position;
  1043.         this._windowPauseSignSprite.x -= position;
  1044.         this._messageTailImage.x -= position;
  1045.         this._shakeCount++;
  1046.     };

  1047.     Window_Base.prototype.setPopupLowerPosition = function() {
  1048.         var lowerFlg = this.isPopupLower();
  1049.         if (lowerFlg) {
  1050.             this.y += this.height + this.getHeightForPopup() + 8;
  1051.         }
  1052.         if (!paramNoUseTail && !this.isUsePauseSignTextEnd()) {
  1053.             this.setPauseSignToTail(lowerFlg);
  1054.         }
  1055.         if (paramTailImage) {
  1056.             this.setPauseSignImageToTail(lowerFlg);
  1057.         }
  1058.     };

  1059.     Window_Base.prototype.setPopupAdjustInnerScreen = function() {
  1060.         if (paramInnerScreen) {
  1061.             this.adjustPopupPositionY();
  1062.         }
  1063.         var adjustResultX = this.adjustPopupPositionX();
  1064.         var tailX = this._width / 2 + adjustResultX;
  1065.         if (!this.isUsePauseSignTextEnd()) {
  1066.             this._windowPauseSignSprite.x = tailX
  1067.         }
  1068.         this._messageTailImage.x = tailX;
  1069.     };

  1070.     Window_Base.prototype.setWindowShake = function(power) {
  1071.         this._shakePower = power;
  1072.         this._shakeCount = 0;
  1073.     };

  1074.     Window_Base.prototype.adjustPopupPositionX = function() {
  1075.         var deltaX = 0;
  1076.         var minX   = paramLowerLimitX || 0;
  1077.         var maxX   = paramUpperLimitX || Graphics.boxWidth;
  1078.         if (this.x < minX) {
  1079.             deltaX = this.x - minX;
  1080.             this.x = minX;
  1081.         }
  1082.         if (this.x + this.width > maxX) {
  1083.             deltaX = this.x + this.width - maxX;
  1084.             this.x = maxX - this.width;
  1085.         }
  1086.         return deltaX;
  1087.     };

  1088.     Window_Base.prototype.adjustPopupPositionY = function() {
  1089.         var minY = (this._pauseSignLower ? this._windowPauseSignSprite.height / 2 : 0);
  1090.         minY += paramLowerLimitY || 0;
  1091.         if (this.y < minY) {
  1092.             this.y = minY;
  1093.         }
  1094.         var maxY = (paramUpperLimitY || Graphics.boxHeight) - this._windowPauseSignSprite.height / 2;
  1095.         if (this.y + this.height > maxY) {
  1096.             this.y = maxY - this.height;
  1097.         }
  1098.     };

  1099.     Window_Base.prototype.updatePlacementPopup = function() {
  1100.         if (!this._messageWindow) return;
  1101.         if (paramLinkage) {
  1102.             switch ($gameSystem.getPopupSubWindowPosition()) {
  1103.                 case 0:
  1104.                     this.x = this._messageWindow.x;
  1105.                     this.y = this._messageWindow.y + this._messageWindow.height;
  1106.                     this.setPauseSignToNormal();
  1107.                     break;
  1108.                 case 1:
  1109.                     this.setPopupPosition($gamePlayer);
  1110.                     break;
  1111.                 case 2:
  1112.                     var pos = this._messageWindow.getSubWindowPosition();
  1113.                     this.x  = pos.x;
  1114.                     this.y  = pos.y;
  1115.                     this.setPauseSignToNormal();
  1116.                     this.opacity = 0;
  1117.                     break;
  1118.                 case 3:
  1119.                     this.x = this._messageWindow.x + this._messageWindow.width / 2 + 16;
  1120.                     this.y = this._messageWindow.y + this._messageWindow.height;
  1121.                     this.setPauseSignToNormal();
  1122.                     break;
  1123.             }
  1124.         } else {
  1125.             this.y = Graphics.boxHeight - this.height - this._messageWindow.windowHeight() / 2;
  1126.         }
  1127.     };

  1128.     Window_Base.prototype.isPopup = function() {
  1129.         return false;
  1130.     };

  1131.     Window_Base.prototype.isPopupLinkage = function() {
  1132.         return this.isPopup() && paramLinkage;
  1133.     };

  1134.     Window_Base.prototype.resetLayout = function() {
  1135.         this.padding = this.standardPadding();
  1136.         this.width   = this.windowWidth();
  1137.         this.height  = this.windowHeight();
  1138.         this.loadWindowskin();
  1139.         this.setPauseSignToNormal();
  1140.     };

  1141.     var _Window_Base_makeFontBigger      = Window_Base.prototype.makeFontBigger;
  1142.     Window_Base.prototype.makeFontBigger = function() {
  1143.         if (this.isValidFontRangeForPopup()) {
  1144.             if (this.contents.fontSize <= paramFontUpperLimit) {
  1145.                 this.contents.fontSize += paramFontSizeRange;
  1146.             }
  1147.         } else {
  1148.             _Window_Base_makeFontBigger.apply(this, arguments);
  1149.         }
  1150.     };

  1151.     var _Window_Base_makeFontSmaller      = Window_Base.prototype.makeFontSmaller;
  1152.     Window_Base.prototype.makeFontSmaller = function() {
  1153.         if (this.isValidFontRangeForPopup()) {
  1154.             if (this.contents.fontSize >= paramFontLowerLimit) {
  1155.                 this.contents.fontSize -= paramFontSizeRange;
  1156.             }
  1157.         } else {
  1158.             _Window_Base_makeFontSmaller.apply(this, arguments);
  1159.         }
  1160.     };

  1161.     Window_Base.prototype.isValidFontRangeForPopup = function() {
  1162.         return this.isPopup() && paramFontSizeRange > 0;
  1163.     };

  1164.     Window_Base.prototype.isUsePauseSignTextEnd = function() {
  1165.         return this.isValidPauseSignTextEnd && this.isValidPauseSignTextEnd()
  1166.     };

  1167.     //=============================================================================
  1168.     // Window_Message
  1169.     //  ポップアップする場合、表示内容により座標とサイズを自動設定します。
  1170.     //=============================================================================
  1171.     Window_Message._faceHeight = Math.floor(Window_Base._faceHeight * paramFaceScale / 100);
  1172.     Window_Message._faceWidth  = Math.floor(Window_Base._faceWidth * paramFaceScale / 100);

  1173.     var _Window_Message__createAllParts = Window_Message.prototype._createAllParts;
  1174.     Window_Message.prototype._createAllParts = function() {
  1175.         _Window_Message__createAllParts.apply(this, arguments);
  1176.         this._messageTailImage = new Sprite();
  1177.         if (paramTailImage) {
  1178.             this._messageTailImage.bitmap   = ImageManager.loadSystem(paramTailImage);
  1179.             this._messageTailImage.visible  = false;
  1180.             this._messageTailImage.anchor.x = 0.5;
  1181.             this.addChild(this._messageTailImage);
  1182.         }
  1183.     };

  1184.     var _Window_Message_standardFontSize      = Window_Message.prototype.standardFontSize;
  1185.     Window_Message.prototype.standardFontSize = function() {
  1186.         return this.isPopup() ? paramFontSize : _Window_Message_standardFontSize.apply(this, arguments);
  1187.     };

  1188.     var _Window_Message_standardPadding      = Window_Message.prototype.standardPadding;
  1189.     Window_Message.prototype.standardPadding = function() {
  1190.         return this.isPopup() ? paramPadding : _Window_Message_standardPadding.apply(this, arguments);
  1191.     };

  1192.     var _Window_Message_calcTextHeight      = Window_Message.prototype.calcTextHeight;
  1193.     Window_Message.prototype.calcTextHeight = function(textState, all) {
  1194.         var height = _Window_Message_calcTextHeight.apply(this, arguments);
  1195.         return this.isPopup() ? height - 8 + paramBetweenLines : height;
  1196.     };

  1197.     var _Window_Message_startMessage      = Window_Message.prototype.startMessage;
  1198.     Window_Message.prototype.startMessage = function() {
  1199.         this.updateTargetCharacterId();
  1200.         this.loadWindowskin();
  1201.         // Resolve conflict for MPP_MessageEX
  1202.         if (isExistPlugin('MPP_MessageEX')) {
  1203.             this.width = this.windowWidth();
  1204.         }
  1205.         _Window_Message_startMessage.apply(this, arguments);
  1206.         this.resetLayout();
  1207.     };

  1208.     var _Window_Message_loadWindowskin      = Window_Message.prototype.loadWindowskin;
  1209.     Window_Message.prototype.loadWindowskin = function() {
  1210.         var popupWindowSkin = $gameSystem.getPopupWindowSkin();
  1211.         if (this._windowSkinName !== popupWindowSkin || !popupWindowSkin) {
  1212.             if (this.isPopup()) {
  1213.                 this._windowSkinName = popupWindowSkin;
  1214.             }
  1215.         }
  1216.         _Window_Message_loadWindowskin.apply(this, arguments);
  1217.     };

  1218.     Window_Message.prototype.updateTargetCharacterId = function() {
  1219.         this._targetCharacterId = $gameSystem.getMessagePopupId();
  1220.     };

  1221.     var _Window_Message_resetFontSettings      = Window_Message.prototype.resetFontSettings;
  1222.     Window_Message.prototype.resetFontSettings = function() {
  1223.         _Window_Message_resetFontSettings.apply(this, arguments);
  1224.         if (this.isPopup()) this.contents.fontSize = paramFontSize;
  1225.     };

  1226.     Window_Message.prototype.getPopupTargetCharacter = function() {
  1227.         var id = this._targetCharacterId;
  1228.         if (id < -1) {
  1229.             return $gamePlayer.followers().follower((id * -1) - 2);
  1230.         } else if (id === -1) {
  1231.             return $gamePlayer;
  1232.         } else if (id > -1) {
  1233.             return $gameMap.event(id);
  1234.         } else {
  1235.             return null;
  1236.         }
  1237.     };

  1238.     Window_Message.prototype.isPopup = function() {
  1239.         return !!this.getPopupTargetCharacter();
  1240.     };

  1241.     var _Window_Message_update      = Window_Message.prototype.update;
  1242.     Window_Message.prototype.update = function() {
  1243.         _Window_Message_update.apply(this, arguments);
  1244.         var prevX = this.x;
  1245.         var prevY = this.y;
  1246.         if (this.openness > 0 && this.isPopup()) this.updatePlacementPopup();
  1247.         if ((prevX !== this.x || prevY !== this.y) && this.isClosing()) {
  1248.             this.openness = 0;
  1249.         }
  1250.     };

  1251.     var _Window_Message_updatePlacement      = Window_Message.prototype.updatePlacement;
  1252.     Window_Message.prototype.updatePlacement = function() {
  1253.         if (typeof Yanfly === 'undefined' || !Yanfly.Message) {
  1254.             var width = this.windowWidth();
  1255.             this.x = (Graphics.boxWidth - width) / 2;
  1256.         }
  1257.         _Window_Message_updatePlacement.apply(this, arguments);
  1258.         if (!this.isPopup()) {
  1259.             if (this._positionLock) {
  1260.                 this.loadContainerInfo();
  1261.             }
  1262.             return;
  1263.         }
  1264.         this.updatePlacementPopup();
  1265.         // Resolve conflict for MKR_MessageWindowCustom.js
  1266.         if (isExistPlugin('MKR_MessageWindowCustom')) {
  1267.             this.processVirtual();
  1268.         }
  1269.     };

  1270.     var _Window_Message__updatePauseSign = Window_Message.prototype.hasOwnProperty('_updatePauseSign') ?
  1271.         Window_Message.prototype._updatePauseSign : null;
  1272.     Window_Message.prototype._updatePauseSign = function() {
  1273.         if (_Window_Message__updatePauseSign) {
  1274.             _Window_Message__updatePauseSign.apply(this, arguments);
  1275.         } else {
  1276.             Window_Base.prototype._updatePauseSign.apply(this, arguments);
  1277.         }
  1278.         this.updateTailImage();
  1279.     };

  1280.     Window_Message.prototype.isPopupLower = function() {
  1281.         var id = this._targetCharacterId;
  1282.         return $gameSystem.isPopupFixLower(id) || (!$gameSystem.isPopupFixUpper(id) && this.getWindowTopY() < 0);
  1283.     };

  1284.     Window_Message.prototype.getWindowTopY = function() {
  1285.         return this.y - (this._nameWindow && this._nameWindow.visible ? this._nameWindow.height : 0);
  1286.     };

  1287.     Window_Message.prototype.updatePlacementPopup = function() {
  1288.         this.setPopupPosition(this.getPopupTargetCharacter());
  1289.         if (this._choiceWindow && $gameMessage.isChoice()) {
  1290.             this._choiceWindow.updatePlacementPopup();
  1291.         }
  1292.         this._numberWindow.updatePlacementPopup();
  1293.         // Resolve conflict for YEP_MessageCore.js and MPP_MessageEX.js
  1294.         if (this._nameWindow && checkTypeFunction(this._nameWindow.updatePlacementPopup)) {
  1295.             this._nameWindow.updatePlacementPopup();
  1296.             if (isExistPlugin('MPP_MessageEX')) {
  1297.                 this._nameWindow.y = this.y - this._nameWindow.height;
  1298.                 this._nameWindow.x = this.x;
  1299.             }
  1300.         }
  1301.     };

  1302.     Window_Message.prototype.updateTailImage = function() {
  1303.         if (!this.isPopup()) {
  1304.             this._messageTailImage.visible = false;
  1305.         } else if (paramTailImage) {
  1306.             this._messageTailImage.visible = this.isOpen();
  1307.             if (!this.isUsePauseSignTextEnd() && !paramNoUseTail) {
  1308.                 this._windowPauseSignSprite.visible = false;
  1309.             }
  1310.         }
  1311.     };

  1312.     Window_Message.prototype.resetLayout = function() {
  1313.         this.padding = this.standardPadding();
  1314.         if (this.getPopupTargetCharacter()) {
  1315.             this.processVirtual();
  1316.         } else {
  1317.             this.width  = this.windowWidth();
  1318.             this.height = this.windowHeight();
  1319.             this.setPauseSignToNormal();
  1320.         }
  1321.         this.updatePlacement();
  1322.         this.updateBackground();
  1323.     };

  1324.     Window_Message.prototype.processVirtual = function() {
  1325.         var virtual      = {};
  1326.         virtual.index    = 0;
  1327.         virtual.text     = this.convertEscapeCharacters($gameMessage.allText());
  1328.         virtual.maxWidth = 0;
  1329.         this.newPage(virtual);
  1330.         while (!this.isEndOfText(virtual)) {
  1331.             this.processVirtualCharacter(virtual);
  1332.         }
  1333.         virtual.y += virtual.height;
  1334.         this._subWindowY = virtual.y;
  1335.         var choices      = $gameMessage.choices();
  1336.         if (choices && $gameSystem.getPopupSubWindowPosition() === 2) {
  1337.             virtual.y += choices.length * this._choiceWindow.lineHeight();
  1338.             virtual.maxWidth = Math.max(virtual.maxWidth, this.newLineX() + this._choiceWindow.maxChoiceWidth());
  1339.         }
  1340.         var digit = $gameMessage.numInputMaxDigits();
  1341.         if (digit && $gameSystem.getPopupSubWindowPosition() === 2) {
  1342.             virtual.y += this._numberWindow.lineHeight();
  1343.         }
  1344.         var width  = virtual.maxWidth + this.padding * 2;
  1345.         var height = Math.max(this.getFaceHeight(), virtual.y) + this.padding * 2;
  1346.         var adjust = $gameSystem.getPopupAdjustSize();
  1347.         if (adjust) {
  1348.             width += adjust[0];
  1349.             height += adjust[1];
  1350.         }
  1351.         if (this.isUsePauseSignTextEnd()) {
  1352.             width += this._windowPauseSignSprite.width;
  1353.         } else if (paramNoUseTail) {
  1354.             height += 8;
  1355.         }
  1356.         this.width  = Math.max(width, this.getMinimumWidth());
  1357.         this.height = Math.max(height, this.getMinimumHeight());
  1358.         this.resetFontSettings();
  1359.     };

  1360.     Window_Message.prototype.getMinimumWidth = function() {
  1361.         return $gameVariables.value(paramMinWidthVariableId);
  1362.     };

  1363.     Window_Message.prototype.getMinimumHeight = function() {
  1364.         return $gameVariables.value(paramMinHeightVariableId);
  1365.     };

  1366.     Window_Message.prototype.getSubWindowPosition = function() {
  1367.         var pos = new Point();
  1368.         pos.x   = this.x + this.newLineX();
  1369.         pos.y   = this.y + this._subWindowY;
  1370.         return pos;
  1371.     };

  1372.     Window_Message.prototype.processVirtualCharacter = function(textState) {
  1373.         switch (textState.text[textState.index]) {
  1374.             case '\n':
  1375.                 this.processNewLine(textState);
  1376.                 break;
  1377.             case '\f':
  1378.                 this.processNewPage(textState);
  1379.                 break;
  1380.             case '\x1b':
  1381.                 this.processVirtualEscapeCharacter(this.obtainEscapeCode(textState), textState);
  1382.                 break;
  1383.             default:
  1384.                 this.processVirtualNormalCharacter(textState);
  1385.                 break;
  1386.         }
  1387.     };

  1388.     var _Window_Message_processNewLine      = Window_Message.prototype.processNewLine;
  1389.     Window_Message.prototype.processNewLine = function(textState) {
  1390.         if (this.isPopup()) {
  1391.             textState.index++;
  1392.             _Window_Message_processNewLine.apply(this, arguments);
  1393.             textState.index--;
  1394.         } else {
  1395.             _Window_Message_processNewLine.apply(this, arguments);
  1396.         }
  1397.     };

  1398.     Window_Message.prototype.processVirtualEscapeCharacter = function(code, textState) {
  1399.         switch (code) {
  1400.             case 'C':
  1401.                 this.changeTextColor(this.textColor(this.obtainEscapeParam(textState)));
  1402.                 break;
  1403.             case 'I':
  1404.                 this.processVirtualDrawIcon(this.obtainEscapeParam(textState), textState);
  1405.                 break;
  1406.             case '{':
  1407.                 this.makeFontBigger();
  1408.                 break;
  1409.             case '}':
  1410.                 this.makeFontSmaller();
  1411.                 break;
  1412.             default:
  1413.                 this.obtainEscapeParam(textState);
  1414.                 if (this.obtainEscapeString) {
  1415.                     this.obtainEscapeString(textState);
  1416.                 }
  1417.         }
  1418.     };

  1419.     Window_Message.prototype.processVirtualNormalCharacter = function(textState) {
  1420.         var c = textState.text[textState.index++];
  1421.         textState.x += this.textWidth(c);
  1422.         // Resolve conflict for BetweenCharacters.js
  1423.         if (this.getBetweenCharacters) {
  1424.             textState.x += this.getBetweenCharacters();
  1425.         }
  1426.         textState.maxWidth = Math.max(textState.maxWidth, textState.x);
  1427.     };

  1428.     Window_Message.prototype.processVirtualDrawIcon = function(iconIndex, textState) {
  1429.         textState.x += Window_Base._iconWidth + 4;
  1430.         textState.maxWidth = Math.max(textState.maxWidth, textState.x);
  1431.     };

  1432.     var _Window_Message_newLineX      = Window_Message.prototype.newLineX;
  1433.     Window_Message.prototype.newLineX = function() {
  1434.         if (this.isPopup()) {
  1435.             return $gameMessage.faceName() === '' ? 0 : Window_Message._faceWidth + 8;
  1436.         } else {
  1437.             return _Window_Message_newLineX.apply(this, arguments);
  1438.         }
  1439.     };

  1440.     Window_Message.prototype.getFaceHeight = function() {
  1441.         return $gameMessage.faceName() === '' ? 0 : Window_Message._faceHeight;
  1442.     };

  1443.     var _Window_Message_drawFace      = Window_Message.prototype.drawFace;
  1444.     Window_Message.prototype.drawFace = function(faceName, faceIndex, x, y, width, height) {
  1445.         if (this.isPopup()) {
  1446.             width      = width || Window_Base._faceWidth;
  1447.             height     = height || Window_Base._faceHeight;
  1448.             var bitmap = ImageManager.loadFace(faceName);
  1449.             var pw     = Window_Base._faceWidth;
  1450.             var ph     = Window_Base._faceHeight;
  1451.             var sw     = Math.min(width, pw);
  1452.             var sh     = Math.min(height, ph);
  1453.             var dx     = Math.floor(x + Math.max(width - pw, 0) / 2);
  1454.             var dy     = Math.floor(y + Math.max(height - ph, 0) / 2);
  1455.             var sx     = faceIndex % 4 * pw + (pw - sw) / 2;
  1456.             var sy     = Math.floor(faceIndex / 4) * ph + (ph - sh) / 2;
  1457.             this.contents.blt(bitmap, sx, sy, sw, sh, dx, dy, Window_Message._faceWidth, Window_Message._faceHeight);
  1458.         } else {
  1459.             _Window_Message_drawFace.apply(this, arguments);
  1460.         }
  1461.     };

  1462.     var _Window_Message_processEscapeCharacter      = Window_Message.prototype.processEscapeCharacter;
  1463.     Window_Message.prototype.processEscapeCharacter = function(code, textState) {
  1464.         if (code === 'SH') {
  1465.             this.setWindowShake(this.obtainEscapeParam(textState));
  1466.         } else {
  1467.             _Window_Message_processEscapeCharacter.apply(this, arguments);
  1468.         }
  1469.     };

  1470.     var _Window_Message_terminateMessage      = Window_Message.prototype.terminateMessage;
  1471.     Window_Message.prototype.terminateMessage = function() {
  1472.         this.setWindowShake(0);
  1473.         _Window_Message_terminateMessage.apply(this, arguments);
  1474.     };

  1475.     //=============================================================================
  1476.     // Window_ChoiceList
  1477.     //  ポップアップする場合、メッセージウィンドウに連動して表示位置と余白を調整します。
  1478.     //=============================================================================
  1479.     var _Window_ChoiceList_standardFontSize      = Window_ChoiceList.prototype.standardFontSize;
  1480.     Window_ChoiceList.prototype.standardFontSize = function() {
  1481.         return this.isPopupLinkage() ? paramFontSize : _Window_ChoiceList_standardFontSize.apply(this, arguments);
  1482.     };

  1483.     var _Window_ChoiceList_standardPadding      = Window_ChoiceList.prototype.standardPadding;
  1484.     Window_ChoiceList.prototype.standardPadding = function() {
  1485.         return this.isPopupLinkage() ? paramPadding : _Window_ChoiceList_standardPadding.apply(this, arguments);
  1486.     };

  1487.     var _Window_ChoiceList_lineHeight      = Window_ChoiceList.prototype.lineHeight;
  1488.     Window_ChoiceList.prototype.lineHeight = function() {
  1489.         return this.isPopupLinkage() ? paramFontSize + 8 : _Window_ChoiceList_lineHeight.apply(this, arguments);
  1490.     };

  1491.     var _Window_ChoiceList_start      = Window_ChoiceList.prototype.start;
  1492.     Window_ChoiceList.prototype.start = function() {
  1493.         this._messageWindow.updateTargetCharacterId();
  1494.         if (!this.isPopup()) {
  1495.             this._messageWindow.resetLayout();
  1496.         }
  1497.         return _Window_ChoiceList_start.apply(this, arguments);
  1498.     };

  1499.     var _Window_ChoiceList_updatePlacement      = Window_ChoiceList.prototype.updatePlacement;
  1500.     Window_ChoiceList.prototype.updatePlacement = function() {
  1501.         this.resetLayout();
  1502.         _Window_ChoiceList_updatePlacement.apply(this, arguments);
  1503.         if (this.isPopup()) this.updatePlacementPopup();
  1504.     };

  1505.     var _Window_ChoiceList_refresh      = Window_ChoiceList.prototype.refresh;
  1506.     Window_ChoiceList.prototype.refresh = function() {
  1507.         this.resetLayout();
  1508.         _Window_ChoiceList_refresh.apply(this, arguments);
  1509.     };

  1510.     Window_ChoiceList.prototype.isPopup = function() {
  1511.         return this._messageWindow.isPopup() && this._messageWindow.isOpen();
  1512.     };

  1513.     var _Window_ChoiceList_numVisibleRows      = Window_ChoiceList.prototype.numVisibleRows;
  1514.     Window_ChoiceList.prototype.numVisibleRows = function() {
  1515.         var result = _Window_ChoiceList_numVisibleRows.apply(this, arguments);
  1516.         if (this.isPopupLinkage()) {
  1517.             result = Math.min($gameMessage.choices().length, 8);
  1518.         }
  1519.         return result;
  1520.     };

  1521.     //=============================================================================
  1522.     // Window_NumberInput
  1523.     //  ポップアップする場合、メッセージウィンドウに連動して表示位置と余白を調整します。
  1524.     //=============================================================================
  1525.     var _Window_NumberInput_standardFontSize      = Window_NumberInput.prototype.standardFontSize;
  1526.     Window_NumberInput.prototype.standardFontSize = function() {
  1527.         return this.isPopupLinkage() ? paramFontSize : _Window_NumberInput_standardFontSize.apply(this, arguments);
  1528.     };

  1529.     var _Window_NumberInput_standardPadding      = Window_NumberInput.prototype.standardPadding;
  1530.     Window_NumberInput.prototype.standardPadding = function() {
  1531.         return this.isPopupLinkage() ? paramPadding : _Window_NumberInput_standardPadding.apply(this, arguments);
  1532.     };

  1533.     var _Window_NumberInput_lineHeight      = Window_NumberInput.prototype.lineHeight;
  1534.     Window_NumberInput.prototype.lineHeight = function() {
  1535.         return this.isPopupLinkage() ? paramFontSize + 8 : _Window_NumberInput_lineHeight.apply(this, arguments);
  1536.     };

  1537.     var _Window_NumberInput_updatePlacement      = Window_NumberInput.prototype.updatePlacement;
  1538.     Window_NumberInput.prototype.updatePlacement = function() {
  1539.         this.resetLayout();
  1540.         this.opacity = 255;
  1541.         _Window_NumberInput_updatePlacement.apply(this, arguments);
  1542.         if (this.isPopup()) this.updatePlacementPopup();
  1543.     };

  1544.     Window_NumberInput.prototype.isPopup = function() {
  1545.         return this._messageWindow.isPopup() && this._messageWindow.isOpen();
  1546.     };

  1547.     // Resolve conflict for KMS_DebugUtil.js
  1548.     if (isExistPlugin('KMS_DebugUtil')) {
  1549.         Window_NumberInput.prototype.isPopup = function() {
  1550.             return this._messageWindow && this._messageWindow.isPopup() && this._messageWindow.isOpen();
  1551.         };
  1552.     }

  1553.     //=============================================================================
  1554.     // Window_NameBox
  1555.     //  メッセージウィンドウに連動して表示位置と余白を調整します。
  1556.     //=============================================================================
  1557.     if (typeof Window_NameBox !== 'undefined') {
  1558.         var _Window_NameBox_standardFontSize      = Window_NameBox.prototype.standardFontSize;
  1559.         Window_NameBox.prototype.standardFontSize = function() {
  1560.             return this.isPopupLinkage() ? paramFontSize : _Window_NameBox_standardFontSize.apply(this, arguments);
  1561.         };

  1562.         var _Window_NameBox_standardPadding      = Window_NameBox.prototype.standardPadding;
  1563.         Window_NameBox.prototype.standardPadding = function() {
  1564.             return this.isPopupLinkage() ? paramPadding : _Window_NameBox_standardPadding.apply(this, arguments);
  1565.         };

  1566.         var _Window_NameBox_lineHeight      = Window_NameBox.prototype.lineHeight;
  1567.         Window_NameBox.prototype.lineHeight = function() {
  1568.             return this.isPopupLinkage() ? paramFontSize + 8 : _Window_NameBox_lineHeight.apply(this, arguments);
  1569.         };

  1570.         var _Window_NameBox_updatePlacement      = Window_NameBox.prototype.updatePlacement;
  1571.         Window_NameBox.prototype.updatePlacement = function() {
  1572.             this.resetLayout();
  1573.             _Window_NameBox_updatePlacement.apply(this, arguments);
  1574.             if (this.isPopup()) this.updatePlacementPopup();
  1575.         };

  1576.         var _Window_NameBox_refresh      = Window_NameBox.prototype.refresh;
  1577.         Window_NameBox.prototype.refresh = function() {
  1578.             this.resetLayout();
  1579.             return _Window_NameBox_refresh.apply(this, arguments);
  1580.         };

  1581.         Window_NameBox.prototype.isPopup = function() {
  1582.             return this._parentWindow.isPopup();
  1583.         };

  1584.         Window_NameBox.prototype.updatePlacementPopup = function() {
  1585.             this.x = this._parentWindow.x;
  1586.             this.y = this._parentWindow.y - this.height;
  1587.         };
  1588.     }

  1589.     //=============================================================================
  1590.     // ウィンドウを透過して重なり合ったときの表示を自然にします。
  1591.     //=============================================================================
  1592.     if (paramThroughWindow && !WindowLayer.throughWindow) {
  1593.         WindowLayer.throughWindow = true;
  1594.         //=============================================================================
  1595.         //  WindowLayer
  1596.         //   ウィンドウのマスク処理を除去します。
  1597.         //=============================================================================
  1598.         WindowLayer.prototype._maskWindow = function(window) {};

  1599.         WindowLayer.prototype._canvasClearWindowRect = function(renderSession, window) {};
  1600.     }

  1601.     //=============================================================================
  1602.     // FTKR_ExMessageWindow2.js の修正
  1603.     //=============================================================================
  1604.     if (imported_FTKR_EMW()) {

  1605.         //------------------------------------------------------------------------
  1606.         //Game_System
  1607.         //フキダシウィンドウの有効無効フラグをウィンドウID毎に保持
  1608.         //------------------------------------------------------------------------
  1609.         var _EMW_Game_System_initialize  = Game_System.prototype.initialize;
  1610.         Game_System.prototype.initialize = function() {
  1611.             _EMW_Game_System_initialize.apply(this, arguments);
  1612.             this._messagePopupCharacterIds = [];
  1613.         };

  1614.         Game_System.prototype.setMessagePopupEx = function(windowId, eventId) {
  1615.             this._messagePopupCharacterIds[windowId] = eventId;
  1616.         };

  1617.         var _EMW_Game_System_clearMessagePopup  = Game_System.prototype.clearMessagePopup;
  1618.         Game_System.prototype.clearMessagePopup = function() {
  1619.             _EMW_Game_System_clearMessagePopup.apply(this, arguments);
  1620.             this._messagePopupCharacterIds.forEach(function(id, i) {
  1621.                 this.clearMessagePopupEx(i);
  1622.             }, this);
  1623.         };

  1624.         Game_System.prototype.clearMessagePopupEx = function(windowId) {
  1625.             this._messagePopupCharacterIds[windowId] = 0;
  1626.         };

  1627.         Game_System.prototype.getMessagePopupIdEx = function(windowId) {
  1628.             windowId = windowId || 0;
  1629.             return this._messagePopupCharacterIds[windowId] !== 0 ? this._messagePopupCharacterIds[windowId] : null;
  1630.         };

  1631.         //------------------------------------------------------------------------
  1632.         //Scene_Map
  1633.         //場所移動時にすべてのウィンドウIDのフキダシ無効化
  1634.         //------------------------------------------------------------------------
  1635.         var _EMW_Scene_Map_terminate  = Scene_Map.prototype.terminate;
  1636.         Scene_Map.prototype.terminate = function() {
  1637.             _EMW_Scene_Map_terminate.call(this);
  1638.             if (SceneManager.isNextScene(Scene_Map)) {
  1639.                 $gameSystem.clearMessagePopup();
  1640.             }
  1641.         };

  1642.         //------------------------------------------------------------------------
  1643.         //Window_MessageEx
  1644.         //------------------------------------------------------------------------
  1645.         var _Window_MessageEx_startMessage      = Window_MessageEx.prototype.startMessage;
  1646.         Window_MessageEx.prototype.startMessage = function() {
  1647.             this.updateTargetCharacterId();
  1648.             this.loadWindowskin();
  1649.             _Window_MessageEx_startMessage.apply(this, arguments);
  1650.             this.resetLayout();
  1651.         };

  1652.         var _Window_MessageEx_updatePlacement      = Window_MessageEx.prototype.updatePlacement;
  1653.         Window_MessageEx.prototype.updatePlacement = function() {
  1654.             if (typeof Yanfly === 'undefined' || !Yanfly.Message) {
  1655.                 this.x = 0;
  1656.             }
  1657.             _Window_MessageEx_updatePlacement.apply(this, arguments);
  1658.             if (!this.isPopup()) {
  1659.                 return;
  1660.             }
  1661.             this.updatePlacementPopup();
  1662.         };

  1663.         Window_MessageEx.prototype.updateTargetCharacterId = function() {
  1664.             var id                  = $gameSystem.getMessagePopupIdEx(this._windowId);
  1665.             this._targetCharacterId = $gameSystem.getMessagePopupIdEx(this._windowId);
  1666.         };

  1667.         Window_MessageEx.prototype.updatePlacementPopup = function() {
  1668.             this.setPopupPosition(this.getPopupTargetCharacter());
  1669.             if (this._choiceWindow && this._gameMessage.isChoice()) {
  1670.                 this._choiceWindow.updatePlacementPopup();
  1671.             }
  1672.             this._numberWindow.updatePlacementPopup();
  1673.             if (this._nameWindow && checkTypeFunction(this._nameWindow.updatePlacementPopup)) {
  1674.                 this._nameWindow.updatePlacementPopup();
  1675.             }
  1676.         };

  1677.         Window_MessageEx.prototype.processVirtual = function() {
  1678.             var virtual      = {};
  1679.             virtual.index    = 0;
  1680.             virtual.text     = this.convertEscapeCharacters(this._gameMessage.allText());
  1681.             virtual.maxWidth = 0;
  1682.             this.newPage(virtual);
  1683.             while (!this.isEndOfText(virtual)) {
  1684.                 this.processVirtualCharacter(virtual);
  1685.             }
  1686.             virtual.y += virtual.height;
  1687.             this._subWindowY = virtual.y;
  1688.             var choices      = this._gameMessage.choices();
  1689.             if (choices && $gameSystem.getPopupSubWindowPosition() === 2) {
  1690.                 virtual.y += choices.length * this._choiceWindow.lineHeight();
  1691.                 virtual.maxWidth = Math.max(virtual.maxWidth, this.newLineX() + this._choiceWindow.maxChoiceWidth());
  1692.             }
  1693.             var digit = this._gameMessage.numInputMaxDigits();
  1694.             if (digit && $gameSystem.getPopupSubWindowPosition() === 2) {
  1695.                 virtual.y += this._numberWindow.lineHeight();
  1696.             }
  1697.             var width  = virtual.maxWidth + this.padding * 2;
  1698.             var height = Math.max(this.getFaceHeight(), virtual.y) + this.padding * 2;
  1699.             var adjust = $gameSystem.getPopupAdjustSize();
  1700.             if (adjust) {
  1701.                 width += adjust[0];
  1702.                 height += adjust[1];
  1703.             }
  1704.             if (this.isUsePauseSignTextEnd()) {
  1705.                 width += this._windowPauseSignSprite.width;
  1706.             } else if (paramNoUseTail) {
  1707.                 height += 8;
  1708.             }
  1709.             this.width  = width;
  1710.             this.height = height;
  1711.             this.resetFontSettings();
  1712.         };

  1713.         var _Window_MessageEx_newLineX      = Window_MessageEx.prototype.newLineX;
  1714.         Window_MessageEx.prototype.newLineX = function() {
  1715.             if (this.isPopup()) {
  1716.                 return this._gameMessage.faceName() === '' ? 0 : Window_Message._faceWidth + 8;
  1717.             } else {
  1718.                 return _Window_MessageEx_newLineX.apply(this, arguments);
  1719.             }
  1720.         };

  1721.         Window_MessageEx.prototype.getFaceHeight = function() {
  1722.             return this._gameMessage.faceName() === '' ? 0 : Window_Message._faceHeight;
  1723.         };

  1724.         //------------------------------------------------------------------------
  1725.         //Window_ChoiceListEx
  1726.         //------------------------------------------------------------------------
  1727.         var _Window_ChoiceListEx_numVisibleRows      = Window_ChoiceListEx.prototype.numVisibleRows;
  1728.         Window_ChoiceListEx.prototype.numVisibleRows = function() {
  1729.             var result = _Window_ChoiceListEx_numVisibleRows.apply(this, arguments);
  1730.             if (this.isPopupLinkage()) {
  1731.                 result = Math.min(this._gameMessage.choices().length, 8);
  1732.             }
  1733.             return result;
  1734.         };

  1735.         var _Window_ChoiceListEx_updatePlacement      = Window_ChoiceListEx.prototype.updatePlacement;
  1736.         Window_ChoiceListEx.prototype.updatePlacement = function() {
  1737.             this.resetLayout();
  1738.             _Window_ChoiceListEx_updatePlacement.apply(this, arguments);
  1739.             if (this.isPopup()) this.updatePlacementPopup();
  1740.         };

  1741.         //------------------------------------------------------------------------
  1742.         //Window_NumberInputEx
  1743.         //------------------------------------------------------------------------
  1744.         var _Window_NumberInputEx_updatePlacement      = Window_NumberInputEx.prototype.updatePlacement;
  1745.         Window_NumberInputEx.prototype.updatePlacement = function() {
  1746.             this.resetLayout();
  1747.             this.opacity = 255;
  1748.             _Window_NumberInputEx_updatePlacement.apply(this, arguments);
  1749.             if (this.isPopup()) this.updatePlacementPopup();
  1750.         };

  1751.     }//FTKR_ExMessageWindow2
  1752. })();

复制代码






老鹰

梦石
40
星屑
37812
在线时间
7091 小时
注册时间
2012-5-26
回帖
3297

极短24评委极短23参与极短22参与极短21评委老司机慢点开短篇十吟唱者组别冠军开拓者剧作品鉴家

发表于 2020-11-13 23:02:28 | 显示全部楼层
如果有做这类特效型对话框的,请务必通知我
可以互相交流()

评分

参与人数 2赞 +2 收起 理由
白嫩白嫩的 + 1 炸出大佬666
火锅深处 + 1 本尊出现可还行2333

查看全部评分

回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部