查看: 5440|回复: 9

[有事请教] 有没有和yep兼容的气泡对话框

[复制链接]
梦石
0
星屑
332
在线时间
71 小时
注册时间
2020-1-22
回帖
21
发表于 2020-6-13 19:56:22 | 显示全部楼层 |阅读模式

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

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

×
我用了论坛里一位大佬的VIPArcher_Bubble_Message,结果应该是和yep消息核心出现冲突了,气泡框的位置和大小都很奇怪,但又没办法舍弃消息核心,所以想问问有人解决过这个问题吗
梦石
0
星屑
22879
在线时间
8598 小时
注册时间
2011-12-31
回帖
3270
发表于 2020-6-13 20:42:46 | 显示全部楼层
回复

使用道具 举报

梦石
0
星屑
332
在线时间
71 小时
注册时间
2020-1-22
回帖
21
 楼主| 发表于 2020-6-13 22:37:31 | 显示全部楼层
tseyik 发表于 2020-6-13 20:42
トリアコンタン
@triacontane的
https://docs.google.com/spreadsheets/d/1BnTyJr3Z1WoW4FMKtvKaICl4SQ5ehL ...

请问大佬有资源吗,这两个网站我都登不上_(:з」∠)_
回复

使用道具 举报

梦石
0
星屑
22879
在线时间
8598 小时
注册时间
2011-12-31
回帖
3270
发表于 2020-6-13 22:51:57 | 显示全部楼层
MessageWindowPopup.js
  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.9 2019/12/27 StandPictureEC.jsおよびMessageAlignmentEC.jsと組み合わせた場合に発生する競合を修正
  10. // 2.14.8 2019/12/27 2.14.7の修正で一部制御文字を使用するとウィンドウ幅の計算が正しく行われない問題を修正
  11. // 2.14.7 2019/12/22 不明な制御文字が挿入されたとき、ウィンドウの横幅が拡張されないよう修正
  12. //                   StandPictureEC.jsでピクチャを表示したとき、初回のみポップアップウィンドウの座標が反映されない競合を修正
  13. // 2.14.6 2019/12/07 YEP_MessageCore.jsでネームボックスを表示する際、同プラグインの位置調整が反映されない競合を修正
  14. // 2.14.5 2019/07/21 YEP_MessageCore.jsでネームボックスを表示する際、特定の条件下で一瞬だけネームボックスが不正な位置に表示される問題を修正
  15. // 2.14.4 2019/06/23 フキダシウィンドウを無効化したときのX座標の値をデフォルトのコアスクリプトの動作に準拠するよう修正
  16. // 2.14.3 2019/06/18 MKR_MessageWindowCustom.jsとの連携で、フキダシウィンドウ有効時はフキダシの横幅と高さを優先するよう変更
  17. // 2.14.2 2019/06/16 FTKR_ExMessageWindow2.jsおよびPauseSignToTextEnd.jsとの連携で、フキダシウィンドウ表示時にポーズサインがはみ出してしまう競合を修正
  18. // 2.14.1 2019/06/16 2.14.0で追加したテール画像がフキダシウィンドウ無効のときも表示されていた問題を修正
  19. // 2.14.0 2019/06/10 テール画像を別途指定できる機能を追加
  20. // 2.13.0 2019/05/26 PauseSignToTextEnd.jsと完全に組み合わせて使用できるよう修正
  21. // 2.12.2 2019/04/14 フキダシウィンドウをキャラクター下に表示した際、Y座標の位置調整が効かなくなる問題を修正
  22. // 2.12.1 2019/02/07 GraphicalDesignMode.jsと併用し、かつフキダシウィンドウ無効時、カスタマイズしたウィンドウの横幅が反映されるよう修正
  23. // 2.12.0 2019/10/21 フキダシウィンドウの表示位置の上限と下限を設定できる機能を追加
  24. //                   フキダシウィンドウを画面上の任意の位置に表示できる機能を追加
  25. // 2.11.2 2018/11/26 ポップアップ用のウィンドウスキン設定後、ポップアップを解除してもスキンがそのままになってしまう場合がある問題を修正
  26. // 2.11.1 2018/11/26 MPP_MessageEX.jsとの競合を解消(ネームウィンドウの表示不整合)
  27. // 2.11.0 2018/11/11 ポップアップウィンドウの横幅と高さの最小値を変数から取得できる機能を追加
  28. // 2.10.2 2018/11/07 ポップアップ用のウィンドウスキン設定後、メニューを開くか場所移動すると設定が戻ってしまう問題を修正
  29. // 2.10.1 2018/06/15 ウィンドウ連携が有効かつ、フキダシウィンドウを1回も表示していない場合に選択肢ウィンドウが見えなくなる問題を修正
  30. // 2.10.0 2018/05/20 ポーズサインのテール化機能を使わない設定を追加しました。
  31. // 2.9.8 2018/03/19 プラグインを未適用の状態でセーブしたデータをロードするとエラーになる現象を修正
  32. // 2.9.7 2018/01/30 BetweenCharacters.jsとの競合を解消
  33. // 2.9.6 2018/01/15 MPP_MessageEX.jsとの競合を解消、パラメータの型指定誤りを修正、2.9.1の修正の取り込みが一部間違っていた問題を修正
  34. // 2.9.5 2018/01/12 KMS_DebugUtil.jsとの競合を解消
  35. // 2.9.4 2017/12/21 FTKR_ExMessageWindow2.jsとの連携で、上下にフキダシウィンドウを同時表示できるよう修正
  36. // 2.9.3 2017/12/14 2.9.2の修正で上方向に対する調整が抜けていたのを修正
  37. // 2.9.2 2017/12/10 フキダシ位置のY座標を調整する際にテール画像が表示されるように微調整
  38. // 2.9.1 2017/12/07 フキダシ表示を無効化後、メッセージの表示をする前に選択肢を表示すると位置がおかしくなる問題を修正(by 奏ねこまさん)
  39. // 2.9.0 2017/10/18 AltWindowFrame.jsとの競合を解消してMADOと連携できるようになりました。
  40. // 2.8.1 2017/08/14 ウィンドウの振動時間を設定できる機能を追加
  41. // 2.8.0 2017/08/14 ウィンドウを振動させる機能を追加
  42. //                  パラメータの型指定機能に対応
  43. // 2.7.0 2017/06/24 フキダシ位置を設定する機能で、イベント名で指定できる機能を追加
  44. //                  フキダシ有効化時にウィンドウ位置を設定できる機能を追加
  45. // 2.6.0 2017/06/21 ウィンドウが画面外に出ないように調整するパラメータを追加
  46. //                  フキダシの位置固定をイベントごとに設定できる機能で、イベント名で指定できる機能を追加
  47. // 2.5.1 2017/06/11 DP_MapZoom.js以外のマップズーム機能に対してフキダシ位置が正しく表示されていなかった問題を修正
  48. // 2.5.0 2017/06/05 マップズームに対してフキダシ位置が正しく表示されるよう対応
  49. //                  フキダシの位置固定をイベントごとに設定できる機能を追加
  50. // 2.4.1 2017/05/28 ウィンドウスキンを変更した直後の文字色のみ変更前の文字色になってしまう問題を修正(by 奏ねこまさん)
  51. //                  2行目以降の文字サイズを変更したときにウィンドウの高さが正しく計算されない問題を修正
  52. // 2.4.0 2017/05/16 並列実行のコモンイベントで「MWP_VALID 0」を実行したときに、実行中のマップイベントを対象とするよう修正
  53. // 2.3.2 2017/05/25 「FTKR_ExMessageWindow2.js」の連携機能の修正(byフトコロ)
  54. //                  ウィンドウを閉じた時にフキダシ無効化をする対象を、指定していたウィンドウIDのみに変更
  55. //                  フキダシ無効化コマンドにウィンドウIDを指定する機能追加
  56. //                  場所移動時にすべてのウィンドウIDのフキダシ無効化処理を追加
  57. //                  プラグインパラメータ[自動設定]をOFFに設定した場合、イベント起動時にフキダシ無効化する対象をウィンドウID0だけに変更
  58. // 2.3.1 2017/05/14 「FTKR_ExMessageWindow2.js」の連携機能の修正(byフトコロ)
  59. //                  ポップアップの初期化および、ポップアップ無効時の文章の表示位置の不具合修正
  60. //                  フキダシ有効化コマンドにウィンドウIDを指定する機能追加
  61. // 2.3.0 2017/05/01 フトコロさんの「FTKR_ExMessageWindow2.js」と連携してフキダシを複数表示できる機能を追加(byフトコロさん)
  62. // 2.2.0 2017/04/20 選択肢および数値ウィンドウをテール画像の右側に表示できるプラグインコマンドを追加
  63. // 2.1.0 2017/02/21 フキダシウィンドウ内で制御文字「\{」「\}」を指定したときの上限、下限、増減幅を設定できる機能を追加
  64. // 2.0.5 2017/01/23 ウィンドウスキンを変更しているデータをロード直後にフキダシメッセージを表示すると
  65. //                  文字が黒くなってしまう問題を修正
  66. // 2.0.4 2016/12/25 ウィンドウを閉じている最中にウィンドウ表示位置を変更するプラグインコマンドを実行すると、
  67. //                  一瞬だけ空ウィンドウが表示される問題を修正
  68. // 2.0.3 2016/10/22 デフォルト以外で制御文字と見なされる記述(\aaa[333]や\d<test>)を枠幅の計算から除外するよう修正
  69. // 2.0.2 2016/09/29 キャラクターの位置によってはネームポップが一部見切れてしまう現象を修正
  70. // 2.0.1 2016/08/25 フォントサイズを\{で変更して\}で戻さなかった場合の文字サイズがおかしくなっていた現象を修正
  71. // 2.0.0 2016/08/22 本体v1.3.0によりウィンドウ透過の実装が変更されたので対応
  72. // 1.3.3 2016/07/02 ポップアップ有効時は選択肢の最大表示数が8になるよう修正
  73. // 1.3.2 2016/06/02 YEP_MessageCore.jsとのウィンドウ位置に関する競合を解消
  74. // 1.3.1 2016/05/25 フォロワーにフキダシを表示できる機能を追加
  75. // 1.3.0 2016/03/21 ウィンドウの表示位置をキャラクターの高さに合わせて自動調整するよう修正
  76. //                  ポップアップウィンドウ専用のウィンドウスキンを使用する機能を追加
  77. //                  位置とサイズを微調整する機能を追加
  78. //                  選択肢と数値入力ウィンドウの表示方法を2種類追加
  79. // 1.2.3 2016/02/23 YEP_MessageCore.jsより上に配置した場合に発生するエラーを修正
  80. //                  (正常に動作しない点はそのままです)
  81. // 1.2.2 2016/02/20 YEP_MessageCore.js最新版に対応
  82. // 1.2.1 2016/02/20 YEP_MessageCore.jsのネームポップをポップアップウィンドウと連動するよう対応
  83. // 1.2.0 2016/02/13 並列処理のイベントが存在するときにポップアップ設定がクリアされてしまう
  84. //                  問題の修正
  85. //                  ウィンドウの表示位置を下に表示できる設定を追加
  86. // 1.1.3 2016/02/04 イベント終了時にポップアップ設定をクリアするよう修正
  87. // 1.1.2 2016/01/31 行間を調整できる機能を追加
  88. // 1.1.1 2016/01/30 選択肢と数値入力ウィンドウをポップアップと連携するよう修正
  89. //                  その他微調整と軽微な表示不良修正
  90. // 1.1.0 2016/01/29 高確率で競合するバグを修正
  91. //                  ポップアップウィンドウがキャラクターの移動に追従するよう修正
  92. //                  顔グラフィックが見切れないよう修正
  93. //                  実行中のイベントをポップアップ対象にできる機能を追加(0を指定)
  94. //                  英語対応
  95. // 1.0.0 2016/01/28 初版
  96. // ----------------------------------------------------------------------------
  97. // [Blog]   : https://triacontane.blogspot.jp/
  98. // [Twitter]: https://twitter.com/triacontane/
  99. // [GitHub] : https://github.com/triacontane/
  100. //=============================================================================

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

  547. (function() {
  548.     'use strict';
  549.     var pluginName = 'MessageWindowPopup';

  550.     var checkTypeFunction = function(value) {
  551.         return checkType(value, 'Function');
  552.     };

  553.     var checkType = function(value, typeName) {
  554.         return Object.prototype.toString.call(value).slice(8, -1) === typeName;
  555.     };

  556.     var getParamNumber = function(paramNames, min, max) {
  557.         var value = getParamString(paramNames);
  558.         if (arguments.length < 2) min = -Infinity;
  559.         if (arguments.length < 3) max = Infinity;
  560.         return (parseInt(value) || 0).clamp(min, max);
  561.     };

  562.     var getParamBoolean = function(paramNames) {
  563.         var value = getParamString(paramNames);
  564.         return (value || '').toUpperCase() === 'ON' || (value || '').toUpperCase() === 'TRUE';
  565.     };

  566.     var getParamString = function(paramNames) {
  567.         if (!Array.isArray(paramNames)) paramNames = [paramNames];
  568.         for (var i = 0; i < paramNames.length; i++) {
  569.             var name = PluginManager.parameters(pluginName)[paramNames[i]];
  570.             if (name) return name;
  571.         }
  572.         return null;
  573.     };

  574.     var getArgNumber = function(arg, min, max) {
  575.         if (arguments.length <= 2) min = -Infinity;
  576.         if (arguments.length <= 3) max = Infinity;
  577.         return (parseInt(convertEscapeCharacters(arg)) || 0).clamp(min, max);
  578.     };

  579.     var getArgString = function(arg, upperFlg) {
  580.         arg = convertEscapeCharacters(arg);
  581.         return upperFlg ? arg.toUpperCase() : arg;
  582.     };

  583.     var getCommandName = function(command) {
  584.         return (command || '').toUpperCase();
  585.     };

  586.     var convertEscapeCharacters = function(text) {
  587.         if (text == null) text = '';
  588.         var window = SceneManager._scene._windowLayer.children[0];
  589.         return window ? window.convertEscapeCharacters(text) : text;
  590.     };

  591.     //FTKR_ExMessageWindow2.jsを使用しているか
  592.     var imported_FTKR_EMW = function() {
  593.         return typeof Imported !== 'undefined' && Imported.FTKR_EMW;
  594.     };

  595.     var isExistPlugin = function(pluginName) {
  596.         return Object.keys(PluginManager.parameters(pluginName)).length > 0;
  597.     };

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

  623.     //=============================================================================
  624.     // Game_Interpreter
  625.     //  プラグインコマンドを追加定義します。
  626.     //=============================================================================
  627.     var _Game_Interpreter_pluginCommand      = Game_Interpreter.prototype.pluginCommand;
  628.     Game_Interpreter.prototype.pluginCommand = function(command, args) {
  629.         _Game_Interpreter_pluginCommand.apply(this, arguments);
  630.         this.pluginCommandMessageWindowPopup(command, args);
  631.     };

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

  725.     Game_Interpreter.prototype.getEventIdForMessagePopup = function(arg) {
  726.         var convertedArg = convertEscapeCharacters(arg);
  727.         var eventId      = parseInt(convertedArg);
  728.         if (isNaN(eventId)) {
  729.             return convertedArg;
  730.         }
  731.         if (eventId === 0) {
  732.             eventId = this.eventId() || ($gameMap.isEventRunning() ? $gameMap._interpreter.eventId() : 0);
  733.         }
  734.         return eventId;
  735.     };

  736.     Game_Interpreter.prototype.getEventIdFromEventName = function(eventName) {
  737.         var eventId = 0;
  738.         $gameMap.events().some(function(event) {
  739.             if (event.event().name === eventName) {
  740.                 eventId = event.eventId();
  741.                 return true;
  742.             }
  743.             return false;
  744.         });
  745.         return eventId;
  746.     };

  747.     var _Game_Interpreter_terminate      = Game_Interpreter.prototype.terminate;
  748.     Game_Interpreter.prototype.terminate = function() {
  749.         _Game_Interpreter_terminate.apply(this, arguments);
  750.         if (this._depth === 0 && this.isGameMapInterpreter()) {
  751.             if (imported_FTKR_EMW()) {
  752.                 $gameSystem.clearMessagePopupEx(this.windowId());
  753.             } else {
  754.                 $gameSystem.clearMessagePopup();
  755.             }
  756.         }
  757.     };

  758.     Game_Interpreter.prototype.setGameMapInterpreter = function() {
  759.         this._gameMapInterpreter = true;
  760.     };

  761.     Game_Interpreter.prototype.isGameMapInterpreter = function() {
  762.         return this._gameMapInterpreter;
  763.     };

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

  778.     Game_System.prototype.initMessagePositionEvents = function() {
  779.         if (!this._messagePopupPositionEvents) {
  780.             this._messagePopupPositionEvents = [];
  781.         }
  782.     };

  783.     Game_System.prototype.setPopupSubWindowPosition = function(position) {
  784.         this._messagePopupSubWindowPosition = position.clamp(0, 3);
  785.     };

  786.     Game_System.prototype.getPopupSubWindowPosition = function() {
  787.         return this._messagePopupSubWindowPosition;
  788.     };

  789.     Game_System.prototype.setPopupWindowSkin = function(fileName) {
  790.         this._messagePopupWindowSkin = fileName;
  791.         ImageManager.loadSystem(fileName);
  792.     };

  793.     Game_System.prototype.getPopupWindowSkin = function() {
  794.         return this._messagePopupWindowSkin;
  795.     };

  796.     Game_System.prototype.setMessagePopup = function(id) {
  797.         this._messagePopupCharacterId = id;
  798.     };

  799.     Game_System.prototype.clearMessagePopup = function() {
  800.         this._messagePopupCharacterId    = 0;
  801.         this._messagePopupPositionEvents = [];
  802.     };

  803.     Game_System.prototype.setMessagePopupFree = function(x, y) {
  804.         this._messagePopupFreeX       = x;
  805.         this._messagePopupFreeY       = y;
  806.         this._messagePopupCharacterId = 1;
  807.     };

  808.     Game_System.prototype.clearMessagePopupFree = function() {
  809.         this.setMessagePopupFree(undefined, undefined);
  810.     };

  811.     Game_System.prototype.getMessagePopupId = function() {
  812.         return this._messagePopupCharacterId !== 0 ? this._messagePopupCharacterId : null;
  813.     };

  814.     Game_System.prototype.getMessagePopupFree = function() {
  815.         if (this._messagePopupFreeX === undefined || this._messagePopupFreeY === undefined) {
  816.             return null;
  817.         }
  818.         return {x: this._messagePopupFreeX, y: this._messagePopupFreeY};
  819.     };

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

  823.     Game_System.prototype.setPopupFixLower = function(characterId) {
  824.         this.setPopupFixPosition(characterId, 2);
  825.     };

  826.     Game_System.prototype.setPopupAuto = function(characterId) {
  827.         this.setPopupFixPosition(characterId, 0);
  828.     };

  829.     Game_System.prototype.setPopupFixPosition = function(characterId, position) {
  830.         if (characterId !== null) {
  831.             this.initMessagePositionEvents();
  832.             this._messagePopupPositionEvents[characterId] = position;
  833.         } else {
  834.             this._messagePopupPosition = position;
  835.         }
  836.     };

  837.     Game_System.prototype.setPopupAdjustSize = function(w, h) {
  838.         this._messagePopupAdjustSize = [w, h];
  839.     };

  840.     Game_System.prototype.getPopupAdjustSize = function() {
  841.         return this._messagePopupAdjustSize;
  842.     };

  843.     Game_System.prototype.setPopupAdjustPosition = function(x, y) {
  844.         this._messagePopupAdjustPosition = [x, y];
  845.     };

  846.     Game_System.prototype.getPopupAdjustPosition = function() {
  847.         return this._messagePopupAdjustPosition;
  848.     };

  849.     Game_System.prototype.isPopupFixUpper = function(eventId) {
  850.         return this.isPopupFixPosition(1, eventId);
  851.     };

  852.     Game_System.prototype.isPopupFixLower = function(eventId) {
  853.         return this.isPopupFixPosition(2, eventId);
  854.     };

  855.     Game_System.prototype.isPopupFixPosition = function(position, eventId) {
  856.         var id = eventId || this._messagePopupCharacterId;
  857.         this.initMessagePositionEvents();
  858.         var positionFixForId   = this._messagePopupPositionEvents[id];
  859.         var event              = $gameMap.event(id);
  860.         var positionFixForName = event ? this._messagePopupPositionEvents[event.event().name] : 0;
  861.         if (positionFixForId > 0) {
  862.             return positionFixForId === position;
  863.         } else if (positionFixForName > 0) {
  864.             return positionFixForName === position;
  865.         } else {
  866.             return this._messagePopupPosition === position;
  867.         }
  868.     };

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

  887.     var _Game_Map_setup      = Game_Map.prototype.setup;
  888.     Game_Map.prototype.setup = function(mapId) {
  889.         _Game_Map_setup.apply(this, arguments);
  890.         this._interpreter.setGameMapInterpreter();
  891.     };

  892.     //=============================================================================
  893.     // Game_Troop
  894.     //  戦闘開始時にポップアップフラグを解除します。
  895.     //=============================================================================
  896.     var _Game_Troop_setup      = Game_Troop.prototype.setup;
  897.     Game_Troop.prototype.setup = function(troopId) {
  898.         _Game_Troop_setup.apply(this, arguments);
  899.         $gameSystem.clearMessagePopup();
  900.     };

  901.     //=============================================================================
  902.     // Game_CharacterBase
  903.     //  キャラクターの高さを設定します。
  904.     //=============================================================================
  905.     var _Game_CharacterBase_initMembers      = Game_CharacterBase.prototype.initMembers;
  906.     Game_CharacterBase.prototype.initMembers = function() {
  907.         _Game_CharacterBase_initMembers.apply(this, arguments);
  908.         this.setSizeForMessagePopup(0, 0);
  909.     };

  910.     Game_CharacterBase.prototype.setSizeForMessagePopup = function(width, height) {
  911.         this._size = [width, height];
  912.     };

  913.     Game_CharacterBase.prototype.getHeightForPopup = function() {
  914.         return $gameScreen.zoomScale() * this._size[1];
  915.     };

  916.     Game_CharacterBase.prototype.getRealScreenX = function() {
  917.         return $gameScreen.convertRealX(this.screenX());
  918.     };

  919.     Game_CharacterBase.prototype.getRealScreenY = function() {
  920.         return $gameScreen.convertRealY(this.screenY());
  921.     };

  922.     //=============================================================================
  923.     // Game_Screen
  924.     //  画面座標をズームを考慮した座標に変換します。
  925.     //=============================================================================
  926.     Game_Screen.prototype.convertRealX = function(x) {
  927.         var scale = this.zoomScale();
  928.         return scale * x - (scale - 1.0) * this.zoomX();
  929.     };

  930.     Game_Screen.prototype.convertRealY = function(y) {
  931.         var scale = this.zoomScale();
  932.         return scale * y - (scale - 1.0) * this.zoomY();
  933.     };

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

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

  965.     //=============================================================================
  966.     // Window_Base
  967.     //  共通処理を定義します。
  968.     //=============================================================================
  969.     var _Window_Base_loadWindowskin      = Window_Base.prototype.loadWindowskin;
  970.     Window_Base.prototype.loadWindowskin = function() {
  971.         var popSkin = $gameSystem.getPopupWindowSkin();
  972.         if (this.isPopup() && popSkin) {
  973.             this.windowskin = ImageManager.loadSystem(popSkin);
  974.         } else {
  975.             _Window_Base_loadWindowskin.apply(this, arguments);
  976.         }
  977.     };

  978.     Window_Base.prototype.setPauseSignToTail = function(lowerFlg) {
  979.         if (lowerFlg) {
  980.             this._windowPauseSignSprite.rotation = 180 * Math.PI / 180;
  981.             this._windowPauseSignSprite.y        = 12;
  982.             this._windowPauseSignSprite.anchor.y = 0;
  983.         } else {
  984.             this._windowPauseSignSprite.rotation = 0;
  985.             this._windowPauseSignSprite.y        = this.height + 12;
  986.             this._windowPauseSignSprite.anchor.y = 1;
  987.         }
  988.         this._pauseSignLower  = lowerFlg;
  989.         this._pauseSignToTail = true;
  990.     };

  991.     Window_Base.prototype.setPauseSignImageToTail = function(lowerFlg) {
  992.         this._windowPauseSignSprite.visible = false;
  993.         if (lowerFlg) {
  994.             this._messageTailImage.rotation = 180 * Math.PI / 180;
  995.             this._messageTailImage.y        = -paramTailImageAdjustY;
  996.             this._messageTailImage.anchor.y = 0;
  997.         } else {
  998.             this._messageTailImage.rotation = 0;
  999.             this._messageTailImage.y        = this.height + paramTailImageAdjustY;
  1000.             this._messageTailImage.anchor.y = 0;
  1001.         }
  1002.     };

  1003.     Window_Base.prototype.setPauseSignToNormal = function() {
  1004.         this._windowPauseSignSprite.rotation = 0;
  1005.         this._windowPauseSignSprite.anchor.y = 1.0;
  1006.         this._windowPauseSignSprite.move(this._width / 2, this._height);
  1007.         this._pauseSignToTail = false;
  1008.     };

  1009.     var _Window_Base_updatePauseSign       = Window_Base.prototype._updatePauseSign;
  1010.     Window_Base.prototype._updatePauseSign = function() {
  1011.         _Window_Base_updatePauseSign.apply(this, arguments);
  1012.         if (this._pauseSignToTail) this._windowPauseSignSprite.alpha = 1.0;
  1013.     };

  1014.     Window_Base.prototype.isPopupLower = function() {
  1015.         return $gameSystem.isPopupFixLower() || (!$gameSystem.isPopupFixUpper() && this.y < 0);
  1016.     };

  1017.     Window_Base.prototype.setPopupPosition = function(character) {
  1018.         this._popupCharacter = character;
  1019.         this._popupFreePos   = $gameSystem.getMessagePopupFree();
  1020.         this.setPopupBasePosition();
  1021.         this.setPopupLowerPosition();
  1022.         this.setPopupAdjustInnerScreen();
  1023.         if (this._shakePower > 0) {
  1024.             this.setPopupShakePosition();
  1025.         }
  1026.     };

  1027.     Window_Base.prototype.getPopupBaseX = function() {
  1028.         return this._popupFreePos ? this._popupFreePos.x : this._popupCharacter.getRealScreenX();
  1029.     };

  1030.     Window_Base.prototype.getPopupBaseY = function() {
  1031.         return this._popupFreePos ? this._popupFreePos.y : this._popupCharacter.getRealScreenY();
  1032.     };

  1033.     Window_Base.prototype.getHeightForPopup = function() {
  1034.         return this._popupFreePos ? 0 : (this._popupCharacter.getHeightForPopup() + 8);
  1035.     };

  1036.     Window_Base.prototype.setPopupBasePosition = function() {
  1037.         var pos = $gameSystem.getPopupAdjustPosition();
  1038.         this.x  = this.getPopupBaseX() - this.width / 2 + (pos ? pos[0] : 0);
  1039.         this.y  = this.getPopupBaseY() - this.height - this.getHeightForPopup() + (pos ? pos[1] : 0);
  1040.     };

  1041.     Window_Base.prototype.setPopupShakePosition = function() {
  1042.         var duration = getArgNumber(paramShakeDuration);
  1043.         if (duration && this._shakeCount > duration) {
  1044.             this.setWindowShake(0);
  1045.         }
  1046.         var speed    = getArgNumber(paramShakeSpeed, 1);
  1047.         var position = Math.sin(this._shakeCount / 10 * speed) * this._shakePower;
  1048.         this.x += position;
  1049.         this._windowPauseSignSprite.x -= position;
  1050.         this._messageTailImage.x -= position;
  1051.         this._shakeCount++;
  1052.     };

  1053.     Window_Base.prototype.setPopupLowerPosition = function() {
  1054.         var lowerFlg = this.isPopupLower();
  1055.         if (lowerFlg) {
  1056.             this.y += this.height + this.getHeightForPopup() + 8;
  1057.         }
  1058.         if (!paramNoUseTail && !this.isUsePauseSignTextEnd()) {
  1059.             this.setPauseSignToTail(lowerFlg);
  1060.         }
  1061.         if (paramTailImage) {
  1062.             this.setPauseSignImageToTail(lowerFlg);
  1063.         }
  1064.     };

  1065.     Window_Base.prototype.setPopupAdjustInnerScreen = function() {
  1066.         if (paramInnerScreen) {
  1067.             this.adjustPopupPositionY();
  1068.         }
  1069.         var adjustResultX = this.adjustPopupPositionX();
  1070.         var tailX = this._width / 2 + adjustResultX;
  1071.         if (!this.isUsePauseSignTextEnd()) {
  1072.             this._windowPauseSignSprite.x = tailX
  1073.         }
  1074.         this._messageTailImage.x = tailX;
  1075.     };

  1076.     Window_Base.prototype.setWindowShake = function(power) {
  1077.         this._shakePower = power;
  1078.         this._shakeCount = 0;
  1079.     };

  1080.     Window_Base.prototype.adjustPopupPositionX = function() {
  1081.         var deltaX = 0;
  1082.         var minX   = paramLowerLimitX || 0;
  1083.         var maxX   = paramUpperLimitX || Graphics.boxWidth;
  1084.         if (this.x < minX) {
  1085.             deltaX = this.x - minX;
  1086.             this.x = minX;
  1087.         }
  1088.         if (this.x + this.width > maxX) {
  1089.             deltaX = this.x + this.width - maxX;
  1090.             this.x = maxX - this.width;
  1091.         }
  1092.         return deltaX;
  1093.     };

  1094.     Window_Base.prototype.adjustPopupPositionY = function() {
  1095.         var minY = (this._pauseSignLower ? this._windowPauseSignSprite.height / 2 : 0);
  1096.         minY += paramLowerLimitY || 0;
  1097.         if (this.y < minY) {
  1098.             this.y = minY;
  1099.         }
  1100.         var maxY = (paramUpperLimitY || Graphics.boxHeight) - this._windowPauseSignSprite.height / 2;
  1101.         if (this.y + this.height > maxY) {
  1102.             this.y = maxY - this.height;
  1103.         }
  1104.     };

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

  1134.     Window_Base.prototype.isPopup = function() {
  1135.         return false;
  1136.     };

  1137.     Window_Base.prototype.isPopupLinkage = function() {
  1138.         return this.isPopup() && paramLinkage;
  1139.     };

  1140.     Window_Base.prototype.resetLayout = function() {
  1141.         this.padding = this.standardPadding();
  1142.         this.width   = this.windowWidth();
  1143.         this.height  = this.windowHeight();
  1144.         this.loadWindowskin();
  1145.         this.setPauseSignToNormal();
  1146.     };

  1147.     var _Window_Base_makeFontBigger      = Window_Base.prototype.makeFontBigger;
  1148.     Window_Base.prototype.makeFontBigger = function() {
  1149.         if (this.isValidFontRangeForPopup()) {
  1150.             if (this.contents.fontSize <= paramFontUpperLimit) {
  1151.                 this.contents.fontSize += paramFontSizeRange;
  1152.             }
  1153.         } else {
  1154.             _Window_Base_makeFontBigger.apply(this, arguments);
  1155.         }
  1156.     };

  1157.     var _Window_Base_makeFontSmaller      = Window_Base.prototype.makeFontSmaller;
  1158.     Window_Base.prototype.makeFontSmaller = function() {
  1159.         if (this.isValidFontRangeForPopup()) {
  1160.             if (this.contents.fontSize >= paramFontLowerLimit) {
  1161.                 this.contents.fontSize -= paramFontSizeRange;
  1162.             }
  1163.         } else {
  1164.             _Window_Base_makeFontSmaller.apply(this, arguments);
  1165.         }
  1166.     };

  1167.     Window_Base.prototype.isValidFontRangeForPopup = function() {
  1168.         return this.isPopup() && paramFontSizeRange > 0;
  1169.     };

  1170.     Window_Base.prototype.isUsePauseSignTextEnd = function() {
  1171.         return this.isValidPauseSignTextEnd && this.isValidPauseSignTextEnd()
  1172.     };

  1173.     //=============================================================================
  1174.     // Window_Message
  1175.     //  ポップアップする場合、表示内容により座標とサイズを自動設定します。
  1176.     //=============================================================================
  1177.     Window_Message._faceHeight = Math.floor(Window_Base._faceHeight * paramFaceScale / 100);
  1178.     Window_Message._faceWidth  = Math.floor(Window_Base._faceWidth * paramFaceScale / 100);

  1179.     var _Window_Message__createAllParts = Window_Message.prototype._createAllParts;
  1180.     Window_Message.prototype._createAllParts = function() {
  1181.         _Window_Message__createAllParts.apply(this, arguments);
  1182.         this._messageTailImage = new Sprite();
  1183.         if (paramTailImage) {
  1184.             this._messageTailImage.bitmap   = ImageManager.loadSystem(paramTailImage);
  1185.             this._messageTailImage.visible  = false;
  1186.             this._messageTailImage.anchor.x = 0.5;
  1187.             this.addChild(this._messageTailImage);
  1188.         }
  1189.     };

  1190.     var _Window_Message_standardFontSize      = Window_Message.prototype.standardFontSize;
  1191.     Window_Message.prototype.standardFontSize = function() {
  1192.         return this.isPopup() ? paramFontSize : _Window_Message_standardFontSize.apply(this, arguments);
  1193.     };

  1194.     var _Window_Message_standardPadding      = Window_Message.prototype.standardPadding;
  1195.     Window_Message.prototype.standardPadding = function() {
  1196.         return this.isPopup() ? paramPadding : _Window_Message_standardPadding.apply(this, arguments);
  1197.     };

  1198.     var _Window_Message_calcTextHeight      = Window_Message.prototype.calcTextHeight;
  1199.     Window_Message.prototype.calcTextHeight = function(textState, all) {
  1200.         var height = _Window_Message_calcTextHeight.apply(this, arguments);
  1201.         return this.isPopup() ? height - 8 + paramBetweenLines : height;
  1202.     };

  1203.     var _Window_Message_startMessage      = Window_Message.prototype.startMessage;
  1204.     Window_Message.prototype.startMessage = function() {
  1205.         this.updateTargetCharacterId();
  1206.         this.loadWindowskin();
  1207.         // Resolve conflict for MPP_MessageEX
  1208.         if (isExistPlugin('MPP_MessageEX')) {
  1209.             this.width = this.windowWidth();
  1210.         }
  1211.         // Resolve conflict for StandPictureEC
  1212.         if (typeof Imported !== 'undefined' && Imported['StandPictureEC']) {
  1213.             this._textState = {};
  1214.             this._textState.index = 0;
  1215.             this._textState.text = '';
  1216.             this.resetLayout();
  1217.         }
  1218.         _Window_Message_startMessage.apply(this, arguments);
  1219.         this.resetLayout();
  1220.     };

  1221.     var _Window_Message_loadWindowskin      = Window_Message.prototype.loadWindowskin;
  1222.     Window_Message.prototype.loadWindowskin = function() {
  1223.         var popupWindowSkin = $gameSystem.getPopupWindowSkin();
  1224.         if (this._windowSkinName !== popupWindowSkin || !popupWindowSkin) {
  1225.             if (this.isPopup()) {
  1226.                 this._windowSkinName = popupWindowSkin;
  1227.             }
  1228.         }
  1229.         _Window_Message_loadWindowskin.apply(this, arguments);
  1230.     };

  1231.     Window_Message.prototype.updateTargetCharacterId = function() {
  1232.         this._targetCharacterId = $gameSystem.getMessagePopupId();
  1233.     };

  1234.     var _Window_Message_resetFontSettings      = Window_Message.prototype.resetFontSettings;
  1235.     Window_Message.prototype.resetFontSettings = function() {
  1236.         _Window_Message_resetFontSettings.apply(this, arguments);
  1237.         if (this.isPopup()) this.contents.fontSize = paramFontSize;
  1238.     };

  1239.     Window_Message.prototype.getPopupTargetCharacter = function() {
  1240.         var id = this._targetCharacterId;
  1241.         if (id < -1) {
  1242.             return $gamePlayer.followers().follower((id * -1) - 2);
  1243.         } else if (id === -1) {
  1244.             return $gamePlayer;
  1245.         } else if (id > -1) {
  1246.             return $gameMap.event(id);
  1247.         } else {
  1248.             return null;
  1249.         }
  1250.     };

  1251.     Window_Message.prototype.isPopup = function() {
  1252.         return !!this.getPopupTargetCharacter();
  1253.     };

  1254.     var _Window_Message_update      = Window_Message.prototype.update;
  1255.     Window_Message.prototype.update = function() {
  1256.         _Window_Message_update.apply(this, arguments);
  1257.         this.updatePlacementPopupIfNeed();
  1258.     };

  1259.     Window_Message.prototype.updatePlacementPopupIfNeed = function() {
  1260.         var prevX = this.x;
  1261.         var prevY = this.y;
  1262.         if (this.openness > 0 && this.isPopup()) {
  1263.             this.updatePlacementPopup();
  1264.         }
  1265.         if ((prevX !== this.x || prevY !== this.y) && this.isClosing()) {
  1266.             this.openness = 0;
  1267.         }
  1268.     };

  1269.     var _Window_Message_updatePlacement      = Window_Message.prototype.updatePlacement;
  1270.     Window_Message.prototype.updatePlacement = function() {
  1271.         if (typeof Yanfly === 'undefined' || !Yanfly.Message) {
  1272.             var width = this.windowWidth();
  1273.             this.x = (Graphics.boxWidth - width) / 2;
  1274.         }
  1275.         _Window_Message_updatePlacement.apply(this, arguments);
  1276.         if (!this.isPopup()) {
  1277.             if (this._positionLock) {
  1278.                 this.loadContainerInfo();
  1279.             }
  1280.             return;
  1281.         }
  1282.         this.updatePlacementPopup();
  1283.         // Resolve conflict for MKR_MessageWindowCustom.js
  1284.         if (isExistPlugin('MKR_MessageWindowCustom')) {
  1285.             this.processVirtual();
  1286.         }
  1287.     };

  1288.     var _Window_Message__updatePauseSign = Window_Message.prototype.hasOwnProperty('_updatePauseSign') ?
  1289.         Window_Message.prototype._updatePauseSign : null;
  1290.     Window_Message.prototype._updatePauseSign = function() {
  1291.         if (_Window_Message__updatePauseSign) {
  1292.             _Window_Message__updatePauseSign.apply(this, arguments);
  1293.         } else {
  1294.             Window_Base.prototype._updatePauseSign.apply(this, arguments);
  1295.         }
  1296.         this.updateTailImage();
  1297.     };

  1298.     Window_Message.prototype.isPopupLower = function() {
  1299.         var id = this._targetCharacterId;
  1300.         return $gameSystem.isPopupFixLower(id) || (!$gameSystem.isPopupFixUpper(id) && this.getWindowTopY() < 0);
  1301.     };

  1302.     Window_Message.prototype.getWindowTopY = function() {
  1303.         return this.y - (this._nameWindow && this._nameWindow.visible ? this._nameWindow.height : 0);
  1304.     };

  1305.     Window_Message.prototype.updatePlacementPopup = function() {
  1306.         this.setPopupPosition(this.getPopupTargetCharacter());
  1307.         if (this._choiceWindow && $gameMessage.isChoice()) {
  1308.             this._choiceWindow.updatePlacementPopup();
  1309.         }
  1310.         this._numberWindow.updatePlacementPopup();
  1311.         // Resolve conflict for YEP_MessageCore.js and MPP_MessageEX.js
  1312.         if (this._nameWindow && checkTypeFunction(this._nameWindow.updatePlacementPopup)) {
  1313.             this._nameWindow.updatePlacementPopup();
  1314.             if (isExistPlugin('MPP_MessageEX')) {
  1315.                 this._nameWindow.y = this.y - this._nameWindow.height;
  1316.                 this._nameWindow.x = this.x;
  1317.             }
  1318.         }
  1319.     };

  1320.     Window_Message.prototype.updateTailImage = function() {
  1321.         if (!this.isPopup()) {
  1322.             this._messageTailImage.visible = false;
  1323.         } else if (paramTailImage) {
  1324.             this._messageTailImage.visible = this.isOpen();
  1325.             if (!this.isUsePauseSignTextEnd() && !paramNoUseTail) {
  1326.                 this._windowPauseSignSprite.visible = false;
  1327.             }
  1328.         }
  1329.     };

  1330.     Window_Message.prototype.resetLayout = function() {
  1331.         this.padding = this.standardPadding();
  1332.         if (this.getPopupTargetCharacter()) {
  1333.             this.processVirtual();
  1334.         } else {
  1335.             this.width  = this.windowWidth();
  1336.             this.height = this.windowHeight();
  1337.             this.setPauseSignToNormal();
  1338.         }
  1339.         this.updatePlacement();
  1340.         this.updateBackground();
  1341.     };

  1342.     Window_Message.prototype.processVirtual = function() {
  1343.         var virtual      = {};
  1344.         virtual.index    = 0;
  1345.         virtual.text     = this.convertEscapeCharacters($gameMessage.allText());
  1346.         var defaultEscapeList = ['C', 'I', '{', '}'];
  1347.         virtual.text     = virtual.text.replace(/\x1b(\w+)\[.*]/gi, function(text) {
  1348.             return defaultEscapeList.contains(arguments[1].toUpperCase()) ? text : '';
  1349.         });
  1350.         virtual.maxWidth = 0;
  1351.         this.newPage(virtual);
  1352.         while (!this.isEndOfText(virtual)) {
  1353.             this.processVirtualCharacter(virtual);
  1354.         }
  1355.         virtual.y += virtual.height;
  1356.         this._subWindowY = virtual.y;
  1357.         var choices      = $gameMessage.choices();
  1358.         if (choices && $gameSystem.getPopupSubWindowPosition() === 2) {
  1359.             virtual.y += choices.length * this._choiceWindow.lineHeight();
  1360.             virtual.maxWidth = Math.max(virtual.maxWidth, this.newLineX() + this._choiceWindow.maxChoiceWidth());
  1361.         }
  1362.         var digit = $gameMessage.numInputMaxDigits();
  1363.         if (digit && $gameSystem.getPopupSubWindowPosition() === 2) {
  1364.             virtual.y += this._numberWindow.lineHeight();
  1365.         }
  1366.         var width  = virtual.maxWidth + this.padding * 2;
  1367.         var height = Math.max(this.getFaceHeight(), virtual.y) + this.padding * 2;
  1368.         var adjust = $gameSystem.getPopupAdjustSize();
  1369.         if (adjust) {
  1370.             width += adjust[0];
  1371.             height += adjust[1];
  1372.         }
  1373.         if (this.isUsePauseSignTextEnd()) {
  1374.             width += this._windowPauseSignSprite.width;
  1375.         } else if (paramNoUseTail) {
  1376.             height += 8;
  1377.         }
  1378.         this.width  = Math.max(width, this.getMinimumWidth());
  1379.         this.height = Math.max(height, this.getMinimumHeight());
  1380.         this.resetFontSettings();
  1381.     };

  1382.     Window_Message.prototype.getMinimumWidth = function() {
  1383.         return $gameVariables.value(paramMinWidthVariableId);
  1384.     };

  1385.     Window_Message.prototype.getMinimumHeight = function() {
  1386.         return $gameVariables.value(paramMinHeightVariableId);
  1387.     };

  1388.     Window_Message.prototype.getSubWindowPosition = function() {
  1389.         var pos = new Point();
  1390.         pos.x   = this.x + this.newLineX();
  1391.         pos.y   = this.y + this._subWindowY;
  1392.         return pos;
  1393.     };

  1394.     Window_Message.prototype.processVirtualCharacter = function(textState) {
  1395.         switch (textState.text[textState.index]) {
  1396.             case '\n':
  1397.                 this.processNewLine(textState);
  1398.                 break;
  1399.             case '\f':
  1400.                 this.processNewPage(textState);
  1401.                 break;
  1402.             case '\x1b':
  1403.                 this.processVirtualEscapeCharacter(this.obtainEscapeCode(textState), textState);
  1404.                 break;
  1405.             default:
  1406.                 this.processVirtualNormalCharacter(textState);
  1407.                 break;
  1408.         }
  1409.     };

  1410.     var _Window_Message_processNewLine      = Window_Message.prototype.processNewLine;
  1411.     Window_Message.prototype.processNewLine = function(textState) {
  1412.         if (this.isPopup()) {
  1413.             textState.index++;
  1414.             _Window_Message_processNewLine.apply(this, arguments);
  1415.             textState.index--;
  1416.         } else {
  1417.             _Window_Message_processNewLine.apply(this, arguments);
  1418.         }
  1419.     };

  1420.     Window_Message.prototype.processVirtualEscapeCharacter = function(code, textState) {
  1421.         switch (code) {
  1422.             case 'C':
  1423.                 this.changeTextColor(this.textColor(this.obtainEscapeParam(textState)));
  1424.                 break;
  1425.             case 'I':
  1426.                 this.processVirtualDrawIcon(this.obtainEscapeParam(textState), textState);
  1427.                 break;
  1428.             case '{':
  1429.                 this.makeFontBigger();
  1430.                 break;
  1431.             case '}':
  1432.                 this.makeFontSmaller();
  1433.                 break;
  1434.             default:
  1435.                 this.obtainEscapeParam(textState);
  1436.                 if (this.obtainEscapeString) {
  1437.                     this.obtainEscapeString(textState);
  1438.                 }
  1439.         }
  1440.     };

  1441.     Window_Message.prototype.processVirtualNormalCharacter = function(textState) {
  1442.         var c = textState.text[textState.index++];
  1443.         textState.x += this.textWidth(c);
  1444.         // Resolve conflict for BetweenCharacters.js
  1445.         if (this.getBetweenCharacters) {
  1446.             textState.x += this.getBetweenCharacters();
  1447.         }
  1448.         textState.maxWidth = Math.max(textState.maxWidth, textState.x);
  1449.     };

  1450.     Window_Message.prototype.processVirtualDrawIcon = function(iconIndex, textState) {
  1451.         textState.x += Window_Base._iconWidth + 4;
  1452.         textState.maxWidth = Math.max(textState.maxWidth, textState.x);
  1453.     };

  1454.     var _Window_Message_newLineX      = Window_Message.prototype.newLineX;
  1455.     Window_Message.prototype.newLineX = function() {
  1456.         if (this.isPopup()) {
  1457.             return $gameMessage.faceName() === '' ? 0 : Window_Message._faceWidth + 8;
  1458.         } else {
  1459.             return _Window_Message_newLineX.apply(this, arguments);
  1460.         }
  1461.     };

  1462.     Window_Message.prototype.getFaceHeight = function() {
  1463.         return $gameMessage.faceName() === '' ? 0 : Window_Message._faceHeight;
  1464.     };

  1465.     var _Window_Message_drawFace      = Window_Message.prototype.drawFace;
  1466.     Window_Message.prototype.drawFace = function(faceName, faceIndex, x, y, width, height) {
  1467.         if (this.isPopup()) {
  1468.             width      = width || Window_Base._faceWidth;
  1469.             height     = height || Window_Base._faceHeight;
  1470.             var bitmap = ImageManager.loadFace(faceName);
  1471.             var pw     = Window_Base._faceWidth;
  1472.             var ph     = Window_Base._faceHeight;
  1473.             var sw     = Math.min(width, pw);
  1474.             var sh     = Math.min(height, ph);
  1475.             var dx     = Math.floor(x + Math.max(width - pw, 0) / 2);
  1476.             var dy     = Math.floor(y + Math.max(height - ph, 0) / 2);
  1477.             var sx     = faceIndex % 4 * pw + (pw - sw) / 2;
  1478.             var sy     = Math.floor(faceIndex / 4) * ph + (ph - sh) / 2;
  1479.             this.contents.blt(bitmap, sx, sy, sw, sh, dx, dy, Window_Message._faceWidth, Window_Message._faceHeight);
  1480.         } else {
  1481.             _Window_Message_drawFace.apply(this, arguments);
  1482.         }
  1483.     };

  1484.     var _Window_Message_processEscapeCharacter      = Window_Message.prototype.processEscapeCharacter;
  1485.     Window_Message.prototype.processEscapeCharacter = function(code, textState) {
  1486.         if (code === 'SH') {
  1487.             this.setWindowShake(this.obtainEscapeParam(textState));
  1488.         } else {
  1489.             _Window_Message_processEscapeCharacter.apply(this, arguments);
  1490.         }
  1491.     };

  1492.     var _Window_Message_terminateMessage      = Window_Message.prototype.terminateMessage;
  1493.     Window_Message.prototype.terminateMessage = function() {
  1494.         this.setWindowShake(0);
  1495.         _Window_Message_terminateMessage.apply(this, arguments);
  1496.     };

  1497.     //=============================================================================
  1498.     // Window_ChoiceList
  1499.     //  ポップアップする場合、メッセージウィンドウに連動して表示位置と余白を調整します。
  1500.     //=============================================================================
  1501.     var _Window_ChoiceList_standardFontSize      = Window_ChoiceList.prototype.standardFontSize;
  1502.     Window_ChoiceList.prototype.standardFontSize = function() {
  1503.         return this.isPopupLinkage() ? paramFontSize : _Window_ChoiceList_standardFontSize.apply(this, arguments);
  1504.     };

  1505.     var _Window_ChoiceList_standardPadding      = Window_ChoiceList.prototype.standardPadding;
  1506.     Window_ChoiceList.prototype.standardPadding = function() {
  1507.         return this.isPopupLinkage() ? paramPadding : _Window_ChoiceList_standardPadding.apply(this, arguments);
  1508.     };

  1509.     var _Window_ChoiceList_lineHeight      = Window_ChoiceList.prototype.lineHeight;
  1510.     Window_ChoiceList.prototype.lineHeight = function() {
  1511.         return this.isPopupLinkage() ? paramFontSize + 8 : _Window_ChoiceList_lineHeight.apply(this, arguments);
  1512.     };

  1513.     var _Window_ChoiceList_start      = Window_ChoiceList.prototype.start;
  1514.     Window_ChoiceList.prototype.start = function() {
  1515.         this._messageWindow.updateTargetCharacterId();
  1516.         if (!this.isPopup()) {
  1517.             this._messageWindow.resetLayout();
  1518.         }
  1519.         return _Window_ChoiceList_start.apply(this, arguments);
  1520.     };

  1521.     var _Window_ChoiceList_updatePlacement      = Window_ChoiceList.prototype.updatePlacement;
  1522.     Window_ChoiceList.prototype.updatePlacement = function() {
  1523.         this.resetLayout();
  1524.         _Window_ChoiceList_updatePlacement.apply(this, arguments);
  1525.         if (this.isPopup()) this.updatePlacementPopup();
  1526.     };

  1527.     var _Window_ChoiceList_refresh      = Window_ChoiceList.prototype.refresh;
  1528.     Window_ChoiceList.prototype.refresh = function() {
  1529.         this.resetLayout();
  1530.         _Window_ChoiceList_refresh.apply(this, arguments);
  1531.     };

  1532.     Window_ChoiceList.prototype.isPopup = function() {
  1533.         return this._messageWindow.isPopup() && this._messageWindow.isOpen();
  1534.     };

  1535.     var _Window_ChoiceList_numVisibleRows      = Window_ChoiceList.prototype.numVisibleRows;
  1536.     Window_ChoiceList.prototype.numVisibleRows = function() {
  1537.         var result = _Window_ChoiceList_numVisibleRows.apply(this, arguments);
  1538.         if (this.isPopupLinkage()) {
  1539.             result = Math.min($gameMessage.choices().length, 8);
  1540.         }
  1541.         return result;
  1542.     };

  1543.     //=============================================================================
  1544.     // Window_NumberInput
  1545.     //  ポップアップする場合、メッセージウィンドウに連動して表示位置と余白を調整します。
  1546.     //=============================================================================
  1547.     var _Window_NumberInput_standardFontSize      = Window_NumberInput.prototype.standardFontSize;
  1548.     Window_NumberInput.prototype.standardFontSize = function() {
  1549.         return this.isPopupLinkage() ? paramFontSize : _Window_NumberInput_standardFontSize.apply(this, arguments);
  1550.     };

  1551.     var _Window_NumberInput_standardPadding      = Window_NumberInput.prototype.standardPadding;
  1552.     Window_NumberInput.prototype.standardPadding = function() {
  1553.         return this.isPopupLinkage() ? paramPadding : _Window_NumberInput_standardPadding.apply(this, arguments);
  1554.     };

  1555.     var _Window_NumberInput_lineHeight      = Window_NumberInput.prototype.lineHeight;
  1556.     Window_NumberInput.prototype.lineHeight = function() {
  1557.         return this.isPopupLinkage() ? paramFontSize + 8 : _Window_NumberInput_lineHeight.apply(this, arguments);
  1558.     };

  1559.     var _Window_NumberInput_updatePlacement      = Window_NumberInput.prototype.updatePlacement;
  1560.     Window_NumberInput.prototype.updatePlacement = function() {
  1561.         this.resetLayout();
  1562.         this.opacity = 255;
  1563.         _Window_NumberInput_updatePlacement.apply(this, arguments);
  1564.         if (this.isPopup()) this.updatePlacementPopup();
  1565.     };

  1566.     Window_NumberInput.prototype.isPopup = function() {
  1567.         return this._messageWindow.isPopup() && this._messageWindow.isOpen();
  1568.     };

  1569.     // Resolve conflict for KMS_DebugUtil.js
  1570.     if (isExistPlugin('KMS_DebugUtil')) {
  1571.         Window_NumberInput.prototype.isPopup = function() {
  1572.             return this._messageWindow && this._messageWindow.isPopup() && this._messageWindow.isOpen();
  1573.         };
  1574.     }

  1575.     //=============================================================================
  1576.     // Window_NameBox
  1577.     //  メッセージウィンドウに連動して表示位置と余白を調整します。
  1578.     //=============================================================================
  1579.     if (typeof Window_NameBox !== 'undefined') {
  1580.         var _Window_NameBox_standardFontSize      = Window_NameBox.prototype.standardFontSize;
  1581.         Window_NameBox.prototype.standardFontSize = function() {
  1582.             return this.isPopupLinkage() ? paramFontSize : _Window_NameBox_standardFontSize.apply(this, arguments);
  1583.         };

  1584.         var _Window_NameBox_standardPadding      = Window_NameBox.prototype.standardPadding;
  1585.         Window_NameBox.prototype.standardPadding = function() {
  1586.             return this.isPopupLinkage() ? paramPadding : _Window_NameBox_standardPadding.apply(this, arguments);
  1587.         };

  1588.         var _Window_NameBox_lineHeight      = Window_NameBox.prototype.lineHeight;
  1589.         Window_NameBox.prototype.lineHeight = function() {
  1590.             return this.isPopupLinkage() ? paramFontSize + 8 : _Window_NameBox_lineHeight.apply(this, arguments);
  1591.         };

  1592.         var _Window_NameBox_updatePlacement      = Window_NameBox.prototype.updatePlacement;
  1593.         Window_NameBox.prototype.updatePlacement = function() {
  1594.             this.resetLayout();
  1595.             _Window_NameBox_updatePlacement.apply(this, arguments);
  1596.             if (this.isPopup()) this.updatePlacementPopup();
  1597.         };

  1598.         var _Window_NameBox_refresh      = Window_NameBox.prototype.refresh;
  1599.         Window_NameBox.prototype.refresh = function() {
  1600.             this.resetLayout();
  1601.             return _Window_NameBox_refresh.apply(this, arguments);
  1602.         };

  1603.         Window_NameBox.prototype.isPopup = function() {
  1604.             return this._parentWindow.isPopup();
  1605.         };

  1606.         Window_NameBox.prototype.updatePlacementPopup = function() {
  1607.             this.adjustPositionX();
  1608.             this.adjustPositionY();
  1609.             if (!$gameSystem.getMessagePopupId()) {
  1610.                 this.openness = 0;
  1611.             }
  1612.         };
  1613.     }

  1614.     //=============================================================================
  1615.     // ウィンドウを透過して重なり合ったときの表示を自然にします。
  1616.     //=============================================================================
  1617.     if (paramThroughWindow && !WindowLayer.throughWindow) {
  1618.         WindowLayer.throughWindow = true;
  1619.         //=============================================================================
  1620.         //  WindowLayer
  1621.         //   ウィンドウのマスク処理を除去します。
  1622.         //=============================================================================
  1623.         WindowLayer.prototype._maskWindow = function(window) {};

  1624.         WindowLayer.prototype._canvasClearWindowRect = function(renderSession, window) {};
  1625.     }

  1626.     //=============================================================================
  1627.     // FTKR_ExMessageWindow2.js の修正
  1628.     //=============================================================================
  1629.     if (imported_FTKR_EMW()) {

  1630.         //------------------------------------------------------------------------
  1631.         //Game_System
  1632.         //フキダシウィンドウの有効無効フラグをウィンドウID毎に保持
  1633.         //------------------------------------------------------------------------
  1634.         var _EMW_Game_System_initialize  = Game_System.prototype.initialize;
  1635.         Game_System.prototype.initialize = function() {
  1636.             _EMW_Game_System_initialize.apply(this, arguments);
  1637.             this._messagePopupCharacterIds = [];
  1638.         };

  1639.         Game_System.prototype.setMessagePopupEx = function(windowId, eventId) {
  1640.             this._messagePopupCharacterIds[windowId] = eventId;
  1641.         };

  1642.         var _EMW_Game_System_clearMessagePopup  = Game_System.prototype.clearMessagePopup;
  1643.         Game_System.prototype.clearMessagePopup = function() {
  1644.             _EMW_Game_System_clearMessagePopup.apply(this, arguments);
  1645.             this._messagePopupCharacterIds.forEach(function(id, i) {
  1646.                 this.clearMessagePopupEx(i);
  1647.             }, this);
  1648.         };

  1649.         Game_System.prototype.clearMessagePopupEx = function(windowId) {
  1650.             this._messagePopupCharacterIds[windowId] = 0;
  1651.         };

  1652.         Game_System.prototype.getMessagePopupIdEx = function(windowId) {
  1653.             windowId = windowId || 0;
  1654.             return this._messagePopupCharacterIds[windowId] !== 0 ? this._messagePopupCharacterIds[windowId] : null;
  1655.         };

  1656.         //------------------------------------------------------------------------
  1657.         //Scene_Map
  1658.         //場所移動時にすべてのウィンドウIDのフキダシ無効化
  1659.         //------------------------------------------------------------------------
  1660.         var _EMW_Scene_Map_terminate  = Scene_Map.prototype.terminate;
  1661.         Scene_Map.prototype.terminate = function() {
  1662.             _EMW_Scene_Map_terminate.call(this);
  1663.             if (SceneManager.isNextScene(Scene_Map)) {
  1664.                 $gameSystem.clearMessagePopup();
  1665.             }
  1666.         };

  1667.         //------------------------------------------------------------------------
  1668.         //Window_MessageEx
  1669.         //------------------------------------------------------------------------
  1670.         var _Window_MessageEx_startMessage      = Window_MessageEx.prototype.startMessage;
  1671.         Window_MessageEx.prototype.startMessage = function() {
  1672.             this.updateTargetCharacterId();
  1673.             this.loadWindowskin();
  1674.             _Window_MessageEx_startMessage.apply(this, arguments);
  1675.             this.resetLayout();
  1676.         };

  1677.         var _Window_MessageEx_updatePlacement      = Window_MessageEx.prototype.updatePlacement;
  1678.         Window_MessageEx.prototype.updatePlacement = function() {
  1679.             if (typeof Yanfly === 'undefined' || !Yanfly.Message) {
  1680.                 this.x = 0;
  1681.             }
  1682.             _Window_MessageEx_updatePlacement.apply(this, arguments);
  1683.             if (!this.isPopup()) {
  1684.                 return;
  1685.             }
  1686.             this.updatePlacementPopup();
  1687.         };

  1688.         Window_MessageEx.prototype.updateTargetCharacterId = function() {
  1689.             var id                  = $gameSystem.getMessagePopupIdEx(this._windowId);
  1690.             this._targetCharacterId = $gameSystem.getMessagePopupIdEx(this._windowId);
  1691.         };

  1692.         Window_MessageEx.prototype.updatePlacementPopup = function() {
  1693.             this.setPopupPosition(this.getPopupTargetCharacter());
  1694.             if (this._choiceWindow && this._gameMessage.isChoice()) {
  1695.                 this._choiceWindow.updatePlacementPopup();
  1696.             }
  1697.             this._numberWindow.updatePlacementPopup();
  1698.             if (this._nameWindow && checkTypeFunction(this._nameWindow.updatePlacementPopup)) {
  1699.                 this._nameWindow.updatePlacementPopup();
  1700.             }
  1701.         };

  1702.         Window_MessageEx.prototype.processVirtual = function() {
  1703.             var virtual      = {};
  1704.             virtual.index    = 0;
  1705.             virtual.text     = this.convertEscapeCharacters(this._gameMessage.allText());
  1706.             virtual.maxWidth = 0;
  1707.             this.newPage(virtual);
  1708.             while (!this.isEndOfText(virtual)) {
  1709.                 this.processVirtualCharacter(virtual);
  1710.             }
  1711.             virtual.y += virtual.height;
  1712.             this._subWindowY = virtual.y;
  1713.             var choices      = this._gameMessage.choices();
  1714.             if (choices && $gameSystem.getPopupSubWindowPosition() === 2) {
  1715.                 virtual.y += choices.length * this._choiceWindow.lineHeight();
  1716.                 virtual.maxWidth = Math.max(virtual.maxWidth, this.newLineX() + this._choiceWindow.maxChoiceWidth());
  1717.             }
  1718.             var digit = this._gameMessage.numInputMaxDigits();
  1719.             if (digit && $gameSystem.getPopupSubWindowPosition() === 2) {
  1720.                 virtual.y += this._numberWindow.lineHeight();
  1721.             }
  1722.             var width  = virtual.maxWidth + this.padding * 2;
  1723.             var height = Math.max(this.getFaceHeight(), virtual.y) + this.padding * 2;
  1724.             var adjust = $gameSystem.getPopupAdjustSize();
  1725.             if (adjust) {
  1726.                 width += adjust[0];
  1727.                 height += adjust[1];
  1728.             }
  1729.             if (this.isUsePauseSignTextEnd()) {
  1730.                 width += this._windowPauseSignSprite.width;
  1731.             } else if (paramNoUseTail) {
  1732.                 height += 8;
  1733.             }
  1734.             this.width  = width;
  1735.             this.height = height;
  1736.             this.resetFontSettings();
  1737.         };

  1738.         var _Window_MessageEx_newLineX      = Window_MessageEx.prototype.newLineX;
  1739.         Window_MessageEx.prototype.newLineX = function() {
  1740.             if (this.isPopup()) {
  1741.                 return this._gameMessage.faceName() === '' ? 0 : Window_Message._faceWidth + 8;
  1742.             } else {
  1743.                 return _Window_MessageEx_newLineX.apply(this, arguments);
  1744.             }
  1745.         };

  1746.         Window_MessageEx.prototype.getFaceHeight = function() {
  1747.             return this._gameMessage.faceName() === '' ? 0 : Window_Message._faceHeight;
  1748.         };

  1749.         //------------------------------------------------------------------------
  1750.         //Window_ChoiceListEx
  1751.         //------------------------------------------------------------------------
  1752.         var _Window_ChoiceListEx_numVisibleRows      = Window_ChoiceListEx.prototype.numVisibleRows;
  1753.         Window_ChoiceListEx.prototype.numVisibleRows = function() {
  1754.             var result = _Window_ChoiceListEx_numVisibleRows.apply(this, arguments);
  1755.             if (this.isPopupLinkage()) {
  1756.                 result = Math.min(this._gameMessage.choices().length, 8);
  1757.             }
  1758.             return result;
  1759.         };

  1760.         var _Window_ChoiceListEx_updatePlacement      = Window_ChoiceListEx.prototype.updatePlacement;
  1761.         Window_ChoiceListEx.prototype.updatePlacement = function() {
  1762.             this.resetLayout();
  1763.             _Window_ChoiceListEx_updatePlacement.apply(this, arguments);
  1764.             if (this.isPopup()) this.updatePlacementPopup();
  1765.         };

  1766.         //------------------------------------------------------------------------
  1767.         //Window_NumberInputEx
  1768.         //------------------------------------------------------------------------
  1769.         var _Window_NumberInputEx_updatePlacement      = Window_NumberInputEx.prototype.updatePlacement;
  1770.         Window_NumberInputEx.prototype.updatePlacement = function() {
  1771.             this.resetLayout();
  1772.             this.opacity = 255;
  1773.             _Window_NumberInputEx_updatePlacement.apply(this, arguments);
  1774.             if (this.isPopup()) this.updatePlacementPopup();
  1775.         };

  1776.     }//FTKR_ExMessageWindow2
  1777. })();

复制代码

点评

感谢!  发表于 2020-6-14 23:03

评分

参与人数 1赞 +1 收起 理由
白嫩白嫩的 + 1 认可答案

查看全部评分

回复 1 0

使用道具 举报

梦石
0
星屑
3922
在线时间
1198 小时
注册时间
2016-8-9
回帖
2355

开拓者

发表于 2020-6-13 23:11:53 | 显示全部楼层
galv的气泡对话框也可以,亲测没有冲突

点评

真巧呢337,我也是用的这个 哈哈哈哈  发表于 2020-6-17 17:17
我也是用這個666666  发表于 2020-6-17 10:22
不用客气,galv的插件我用起来基本上跟yep没什么冲突也很好用还有demo可以研究很亲民  发表于 2020-6-15 00:30
是Galv's Timed Message Popups这个吗,这个我用了确实可以!感谢告知  发表于 2020-6-14 23:06
酸酸甜甜就④哇噢
回复 1 0

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部