查看: 1319|回复: 2

[已经过期] fuki对话框显示角色名字的脚本的第603行究竟是.....?

[复制链接]
梦石
0
星屑
60
在线时间
12 小时
注册时间
2017-1-20
回帖
4
发表于 2017-7-2 13:02:43 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 VIPArcher 于 2017-8-16 22:17 编辑

之前一直没有用,今天刚刚用,一打开就报错了,猝不及防。

刚开始以为是脚本冲突但是开了个新工程还是报同样的错误xx{:2_271:}

还请各位帮忙看看是咋回事儿。

下附脚本:
  1. =begin
  2. 吹きだしウィンドウVXAce

  3. 2011年12月25日 tamura改造
  4. 2014年06月03日 改訂

  5. ※このスクリプトは、ちいさな本屋様が製作されたものをtamuraがACE用に改造した物です。

  6. 原版:
  7. ▽▽▽ XRXSv2. メッセージ表示フルグレードアップVX ▽▽▽
  8. publish 2010/ 3/ 2
  9. update  - 11/ 1/10a


  10. ※※警告※※
  11. THINK_TAIL や SYSTEM_LINE の機能を使わない場合は、
  12. これらに使用していないスイッチを割り当てておいてください。


  13. 「立ち絵機能」をONにしている時に、立ち絵を表示せずに、ウィンドウ位置を
  14. 右か左に変更した時、テールのY座標がずれるようです。
  15. 原因は調査中です。立ち絵を表示しない時は、イベントコマンド「注釈」で、
  16. 「立ち絵表示 off」と記述して立ち絵機能をOFFにしておいてください。

  17. ●機能一覧
  18. ・イベントコマンド「スクリプト」で、$win_x $win_yに値を入力すると、
  19.  ($win_x 、$win_y)の位置にウィンドウを表示する。画面左上が(0,0)。

  20. ・キーボードのQ(装備画面で前のキャラに戻るボタン)を押すと、
  21.  ウィンドウが消える。Qか決定、キャンセルキーで元に戻る。

  22. ・イベントコマンド「スクリプト」で、
  23. $name_right = true
  24. と入力すれば、ネームウィンドウがウィンドウの右に移ります。
  25. 元に戻すには、イベントコマンド「スクリプト」で
  26. $name_right = false
  27. と入力すれば、左側に戻ります。


  28. ・SYSTEM_LINEに指定したスイッチをON/OFFにすると、
  29. 文章の1行目を表示しない/表示する を切り替えることができます。


  30. ・文章のどこでもいいので、以下の表記を行う。
  31. ・ \name[] : []の中の文字を、ウィンドウ左上に小さく表示する。
  32.  表示させる名前には、制御文字 \V、\P、\N、\G が使用可能。

  33. ・ポップアップウィンドウの表示の仕方。
  34. \h[-1] : プレーヤーの上にウィンドウをポップ。
  35. \h[0] : 現在アクティブのイベントの上にウィンドウをポップ。
  36. \h[1] : IDが1番のイベントの上にウィンドウをポップする。
  37. hは大文字でもOK。
  38. \h[ナタリー] : イベントの名前がナタリーとなっているイベントの上にポップする。

  39. ・サイドビュー導入時
  40. \h[1] : 指定された番号の者の上にウィンドウをポップ。
  41.  アクター側から1、2、3……、終わったら次に敵グループを加算して数える。
  42.  パーティの3番目は3、パーティが4人なら敵の1番目は5、ということ。
  43. \h[スライムA] : 名前がスライムAとなっている者にポップ。

  44. ポップアップを行うとき、
  45. 「メッセージの表示」の設定で、ウィンドウの「表示位置」によって、
  46. ウィンドウがイベントの上に出るか下に出るかを設定できます。

  47. ウィンドウは通常の大きさのまま、テールだけ表示したい場合は、
  48. \t[-2] : ウィンドウが上下に表示される時は、X座標をMINAS_TWE_X_POSで固定。
  49.            $win_x で左右に表示される時は、Y座標がウィンドウの中心やや下で固定。
  50. \t[-3] : ウィンドウが上下に表示される時は、X座標をMINAS_THREE_X_POSで固定。
  51.            $win_x で左右に表示される時は、Y座標がウィンドウの中心やや下で固定。
  52. \t[-1] : プレーヤーの上に向かってテール表示。
  53. \t[0] : 現在アクティブのイベントに向かってテール表示。
  54. \t[1] : IDが1番のイベントの上に向かってテール表示。

  55. その他
  56. \O[128] : 文字を透明にする。128はalphaの値で、0で透明、255で通常。
  57. \D : 文字に影をつける
  58. \hold : メッセージ表示の、最後の文章に限定。
  59.      メッセージが終わっても、ウィンドウを閉じずに残します。
  60.      他のメッセージが表示されて次へ送られる時に消えます。
  61.      なお、ホールドされているウィンドウは、Qボタンで消せません。

  62. \skin[skin01] : ウィンドウスキンを、skin01.png に変更します。
  63.     VXACEのデフォルトに戻したい場合は \skin[Window] です。
  64.     スキンのファイルは必ず Graphics\System フォルダに入れておいてください。

  65. \tone[-34,0,68,0] : ウィンドウの色を変更します。
  66.   この例だとVXACEのデフォルトです。
  67.   データベースのシステムタブで、色を調べられます。
  68.   4つ目の値はgrayと呼ばれ、通常は0です。
  69.     




  70. ●その他
  71. ・ACEに標準装備されている機能は通常通り使用できます。
  72. ・A1殿の立ち絵スクリプトに対応しています。
  73.  このスクリプトの上に「RGSS3用A1共通処理」
  74.  このスクリプトの下に「空メッセージでウィンドウを開かない」「立ち絵表示」を
  75.  配置して下さい。
  76.  残念ながら、「ネームウィンドウ」は使えません。上記\nameをお使いください。
  77. ※立ち絵を表示しない時は、注釈で「立ち絵表示 off」とした方が無難です。
  78. ・イベントの下から話しかけたら上へポップ、上から話しかけたら下へポップするという
  79.  機能を追加。カスタマイズポイントで POP_DIRECTION = ture と変更のこと。


  80. ●廃止機能 
  81. ・\Iがすでに使われているので、イタリック文字変換を廃止。
  82. ・スピード変更、改行、最後に入手したアイテムの表示を、ACE化にともない廃止。


  83. 【改訂履歴】
  84. 2012.01.10  ・ウィンドウを消したまま次のウィンドウを自動で表示すると、
  85.               ネームウィンドウが表示されるのを修正。
  86. 2012.01.11  ・ネームウィンドウが出しっぱなしになるのを修正。
  87. 2012.01.12  ・メニューを出してから決定ボタンを押すとネームウィンドウがでる不具合の修正。
  88. 2012.02.01 ・ネームウィンドウのオープン&クローズのタイミングを変更。
  89.       ・hold機能を追加。
  90. 2012.02.10 ・キャラポップした時、一行ずつしか表示されない不具合を修正。
  91. 2012.02.14 ・アイテム名などの文字数が正常に取得できなかったのを修正。
  92. 2012.02.21 ・話しかけられた方向によって、ポップ方向を変えられるようにした。
  93. 2012.02.25 ・すべてのシーン遷移の際はテールを破棄(イベント中でショップ起動など)
  94. 2012.02.28 ・エスケープ文字の処理が上手くいかない問題について暫定対策。
  95. 2012.03.05 ・微妙にウィンドウ幅が足りない時があったので、僅かにウィンドウ幅追加。
  96. 2012.03.14 ・ポップアップ時の顔グラ表示に対応。
  97. 2012.04.20 ・吹きだしが大型になると選択肢が入りきらない不具合の修正。
  98.             ・ネームウィンドウが残ったままシーン遷移があると、ネームウィンドウが
  99.              閉じない不具合の修正。
  100. 2012.05.02  ・名前には、制御文字 \V、\P、\N、\G が使用可能。
  101.             ・\V については、2段階の入れ子が使用可能。
  102.             ・ウィンドウ消去機能を、「背景を暗くする」に対応。
  103. 2012.05.09 ・通常の上表示のとき、ネームウィンドウが見切れるので少し下にずらす。
  104. 2012.05.12 ・ネームウィンドウの幅と高さを変更可能にした。
  105.             ・ネームウィンドウの高さを変えると、どんどん下に伸びるのを修正。
  106. 2012.07.15 ・イベントコマンドで、$name_right = true と入力すると、
  107.        名前ウィンドウが右に移ります。
  108. 2012.08.26 ・思案型テールへの変更機能追加。
  109.             ・文章の1行目を表示しない機能は、スイッチを使えるようにした。
  110.              (セーブ&ロードに対応していないため)
  111.              なお、従来の$system_line も使用可能。
  112. 2012.10.08 ・ウィンドウスキンおよびウィンドウの色を変更可能にした。
  113. 2012.10.16 ・立ち絵の指定がない時にエラーが起こるのを修正。
  114. 2012.10.17 ・A1殿の立ち絵スクリプトの最新版に対応。
  115. 2013.06.20 ・上記の説明が間違っている個所があったので修正。
  116. 2014.02.12 ・文字の色を変えると不自然なスペースができるのを修正。
  117. 2014.06.03 ・サイドビュー導入時でもウィンドウを表示できるようにしました。
  118.       ・名前を指定して、ポップアップウィンドウを表示できるようになりました。

  119. =end

  120. #==============================================================================
  121. # カスタマイズポイント
  122. #==============================================================================
  123. #=begin
  124. class Window_Message < Window_Base
  125.   #
  126.   # 基本行数
  127.   #
  128.   MAX_LINE = 4
  129.   #
  130.   # \p[] - キャラポップの高さ
  131.   #
  132.   CHARPOP_HEIGHT = 40
  133.   #
  134.   #
  135.   #\name[]で表示されるウィンドウのX座標、Y座標、幅、高さ の変更値。
  136.   #座標は、メッセージウィンドウの左上端が原点。名前はウィンドウ中央に表示。
  137.   NAME_WINDOW_OFFSET_X =   0
  138.   NAME_WINDOW_OFFSET_Y = -37
  139.   NAME_WINDOW_OFFSET_WIDTH = 0
  140.   NAME_WINDOW_OFFSET_HIGHT = 5

  141.   #
  142.   #
  143.   MINAS_TWE_X_POS = 100 # $t[-2]のときの、テールのX座標。
  144.   MINAS_THREE_X_POS = 444 # $t[-3]のときの、テールのX座標。

  145.   POP_DIRECTION = false #イベントの方向を考慮。

  146.   THINK_TAIL = 101 #この番号のゲームスイッチがONの時、思案型テールになります。
  147.   SYSTEM_LINE = 102 #この番号のゲームスイッチがONの時、最初の1行を表示しません。

  148. end

  149. #(メモ)上表示で、ネームウィンドウのために少し下にずらす機能は、
  150. #再定義したupdate_placement_positionのところ。

  151. #==============================================================================
  152. # ■ BattleManager
  153. #------------------------------------------------------------------------------
  154. #  戦闘の進行を管理するモジュールです。
  155. #==============================================================================
  156. module BattleManager
  157.   #--------------------------------------------------------------------------
  158.   # ● 逃走の処理
  159.   #--------------------------------------------------------------------------
  160.   def self.process_escape_hukidasi
  161.     $now_escape = true
  162.     process_escape_hukidasi_default
  163.   end
  164.   #--------------------------------------------------------------------------
  165.   # ● クラスメソッドのエイリアス
  166.   #--------------------------------------------------------------------------
  167.   class << self
  168.     alias :process_escape_hukidasi_default :process_escape
  169.     alias :process_escape :process_escape_hukidasi
  170.   end
  171. end  

  172. #==============================================================================
  173. # 参照機能
  174. #==============================================================================
  175. class Game_Temp
  176.   attr_accessor :last_gain_material
  177.   attr_accessor :last_gain_holder
  178. end

  179. #==============================================================================
  180. # ■ Game_Event
  181. #==============================================================================
  182. class Game_Event < Game_Character
  183.   #--------------------------------------------------------------------------
  184.   # ● 公開インスタンス変数
  185.   #--------------------------------------------------------------------------
  186.   attr_reader   :event
  187. end  

  188. class Window_Message < Window_Base
  189.   #--------------------------------------------------------------------------
  190.   # ● 改ページ処理
  191.   #--------------------------------------------------------------------------
  192.   def new_page(text, pos)
  193.     contents.clear
  194.     draw_face($game_message.face_name, $game_message.face_index, 0, 0)
  195.     reset_font_settings
  196.     pos[:x] = new_line_x

  197.     #変更部分。システム用の一行目を表示しない。
  198.     if $system_line != true and $game_switches[SYSTEM_LINE] != true
  199.       pos[:y] = 0
  200.     else
  201.       if !$game_party.in_battle or $svhuki
  202.         if $now_escape #逃走中。サイドビューでは、逃走中はin_battleがfalse
  203.           pos[:y] = 0
  204.           $now_escape = false
  205.         else
  206.           pos[:y] = 0 - line_height #最初の一行を表示しない。
  207.         end
  208.       else
  209.         pos[:y] = 0
  210.       end
  211.     end

  212.     pos[:new_x] = new_line_x
  213.     pos[:height] = calc_line_height(text)
  214.     clear_flags
  215.   end
  216. end

  217. #==============================================================================
  218. # フルグレードアップベース - 制御文字・基本機能
  219. #==============================================================================
  220. class Window_Message < Window_Base
  221.   attr_accessor :tail
  222.   #--------------------------------------------------------------------------
  223.   # ● 特殊文字の変換 + 準備
  224.   #     変換・消去してもいい部分を処理、フラグのセット。
  225.   #--------------------------------------------------------------------------
  226.   alias xrxsv2_convert_escape_characters convert_escape_characters
  227.   def convert_escape_characters(text)
  228.     #@textsが使いずらいので、ここで別変数に保管。
  229.     @all_texts = []
  230.     str = text.gsub(/\\/) { "\e" }
  231.     @all_texts = str.split("\n")

  232.     #この段階で、変数・アクター名を変換してしまう。
  233.     #ネームウィンドウ内の文字を変換するため。
  234.     text = convert_escape_characters_easy(text)

  235.     # 初期化
  236.     contents.font.size   = Font.default_size
  237.     contents.font.bold   = Font.default_italic
  238.     contents.font.italic = Font.default_bold
  239.     contents.font.shadow = Font.default_shadow
  240.     @type_wait = 0
  241.     @line_widths = []
  242.     @line_aligns = []
  243.     self.pop_character = nil
  244.     # ウィンドウ保持指定\holdがあるか?
  245.     @window_hold = (text.gsub!(/\\hold/) { "" } != nil)
  246.     # \info
  247.     @info_mode = (text.gsub!(/\\info/) { "" } != nil)
  248.     # 改行削除指定\_があるか?
  249.     if (/\\_(.*?)\x00/.match(@text)) != nil
  250.       $game_message.choice_start -= 1
  251.       text.gsub!(/\\_(.*?)\x00/) { $1.to_s }
  252.     end
  253.     # \name 判定
  254.     if text.sub!(/\\[Nn]ame\[(.*?)\]/) { "" }
  255.       name = $1
  256.       bitmap = @name_sprite.bitmap
  257.       w = [bitmap.text_size(name).width, 1].max + NAME_WINDOW_OFFSET_WIDTH
  258.       bitmap.dispose
  259.       @name_sprite.bitmap = Bitmap.new(w, 32)
  260.       bitmap = @name_sprite.bitmap
  261.       bitmap.draw_text(0, 0, bitmap.width, bitmap.height, name)
  262.       @name_window.width = w + 16
  263.       @name_window.height = bitmap.height + NAME_WINDOW_OFFSET_HIGHT
  264.       @name_window.create_contents
  265.       @name_window.open if @name_window.openness == 0
  266.       if self.visible #名前だけ表示されるのを防止。
  267.         @name_window.visible = true
  268.         @name_sprite.visible = true
  269.       else
  270.         @name_window.visible = false
  271.         @name_sprite.visible = false
  272.       end
  273.     else
  274.       @name_window.visible = false
  275.       @name_sprite.visible = false
  276.       @name_sprite.bitmap.dispose
  277.       @name_sprite.bitmap = Bitmap.new(32,32)
  278.     end
  279.     $name = $1 #あれこれで使うので、ネームウィンドウに表示予定の名前を取得。
  280.     #スキン変更
  281.     if text.sub!(/\\[Ss]kin\[(.*?)\]/) { "" }
  282.       skin = $1
  283.       self.windowskin = Cache.system(skin)
  284.       @name_window.windowskin = Cache.system(skin)
  285.     end
  286.     #ウィンドウトーン変更
  287.     if text.sub!(/\\[Tt]one\[(\-?\d+),(\-?\d+),(\-?\d+),(\-?\d+)\]/) { "" }
  288.       $game_system.window_tone.red = $1.to_f
  289.       $game_system.window_tone.green = $2.to_f
  290.       $game_system.window_tone.blue = $3.to_f
  291.       $game_system.window_tone.gray = $4.to_f
  292.     end
  293.     # キャラボップモード
  294.     if text.gsub!(/\\[Hh]\[-1\]/) { "" }
  295.       self.pop_character = -1
  296.     elsif text.gsub!(/\\[Hh]\[([0-9]+)\]/) { "" }
  297.       self.pop_character = $1.to_i
  298.     elsif text.gsub!(/\\[Hh]\[(.*?)\]/) { "" } #名前指定(サイドビュー対応)
  299.       self.pop_character = 0 #見つからないときのため、最初に0を入力。
  300.       if $game_party.in_battle
  301.         members = $game_party.members + $game_troop.members
  302.         members.each_with_index {|member , index|
  303.           if member.name == $1
  304.             self.pop_character = index +1
  305.             break
  306.           end
  307.         }
  308.       else
  309.         members = $game_map.events
  310.         members.each_with_index {|member , index|
  311.           if member[1].event.name == $1
  312.             self.pop_character = index + 1
  313.             break
  314.           end
  315.         }
  316.       end
  317.     elsif text.gsub!(/\\[Hh]/) { "" }
  318.       self.pop_character = 0
  319.     #テール表示モード
  320.     elsif text.gsub!(/\\[Tt]\[-1\]/) { "" }
  321.       self.tail_character = -1
  322.     elsif text.gsub!(/\\[Tt]\[-2\]/) { "" }
  323.       self.tail_character = -2
  324.     elsif text.gsub!(/\\[Tt]\[-3\]/) { "" }
  325.       self.tail_character = -3
  326.     elsif text.gsub!(/\\[Tt]\[([0-9]+)\]/) { "" }
  327.       self.tail_character = $1.to_i
  328.     elsif text.gsub!(/\\[Tt]/) { "" }
  329.       self.tail_character = 0
  330.     else
  331.       self.pop_character = nil
  332.     end

  333.     # 制御文字処理
  334.     text = xrxsv2_convert_escape_characters(text)
  335.     text.gsub!(/\\[Ss]\[([0-9]+)\]/i) { "\eS[#{$1}]" }
  336.     text.gsub!(/\\[Oo]\[([0-9]+)\]/i) { "\eO[#{$1}]" }
  337.     text.gsub!(/\\last_holder/i) { "\e18" }
  338.     text.gsub!(/\\last_material/i) { "\e19" }
  339.     text.gsub!(/\\B/) { "\eB" }
  340.     text.gsub!(/\\D/) { "\eD" }
  341.     #text.gsub!(/\\n/) { "\n" }
  342.     #
  343.     # ライン情報の取得
  344.     rxs = ["\x01","\x02","\x03","\x04","\x05","\x06","\x07","\x08",
  345.       /\[([0-9]+)\]/,
  346.       "\x11","\x12","\x13","\x14", "\x15", "\x16", "\x17", "\x18","\x19"]
  347.     lines = text.split("\x00")
  348.     @lines_max = lines.size
  349.     for i in 0...@lines_max
  350.       line = lines[i]
  351.       for rx in rxs
  352.         line.gsub!(rx) {""}
  353.       end
  354.       @line_aligns[i] =
  355.         line.sub!(/\\center/) {""} ? CENTER :
  356.         line.sub!(/\\right/)  {""} ? RIGHT :
  357.                                      AUTO
  358.       # 行の横幅の取得と設定
  359.       cx = text_width_no_escape(line,text) #test
  360.       #cx = contents.text_size(line,text).width
  361.       @line_widths[i] = cx
  362.     end
  363.     # 位置揃え制御文字の削除
  364.     text.gsub!(/\\center/) {""}
  365.     text.gsub!(/\\right/) {""}
  366.     # キャラポップ時のウィンドウリサイズ
  367.     reszie_window_for_pop

  368.     del_tail # if @tail != nil
  369.     # $mes_id が空のときと戦闘中はふきだしを表示しない
  370.     if defined?($game_system.show_stand_picture) #立ち絵に対応。
  371.       $mes_id = -1 if $game_system.show_stand_picture == true
  372.     end
  373.     if $mes_id != nil and (!$game_party.in_battle or $svhuki)
  374.       # ふきだしのテールを描画
  375.       skin = "Window"
  376.       if @background == 0
  377.         #画像の準備
  378.         @tail = Sprite.new
  379.         @tail.visible = false
  380.         # 位置を取得
  381.         tale_pos = get_tale_pos
  382.         if $win_x != nil
  383.           if $win_x > 0
  384.             @tail.bitmap = Cache.system(skin + "-right")
  385.             @tail.x = tale_pos[0]
  386.             @tail.y = tale_pos[1]
  387.             @tail.z = self.z + 1
  388.           elsif  $win_x < 0
  389.             @tail.bitmap = Cache.system(skin + "-left")
  390.             @tail.x = tale_pos[0]
  391.             @tail.y = tale_pos[1]
  392.             @tail.z = self.z + 1
  393.           else
  394.             create_tail_up_under
  395.           end
  396.         else
  397.           create_tail_up_under
  398.         end
  399.         # エクストラスプライトに登録
  400.         @extra_sprites = [] if @extra_sprites.nil?
  401.         @extra_sprites.push(@tail) if @tail != nil
  402.         # 更新
  403.         update_tail
  404.       end
  405.     end

  406.     open_and_wait #リサイズが終わった時点でウィンドウオープン。

  407.     return text
  408.   end
  409.   #--------------------------------------------------------------------------
  410.   # ● 制御文字の変換。
  411.   #    変数・パーティ名・アクター名・所持金のみ変換する。
  412.   #    文字「\」はエスケープ文字(\e)に変換。
  413.   #--------------------------------------------------------------------------
  414.   def convert_escape_characters_easy(text)
  415.     result = text.to_s.clone
  416.     result.gsub!(/\\[vV]\[/)          { "\eV\[" }
  417.     result.gsub!(/\\[nN]\[/)          { "\eN\[" }
  418.     result.gsub!(/\\[pP]\[/)          { "\eP\[" }
  419.     result.gsub!(/\\[gG]/)          { "\eG" }
  420.     result.gsub!(/\eV\[(\d+)\]/i) { $game_variables[$1.to_i] }
  421.     result.gsub!(/\eV\[(\d+)\]/i) { $game_variables[$1.to_i] }
  422.     result.gsub!(/\eN\[(\d+)\]/i) { actor_name($1.to_i) }
  423.     result.gsub!(/\eP\[(\d+)\]/i) { party_member_name($1.to_i) }
  424.     result.gsub!(/\eG/i)          { Vocab::currency_unit }
  425.     result
  426.   end
  427.   #--------------------------------------------------------------------------
  428.   # ● 文字の長さを取得する。エスケープ文字は含まない。
  429.   # line : 表示しようとしている全ての文字列。
  430.   # text : その列の文字。
  431.   #--------------------------------------------------------------------------
  432.   def text_width_no_escape(line , text_o)
  433.     add = 5 #微妙に足りないので水増し。
  434.     text = Marshal.load(Marshal.dump(text_o))
  435.     text.gsub!(/\ehold/) { "" }
  436.     text.gsub!(/\einfo/) { "" }
  437.     # 改行削除指定\_があるか?
  438.     if (/\\_(.*?)\x00/.match(@text)) != nil
  439.       $game_message.choice_start -= 1
  440.       text.gsub!(/\\_(.*?)\x00/) { "" }
  441.     end
  442.     # \name 判定
  443.     text.sub!(/\e[Nn]ame\[(.*?)\]/) { "" }
  444.     text.gsub!(/\e[Hh]\[-1\]/) { "" }
  445.     text.gsub!(/\e[Hh]\[([0-9]+)\]/) { "" }
  446.     text.gsub!(/\e[Hh]/) { "" }
  447.     text.gsub!(/\e[Tt]\[-1\]/) { "" }
  448.     text.gsub!(/\e[Tt]\[-2\]/) { "" }
  449.     text.gsub!(/\e[Tt]\[-3\]/) { "" }
  450.     text.gsub!(/\e[Tt]\[([0-9]+)\]/) { "" }
  451.     text.gsub!(/\e[Tt]/) { "" }
  452.     # 制御文字処理
  453.     text.gsub!(/\e[Ss]\[([0-9]+)\]/i) { "" }
  454.     text.gsub!(/\e[Oo]\[([0-9]+)\]/i) { "" }
  455.     text.gsub!(/\elast_holder/i) { "" }
  456.     text.gsub!(/\elast_material/i) { "" }
  457.     #text.gsub!(/\eV/) { "" } #変数に置き換える。
  458.     #text.gsub!(/\eN/) { "" } #名前へ置き換える。
  459.     #text.gsub!(/\eP/) { "" } #名前へ置き換える。
  460.     #text.gsub!(/\eG/) { "" } #金額へ置き換える。
  461.     text.gsub!(/\eC\[([0-9]+)\]/) { "" }
  462.     text.gsub!(/\eB/) { "" }
  463.     text.gsub!(/\eD/) { "" }
  464.     if text =~ /\eI/
  465.       loop do
  466.         if str = text.sub!(/\eI\[(\d+)\]/){ "" }
  467.           add += 24
  468.         else
  469.           break
  470.         end
  471.       end
  472.     end
  473.     #text.gsub!(/\\n/) { "\n" }
  474.     text.sub!(/\ecenter/) {""}
  475.     text.sub!(/\eright/)  {""}
  476.     text.gsub!(/\ecenter/) {""}
  477.     text.gsub!(/\eright/) {""}

  478.     text = xrxsv2_convert_escape_characters(text)
  479.     basic_width = text_size(text).width + add
  480.     esc = text.scan(/\e(\S)/)
  481.     return ( basic_width - esc.size * (contents.font.size - 4) ) #\eの幅は20?
  482.   end
  483.   #--------------------------------------------------------------------------
  484.   # ● 最も長い列の長さを調べる。エスケープ文字は含まない。
  485.   #--------------------------------------------------------------------------
  486.   def max_width
  487.     text_size = []
  488.     for i in 0 ... @all_texts.size
  489.       text_size.push text_width_no_escape(@all_texts[i],@all_texts[i]) + 20
  490.     end
  491.     return text_size.max
  492.   end
  493.   #--------------------------------------------------------------------------
  494.   # ● 吹きだしテールが上か下の場合の画像を準備。
  495.   #--------------------------------------------------------------------------
  496.   def create_tail_up_under
  497.     skin = "Window"
  498.     tale_pos = get_tale_pos
  499.     case @position
  500.     when 0  # 上
  501.       @tail.bitmap = Cache.system(skin + "-top")
  502.       @tail.x = tale_pos[0]
  503.       @tail.y = tale_pos[1]
  504.       @tail.z = self.z + 1
  505.     when 1  # 中
  506.       @tail.dispose
  507.       @tail = nil
  508.     when 2  # 下
  509.       @tail.bitmap = Cache.system(skin + "-under")
  510.       @tail.x = tale_pos[0]
  511.       @tail.y = tale_pos[1]
  512.       @tail.z = self.z + 1
  513.     end
  514.   end
  515.   #--------------------------------------------------------------------------
  516.   # ● 全テキストの処理
  517.   #--------------------------------------------------------------------------
  518.   def process_all_text
  519.     #open_and_wait #リサイズがあるので、すぐにウィンドウをオープンしない。
  520.     text = convert_escape_characters($game_message.all_text)
  521.     pos = {}
  522.     new_page(text, pos)
  523.     process_character(text.slice!(0, 1), text, pos) until text.empty?
  524.   end
  525.   #--------------------------------------------------------------------------
  526.   # ● メッセージの更新 *
  527.   #--------------------------------------------------------------------------
  528.   def update_message
  529.     @wait_count = @type_wait
  530.     loop do
  531.       c = @text.slice!(/./m)
  532.       case update_message_type(c)
  533.       when 1
  534.         break
  535.       when 2
  536.         next
  537.       end
  538.       break unless @show_fast or @line_show_fast
  539.     end
  540.   end
  541.   #--------------------------------------------------------------------------
  542.   # 一文字の描画 (返り値 1:break, 2:next)
  543.   #--------------------------------------------------------------------------
  544. #=begin
  545.   def process_escape_character(code, text, pos)
  546.     case code.upcase
  547.     when '


  548. 用这个脚本,然后在对话框输入\name[],括号里面输入主角名字,就成功了。
  549.       @gold_window.open
  550.     when '.'
  551.       wait(15)
  552.     when '|'
  553.       wait(60)
  554.     when '!'
  555.       input_pause
  556.     when '>'
  557.       @line_show_fast = true
  558.     when '<'
  559.       @line_show_fast = false
  560.     when '^'
  561.       @pause_skip = true
  562.     #when 'n'                      # 改行
  563.     #  new_line
  564.     #  max = MAX_LINE
  565.     #  max = 14 if self.pop_character != nil
  566.     #  if @line_count >= max      # 行数が最大のとき
  567.     #    unless @text.empty?           # さらに続きがあるなら
  568.     #      self.pause = true           # 入力待ちを入れる
  569.           #return 1
  570.     #    end
  571.     #  end
  572.     #when 'S'                       # \S[n]  (スピード変更)
  573.     #  text.sub!(/\[([0-9]+)\]/, "")
  574.     #  @type_wait = $1.to_i
  575.     #  return 2
  576.     when 'O'                       # \O 文字を透明にする。
  577.       text.sub!(/\[([0-9]+)\]/, "")
  578.       contents.font.color.alpha = $1.to_i
  579.       #return 2
  580.     when 'D' #\D 文字に影をつける
  581.       contents.font.shadow ^= true
  582.     #when '18'
  583.     #  name = ($game_temp.last_gain_holder.name rescue "")
  584.     #  update_message_type_draw_at(name)
  585.     #when '19'
  586.     #  item = ($game_temp.last_gain_material.item rescue nil)
  587.     #  draw_item_name(item, @contents_x, @contents_y)
  588.     #  @contents_x += 196
  589.     else
  590.       super
  591.     end

  592.   end
  593. #=end
  594.   #--------------------------------------------------------------------------
  595.   # ● 改ページ処理
  596.   #--------------------------------------------------------------------------
  597.   alias xrxsv2_new_page new_page
  598.   def new_page(text, pos)
  599.     xrxsv2_new_page(text, pos)
  600.     update_charpop_window
  601.   end
  602.   #--------------------------------------------------------------------------
  603.   # ● 改行位置の取得
  604.   #--------------------------------------------------------------------------
  605.   #def new_line_x
  606.   #  $game_message.face_name.empty? ? 0 : 112
  607.   #end
  608.   #--------------------------------------------------------------------------
  609.   # ● 改行処理
  610.   #--------------------------------------------------------------------------
  611.   alias xrxsv2_new_line_x new_line_x
  612.   def new_line
  613.     xrxsv2_new_line
  614.     set_align
  615.   end
  616.   #--------------------------------------------------------------------------
  617.   # 位置揃え
  618.   #--------------------------------------------------------------------------
  619.   def set_align
  620.     w = @line_widths[@line_count].to_i
  621.     a = @line_aligns[@line_count]
  622.     case a
  623.     when CENTER
  624.       @contents_x = @contents_x + ((contents.width - @contents_x) - w) / 2
  625.     when RIGHT
  626.       @contents_x = contents.width - w
  627.     end
  628.   end
  629.   #--------------------------------------------------------------------------
  630.   # ● ファイバーのメイン処理 ☆再定義
  631.   #--------------------------------------------------------------------------
  632.   def fiber_main
  633.     $game_message.visible = true
  634.     update_background
  635.     update_placement
  636.     loop do
  637.       process_all_text if $game_message.has_text?
  638.       process_input
  639.       $game_message.clear
  640.       @gold_window.close
  641.       process_hold #ホールドウィンドウの処理。
  642.       Fiber.yield
  643.       break unless text_continue?
  644.     end
  645.     close_and_wait
  646.     $game_message.visible = false
  647.     @fiber = nil
  648.   end
  649.   #--------------------------------------------------------------------------
  650.   # 定数
  651.   #--------------------------------------------------------------------------
  652.   AUTO   = 0
  653.   LEFT   = 1
  654.   CENTER = 2
  655.   RIGHT  = 3
  656. end
  657. #==============================================================================
  658. # アクティブイベント取得
  659. #==============================================================================
  660. class Game_Interpreter
  661.   attr_reader   :event_id
  662. end


  663. #==============================================================================
  664. # 各種機能の追加 - キャラポップ/ネーム/ホールド
  665. #==============================================================================
  666. class Window_Message < Window_Base
  667.   #--------------------------------------------------------------------------
  668.   # ● カーソルの更新 *
  669.   #--------------------------------------------------------------------------
  670.   def update_cursor
  671.     if @index >= 0
  672.       x = ($game_message.face_name.empty? ? 0 : 112)
  673.       y = ($game_message.choice_start + @index) * WLH - 1
  674.       w = contents.width - x
  675.       if self.pop_character != nil
  676.         x += 28
  677.         w -= 20
  678.       end
  679.       self.cursor_rect.set(x, y, w, WLH)
  680.     else
  681.       self.cursor_rect.empty
  682.     end
  683.   end
  684.   #--------------------------------------------------------------------------
  685.   # キャラクターの取得
  686.   #   parameter : パラメータ
  687.   #--------------------------------------------------------------------------
  688.   def get_character(parameter)
  689.     # パラメータで分岐
  690.     case parameter
  691.     when -1  # プレイヤー
  692.       return $game_player
  693.     when 0  # 現在アクティブなイベント
  694.       id = $game_map.interpreter.event_id
  695.       events = $game_map.events
  696.       return events == nil ? nil : events[id]
  697.     else  # 特定のイベント
  698.       if $game_party.in_battle and $svhuki #サイドビュー対応
  699.         battle_chara = [nil] + $game_party.members + $game_troop.members
  700.         return battle_chara[parameter]
  701.       else
  702.         events = $game_map.events
  703.         return events == nil ? nil : events[parameter]
  704.       end  
  705.     end
  706.   end
  707.   #--------------------------------------------------------------------------
  708.   # (メッセージ終了時)ホールドの処理
  709.   #--------------------------------------------------------------------------
  710.   def process_hold
  711.     if @window_hold
  712.       @held_windows.push(Window_Copy.new(self))
  713.       @held_windows.push(Window_Copy.new(@name_window))
  714.       @held_windows.push(Sprite_Copy.new(@name_sprite))
  715.       @held_windows.push(Sprite_Copy.new(@back_sprite))
  716.       for sprite in @extra_sprites
  717.         next if sprite.disposed?
  718.         @held_windows.push(Sprite_Copy.new(sprite))
  719.       end
  720.       @extra_sprites.clear
  721.       self.openness = 0
  722.       #@name_window.openness = 0
  723.       @back_sprite.visible = false
  724.     else
  725.       @held_windows.each {|object| object.dispose}
  726.       @held_windows.clear
  727.     end
  728.     #@name_window.close
  729.     #@name_sprite.visible = false
  730.   end
  731.   #--------------------------------------------------------------------------
  732.   # キャラポップ位置の設定と取得
  733.   #--------------------------------------------------------------------------
  734.   def pop_character=(character_id)
  735.     @pop_character = character_id
  736.   end
  737.   def pop_character
  738.     return @pop_character
  739.   end
  740.   #--------------------------------------------------------------------------
  741.   # キャラポップ時のウィンドウリサイズ
  742.   #--------------------------------------------------------------------------
  743.   def reszie_window_for_pop
  744.     #キャラポップ
  745.     if self.pop_character != nil
  746.       #max_x = @line_widths.max.to_i
  747.       #n  = max_x + 32
  748.       n = 0
  749.       n += $game_message.face_name.empty? ? 0 : 122
  750.       m  = $game_message.face_name.empty? ? 0 : 96
  751.       w  = @name_sprite.bitmap.width
  752.       self.width  = max_width + n
  753.       self.height = [@all_texts.size * line_height, m].max + 32

  754.       #システム用の一行目を表示しない。
  755.       if $system_line or $game_switches[SYSTEM_LINE]
  756.         self.height -= line_height if !$game_party.in_battle or $svhuki
  757.       end

  758.       create_contents
  759.       update_charpop_window
  760.     elsif @info_mode
  761.       @line_aligns[0] = CENTER
  762.       self.x = - 8
  763.       self.width = Graphics.width + 16
  764.       self.height = 56
  765.       create_contents
  766.     else
  767.       self.x = 0
  768.       self.width  = Graphics.width
  769.       self.height = MAX_LINE * line_height + 32
  770.       update_placement #位置情報修正。
  771.       create_contents
  772.     end
  773.   end
  774.   #--------------------------------------------------------------------------
  775.   # ● 背景スプライトの作成
  776.   #--------------------------------------------------------------------------
  777.   alias xrxsv2_create_back_sprite create_back_sprite
  778.   def create_back_sprite
  779.     xrxsv2_create_back_sprite
  780.     @back_sprite.zoom_x = 1.0 * Graphics.width / @back_sprite.bitmap.width
  781.     @name_window = Window_Base.new(0,0,112,32)
  782.     @name_window.visible = false
  783.     @name_sprite = Sprite.new
  784.     @name_sprite.bitmap = Bitmap.new(32,32)
  785.     @name_sprite.visible = false
  786.     self.x = self.x
  787.     self.y = self.y
  788.     self.z = self.z
  789.     @held_windows = []
  790.     @extra_sprites = []
  791.   end
  792.   #--------------------------------------------------------------------------
  793.   # ● 背景スプライトの解放
  794.   #--------------------------------------------------------------------------
  795.   alias xrxsv2_dispose_back_sprite dispose_back_sprite
  796.   def dispose_back_sprite
  797.     xrxsv2_dispose_back_sprite
  798.     @name_window.dispose if @name_window != nil #メニュー画面を出そうとするとエラー?
  799.     @name_sprite.dispose if @name_sprite != nil
  800.     for window in @held_windows
  801.       window.dispose
  802.     end
  803.   end
  804.   #--------------------------------------------------------------------------
  805.   # ● 背景スプライトの更新
  806.   #--------------------------------------------------------------------------
  807.   alias xrxsv2_update_back_sprite update_back_sprite
  808.   def update_back_sprite
  809.     @name_window.update
  810.     xrxsv2_update_back_sprite
  811.     update_charpop_window
  812.   end
  813.   #--------------------------------------------------------------------------
  814.   # ウィンドウの位置と不透明度の設定 (キャラポップ)
  815.   #--------------------------------------------------------------------------
  816.   def update_charpop_window
  817.     if self.pop_character
  818.       character = get_character(self.pop_character)
  819.       return if character == nil

  820.       if defined?(character.sv) and $svhuki #サイドビュー対応
  821.         chara_x = character.sv.x / 100 #- $sv_camera.x * 2
  822.         chara_y = character.sv.y / 100 #- $sv_camera.y
  823.       else
  824.         chara_x = character.screen_x
  825.         chara_y = character.screen_y
  826.       end

  827.       # [X座標]
  828.       n = self.width / 2
  829.       n = [n, @name_skin.width + 16].max if @current_name != nil
  830.       w = @name_sprite.bitmap.width
  831.       x = chara_x - [[n, w].max, self.width - 32].min

  832.       # [Y座標]
  833.       if self.pop_character == 0 and POP_DIRECTION #イベントの方向を考慮。
  834.         if character.direction == 2 #下向き
  835.           @position = 0 #上にポップ
  836.         elsif character.direction == 2 #上向き
  837.           @position = 2 #下にポップ
  838.         end
  839.       end
  840.       case @position
  841.       when 0
  842.         y = chara_y - CHARPOP_HEIGHT - self.height
  843.       else
  844.         y = chara_y + 16
  845.       end
  846.       x_max = Graphics.width - 4 - self.width
  847.       x_min = 4
  848.       y_max = Graphics.height - self.height
  849.       y_min = 4
  850.       self.x = [[x, x_max].min, x_min].max
  851.       self.y = [[y, y_max].min, y_min].max
  852.     end
  853.   end
  854.   #--------------------------------------------------------------------------
  855.   # 位置の連動
  856.   #--------------------------------------------------------------------------
  857.   def x=(n)
  858.     super
  859.     if @name_window
  860.       if $name_right
  861.         @name_window.x = n + self.width - @name_window.width - NAME_WINDOW_OFFSET_X
  862.         @name_sprite.x = @name_window.x + 8 + NAME_WINDOW_OFFSET_WIDTH / 2
  863.       else
  864.         @name_window.x = n + NAME_WINDOW_OFFSET_X
  865.         @name_sprite.x = @name_window.x + 8 + NAME_WINDOW_OFFSET_WIDTH / 2
  866.       end
  867.     end
  868.   end
  869.   def y=(n)
  870.     super
  871.     if @name_window
  872.       @name_window.y = n + NAME_WINDOW_OFFSET_Y
  873.       @name_sprite.y = n + NAME_WINDOW_OFFSET_Y + 2 + NAME_WINDOW_OFFSET_HIGHT / 2
  874.     end
  875.   end
  876.   def z=(n)
  877.     super
  878.     if @name_window
  879.       @name_window.z = n + 11#1 テールの上に表示されるので、Zを水増しする。
  880.       @name_sprite.z = n + 12#2
  881.     end
  882.   end
  883.   #--------------------------------------------------------------------------
  884.   # ● ファイバーのメイン処理
  885.   #--------------------------------------------------------------------------
  886.   def fiber_main_namewin
  887.     fiber_main_namewin_default
  888.     @name_window.openness = 0
  889.     @name_sprite.bitmap.clear
  890.     $name = ""
  891.   end
  892.   alias :fiber_main_namewin_default :fiber_main
  893.   alias :fiber_main :fiber_main_namewin
  894. end
  895. #==============================================================================
  896. # 伸縮対応
  897. #==============================================================================
  898. class Window_Message < Window_Base
  899.   #--------------------------------------------------------------------------
  900.   # ● ウィンドウの背景と位置の設定 [再定義]
  901.   #--------------------------------------------------------------------------
  902.   def reset_window
  903.     @background = $game_message.background
  904.     @position = $game_message.position
  905.     if @background == 0   # 通常ウィンドウ
  906.       self.opacity = 255
  907.     else                  # 背景を暗くする、透明にする
  908.       self.opacity = 0
  909.     end
  910.     case @position
  911.     when 0  # 上
  912.       self.y = 0
  913.       @gold_window.y = 360
  914.     when 1  # 中
  915.       self.y = (Graphics.height - self.height) / 2
  916.       @gold_window.y = 0
  917.     when 2  # 下
  918.       self.y = Graphics.height - self.height
  919.       @gold_window.y = 0
  920.     end
  921.   end
  922. end
  923. #==============================================================================
  924. # □ Window_Copy
  925. #------------------------------------------------------------------------------
  926. #   指定のウィンドウのコピーを作成します。
  927. #==============================================================================
  928. class Window_Copy < Window_Base
  929.   #--------------------------------------------------------------------------
  930.   # ○ オブジェクト初期化
  931.   #--------------------------------------------------------------------------
  932.   def initialize(window)
  933.     super(window.x, window.y, window.width, window.height)
  934.     self.contents = window.contents.dup unless window.contents.nil?
  935.     self.opacity = window.opacity
  936.     self.back_opacity = window.back_opacity
  937.     self.z = window.z - 3
  938.     self.visible = window.visible
  939.   end
  940. end
  941. #==============================================================================
  942. # □ Sprite_Copy
  943. #------------------------------------------------------------------------------
  944. #   指定のスプライトのコピーを作成します。
  945. #==============================================================================
  946. class Sprite_Copy < Sprite
  947.   #--------------------------------------------------------------------------
  948.   # ○ オブジェクト初期化
  949.   #--------------------------------------------------------------------------
  950.   def initialize(sprite)
  951.     super()
  952.     self.bitmap = sprite.bitmap.dup unless sprite.bitmap.nil?
  953.     self.opacity = sprite.opacity
  954.     self.x = sprite.x
  955.     self.y = sprite.y
  956.     self.z = sprite.z - 3
  957.     self.ox = sprite.ox
  958.     self.oy = sprite.oy
  959.     self.zoom_x = sprite.zoom_x
  960.     self.visible = sprite.visible
  961.   end
  962. end



  963. #■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□
  964. #■吹きだしテールの表示ルーチン。
  965. #■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□
  966. #==============================================================================
  967. # +++ 「+ふきだし表示」VX +++
  968. # by パラ犬  
  969. #      ×
  970. #    row      
  971. #
  972. # publish 2010/ 3/ 2
  973. # update  -
  974. #
  975. #------------------------------------------------------------------------------
  976. #    ほぼどんなメッセージウィンドウに対しても後付け可能な「ふきだし表示」です。
  977. #  また、テール部分のみの自動追尾機能を持ちます。
  978. #   ふきだし表示をするには、
  979. #  テール用画像「Window-top」「Window-under」を
  980. #  「Graphics/System」フォルダにインポートしておく必要があります。
  981. #==============================================================================
  982. # ■ Window_Message
  983. #==============================================================================
  984. class Window_Message < Window_Base
  985.   #--------------------------------------------------------------------------
  986.   # ● メッセージの開始
  987.   #--------------------------------------------------------------------------
  988.   alias parashelf_update_all_windows update_all_windows
  989.   def update_all_windows
  990.     parashelf_update_all_windows
  991.     update_tail
  992.   end
  993.   #--------------------------------------------------------------------------
  994.   # クローズ [オーバーライド]
  995.   #--------------------------------------------------------------------------
  996.   def close
  997.     super
  998.     del_tail
  999.     @name_window.close if @name_window != nil #ネームウィンドウのクローズ動作。
  1000.   end
  1001.   #--------------------------------------------------------------------------
  1002.   # ● 背景スプライトの更新
  1003.   #--------------------------------------------------------------------------
  1004.   alias parashelf_update_back_sprite update_back_sprite
  1005.   def update_back_sprite
  1006.     parashelf_update_back_sprite
  1007.     update_tail
  1008.   end
  1009.   #--------------------------------------------------------------------------
  1010.   # ○ フレーム更新 (ふきだしテールの更新)
  1011.   #--------------------------------------------------------------------------
  1012.   def update_tail
  1013.     # ふきだしモードではイベントの動きに追従
  1014.     if $mes_id != nil and @tail != nil
  1015.       tale_pos = get_tale_pos
  1016.       @tail.x = tale_pos[0]
  1017.       @tail.y = tale_pos[1]
  1018.       update_tail_bitmap
  1019.     end
  1020.   end
  1021.   ##--------------------------------------------------------------------------
  1022.   # ○ ふきだしテールの画像を更新。
  1023.   #--------------------------------------------------------------------------
  1024.   def update_tail_bitmap
  1025.     skin = "Window"
  1026.     skin = "Think" if $game_switches[THINK_TAIL]
  1027.     if $win_x != nil
  1028.       if $win_x > 0
  1029.         @tail.bitmap = Cache.system(skin + "-right")
  1030.       elsif  $win_x < 0
  1031.         @tail.bitmap = Cache.system(skin + "-left")
  1032.       else
  1033.         case @position
  1034.         when 0  # 上
  1035.           @tail.bitmap = Cache.system(skin + "-top")
  1036.         when 2  # 下
  1037.           @tail.bitmap = Cache.system(skin + "-under")
  1038.         end
  1039.       end
  1040.     else
  1041.       case @position
  1042.       when 0  # 上
  1043.         @tail.bitmap = Cache.system(skin + "-top")
  1044.       when 2  # 下
  1045.         @tail.bitmap = Cache.system(skin + "-under")
  1046.       end
  1047.     end
  1048.     # 可視状態
  1049.     if self.visible == true
  1050.       @tail.visible = self.openness == 255
  1051.     else
  1052.       @tail.visible = false
  1053.     end
  1054.   end
  1055.   #--------------------------------------------------------------------------
  1056.   # ○ テールの位置を計算
  1057.   #--------------------------------------------------------------------------
  1058.   def get_tale_pos
  1059.     if defined?($game_system.show_stand_picture) #A1立ち絵スクリプトを入れている。
  1060.       if $game_system.show_stand_picture #立ち絵on
  1061.         pos = get_tale_pos_stand_pic
  1062.       else
  1063.         pos = get_tale_pos_normal
  1064.       end
  1065.     else
  1066.       pos = get_tale_pos_normal
  1067.     end
  1068.     return pos
  1069.   end
  1070.   #--------------------------------------------------------------------------
  1071.   # ○ テールの位置を計算/立ち絵使用時。※NAME_CHANGEの編集必須。
  1072.   #--------------------------------------------------------------------------
  1073.   def get_tale_pos_stand_pic
  1074.     if $game_message.face_name != ""  and @tail != nil
  1075.       target_name = $game_message.face_name + "_" + $game_message.face_index.to_s
  1076.       name = A1_System::StandPicture::NAME_CHANGE[target_name]
  1077.       chara = name[0] if name != nil
  1078.       if @stand_pic[chara] != nil #立ち絵無しの場合通常通り。
  1079.         x = @stand_pic[chara].pic_sprite.x + @stand_pic[chara].pic_sprite.width / 2
  1080.         y = get_tale_pos_normal_updown
  1081.         update_tail_bitmap
  1082.       else
  1083.         return get_tale_pos_normal #立ち絵が見つからない場合は通常通り。
  1084.       end
  1085.     else
  1086.       return get_tale_pos_normal #立ち絵が見つからない場合は通常通り。
  1087.     end
  1088.     return [x,y]
  1089.   end
  1090.   #--------------------------------------------------------------------------
  1091.   # ○ テールの位置を計算/立ち絵未使用時。
  1092.   #--------------------------------------------------------------------------
  1093.   def get_tale_pos_normal
  1094.     if $mes_id == (-2) #左右の場合は高さはウィンドウ中心。上下ならやや左に配置。
  1095.       if $win_x != nil
  1096.         if $win_x > 0
  1097.           x = $win_x - @tail.width / 2
  1098.           y = self.y + self.height / 2 - @tail.height / 2
  1099.         elsif $win_x < 0
  1100.           x = self.width - @tail.width / 2
  1101.           y = self.y + self.height / 2 - @tail.height / 2
  1102.         else
  1103.           x = MINAS_TWE_X_POS
  1104.           y = get_tale_pos_normal_updown
  1105.         end
  1106.       else
  1107.         x = MINAS_TWE_X_POS
  1108.         y = get_tale_pos_normal_updown
  1109.       end
  1110.     elsif $mes_id <= (-3) #左右の場合は高さはウィンドウ中心。上下ならやや左に配置。
  1111.       if $win_x != nil
  1112.         if $win_x > 0
  1113.           x = $win_x - @tail.width / 2
  1114.           y = self.y + self.height / 2
  1115.         elsif $win_x < 0
  1116.           x = self.width - @tail.width / 2
  1117.           y = self.y + self.height / 2
  1118.         else
  1119.           x = MINAS_THREE_X_POS
  1120.           y = get_tale_pos_normal_updown
  1121.         end
  1122.       else
  1123.         x = MINAS_THREE_X_POS
  1124.         y = get_tale_pos_normal_updown
  1125.       end
  1126.     else
  1127.       character = get_character($mes_id)

  1128.       if defined?(character.sv) and $svhuki #サイドビュー対応
  1129.         if $sv_camera.mirror #バックアタック
  1130.           chara_x = character.sv.x / 100 - $sv_camera.x
  1131.         else
  1132.           chara_x = character.sv.x / 100 - $sv_camera.x * 2
  1133.         end
  1134.         chara_y = character.sv.y / 100 - $sv_camera.y
  1135.       else
  1136.         chara_x = character.screen_x
  1137.         chara_y = character.screen_y
  1138.       end

  1139.       x = [[chara_x - 16, self.x].max, self.x + self.width - 32].min
  1140.       if $win_x != nil
  1141.         if $win_x > 0
  1142.           x = $win_x - @tail.width / 2
  1143.           y = chara_y
  1144.         elsif $win_x < 0
  1145.           x = self.width
  1146.           y = chara_y
  1147.         else
  1148.           y = get_tale_pos_normal_updown
  1149.         end
  1150.       else
  1151.         y = get_tale_pos_normal_updown
  1152.       end
  1153.     end
  1154.     return [x, y]
  1155.   end
  1156.   #--------------------------------------------------------------------------
  1157.   # ○ テールが上下の時、かつ[-2][-3]でない時のy座標の取得。
  1158.   #--------------------------------------------------------------------------
  1159.   def get_tale_pos_normal_updown
  1160.     case @position
  1161.     when 0
  1162.       y = self.y + self.height - @tail.height / 2
  1163.     else
  1164.       y = self.y - @tail.height / 2
  1165.     end
  1166.     return y
  1167.   end
  1168.   #--------------------------------------------------------------------------
  1169.   # ○ ふきだしを破棄
  1170.   #--------------------------------------------------------------------------
  1171.   def del_tail
  1172.     if @tail != nil
  1173.       @tail.dispose
  1174.       @tail = nil
  1175.     end
  1176.   end
  1177. end
  1178. #
  1179. # ▼▲▼ XRXS 9拡張CO-X. ふきだし自動設定 ▼▲▼
  1180. #==============================================================================
  1181. # ■ Window_Message
  1182. #==============================================================================
  1183. class Window_Message < Window_Base
  1184.   #--------------------------------------------------------------------------
  1185.   # ○ ポップキャラクターの設定
  1186.   #--------------------------------------------------------------------------
  1187.   def pop_character=(character_id)
  1188.     @pop_character = character_id
  1189.     $mes_id = character_id
  1190.   end
  1191.   #--------------------------------------------------------------------------
  1192.   # ○ テールキャラクターの設定
  1193.   #--------------------------------------------------------------------------
  1194.   def tail_character=(character_id)
  1195.     #@pop_character = character_id
  1196.     $mes_id = character_id
  1197.   end
  1198. end


  1199. #==============================================================================
  1200. # ■ Window_ChoiceList
  1201. #------------------------------------------------------------------------------
  1202. #  イベントコマンド[選択肢の表示]で、Y座標を修正します。
  1203. #==============================================================================
  1204. class Window_ChoiceList < Window_Command
  1205.   #--------------------------------------------------------------------------
  1206.   # ● ウィンドウ位置の更新
  1207.   #--------------------------------------------------------------------------
  1208.   def update_placement_hukidasi
  1209.     #self.width = [max_choice_width + 12, 96].max + padding * 2
  1210.     #self.width = [width, Graphics.width].min
  1211.     #self.height = fitting_height($game_message.choices.size)
  1212.     #self.x = Graphics.width - width
  1213.     #if @message_window.y >= Graphics.height / 2
  1214.     #  self.y = @message_window.y - height
  1215.     #else
  1216.     #  self.y = @message_window.y + @message_window.height
  1217.     #end
  1218.     update_placement_hukidasi_default
  1219.     if self.y + self.height > Graphics.height
  1220.       self.y -= ( ( self.height + self.y ) - Graphics.height)
  1221.       self.z += 100
  1222.     end
  1223.   end
  1224.   alias :update_placement_hukidasi_default :update_placement
  1225.   alias :update_placement :update_placement_hukidasi
  1226. end

  1227. #==============================================================================
  1228. # ■ Scene_Menu
  1229. #------------------------------------------------------------------------------
  1230. #  メニューを開いてからウィンドウが出るとネームウィンドウが表示される不具合修正。
  1231. #==============================================================================
  1232. #class Scene_Menu < Scene_MenuBase
  1233. #  def terminate_hukidasi_menyu
  1234. #    @name_window.openness = 0 if @name_window != nil
  1235. #    terminate_hukidasi_menyu_default
  1236. #  end
  1237. #  alias :terminate_hukidasi_menyu_default :terminate
  1238. #  alias :terminate :terminate_hukidasi_menyu
  1239. #end

  1240. #■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□
  1241. #■ウィンドウ非表示ルーチン
  1242. #■吹きだしテールとネームウィンドウに対応。
  1243. #■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□
  1244. #==============================================================================
  1245. # L(キーボードのQ)を押すと、メッセージウィンドウを表示・非表示
  1246. #==============================================================================
  1247. class Window_Message < Window_Base
  1248.   def update_winoff
  1249.     unless $game_party.in_battle #バトル中は無効。
  1250.       if Input.trigger?(Input::L)
  1251.         if self.visible == true
  1252.           self.visible = false
  1253.           @background = 777 if @back_sprite != nil and @background == 1 #「背景を暗くする」
  1254.           @tail.visible = false if @tail != nil
  1255.         else
  1256.           self.visible = true
  1257.           @background = 1 if @back_sprite != nil and @background == 777 #「背景を暗くする」
  1258.         end
  1259.         if @name_window != nil
  1260.           if @name_window.visible == false and $name != nil and $name != ""
  1261.             @name_window.visible = true
  1262.             @name_sprite.visible = true
  1263.           else
  1264.             @name_window.visible = false
  1265.             @name_sprite.visible = false
  1266.           end
  1267.         end
  1268.       elsif Input.trigger?(Input::C) or Input.trigger?(Input::B)
  1269.         if self.visible == false
  1270.           self.visible = true
  1271.           @back_sprite.visible = true unless @back_sprite
  1272.         end
  1273.         @tail.visible = true if @tail != nil and @tail.visible == false
  1274.         if @name_window != nil and $name != nil
  1275.           if $name != ""
  1276.             @name_window.visible = true
  1277.             @name_sprite.visible = true
  1278.           end
  1279.         end
  1280.       end
  1281.     end
  1282.     update_winoff_default
  1283.   end
  1284.   alias :update_winoff_default :update
  1285.   alias :update :update_winoff
  1286. end


  1287. #■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□
  1288. #■ウィンドウ表示位置指定ルーチン
  1289. #■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□
  1290. #===========================================================================
  1291. #イベントコマンド「スクリプト」を使い、
  1292. #$win_x=100 
  1293. #$win_y=100
  1294. #と入力すれば、ウィンドウを(100、100)の位置に表示します。
  1295. #使わない時は
  1296. #$win_x=nil
  1297. #などとnilを入力しておいてください。
  1298. #===========================================================================
  1299. class Window_Message < Window_Base
  1300.   #--------------------------------------------------------------------------
  1301.   # ● ウィンドウの背景と位置の設定 [再定義]
  1302.   #--------------------------------------------------------------------------
  1303.   def update_placement_position
  1304.     update_placement_position_default
  1305.     if $win_x != nil
  1306.       if $win_x > 0
  1307.         self.x = $win_x
  1308.         self.width -= $win_x
  1309.       else
  1310.         self.x = 0
  1311.         self.width += $win_x
  1312.       end
  1313.     end
  1314.     if $win_y != nil
  1315.       self.y = $win_y
  1316.     end
  1317.     #上表示の時、ネームウィンドウが見切れるので少し下にずらす。
  1318.     if self.y == 0 and @position == 0 and @name_window != nil and $name != nil
  1319.       self.y += (-NAME_WINDOW_OFFSET_Y)
  1320.     end
  1321.   end
  1322.   alias_method :update_placement_position_default, :update_placement
  1323.   alias_method :update_placement, :update_placement_position
  1324. end


  1325. #==============================================================================
  1326. # ■ SceneManager
  1327. #------------------------------------------------------------------------------
  1328. #  シーン遷移のさい、テールを破棄。ネームウィンドウのデータをクリア。
  1329. #==============================================================================
  1330. module SceneManager
  1331.   #--------------------------------------------------------------------------
  1332.   # ● 呼び出し
  1333.   #--------------------------------------------------------------------------
  1334.   def self.call_sceman_hukidasi(scene_class)
  1335.     if defined?(self.scene.message_window)
  1336.       self.scene.message_window.del_tail if self.scene.message_window.tail != nil
  1337.       $name = ""
  1338.     end
  1339.     @stack.push(@scene)
  1340.     [url=home.php?mod=space&uid=420706]@Scene[/url] = scene_class.new
  1341.   end
  1342.   #--------------------------------------------------------------------------
  1343.   # ● クラスメソッドのエイリアス
  1344.   #--------------------------------------------------------------------------
  1345.   class << self
  1346.     alias :call_sceman_hukidasi_default :call
  1347.     alias :call :call_sceman_hukidasi
  1348.   end
  1349. end

  1350. #==============================================================================
  1351. # ■ Scene_Map
  1352. #------------------------------------------------------------------------------
  1353. #  戦闘トランジションのさい、テールを破棄。
  1354. #==============================================================================
  1355. class Scene_Map < Scene_Base
  1356.   attr_accessor :message_window
  1357.   #--------------------------------------------------------------------------
  1358.   # ● 戦闘前トランジション実行
  1359.   #--------------------------------------------------------------------------
  1360.   def perform_battle_transition_hukidasi
  1361.     @message_window.del_tail #テールの破棄
  1362.     perform_battle_transition_hukidasi_default
  1363.   end
  1364.   alias_method :perform_battle_transition_hukidasi_default, :perform_battle_transition
  1365.   alias_method :perform_battle_transition, :perform_battle_transition_hukidasi
  1366. end


  1367. #=end
复制代码
QQ图片20170702125221.png
QQ图片20170702125434.png

老鹰

梦石
40
星屑
38049
在线时间
7128 小时
注册时间
2012-5-26
回帖
3306

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

发表于 2017-7-2 13:41:33 | 显示全部楼层
这603行明显被篡改了,而且还是改的面目全非

重新找个有效的fuki对话框脚本

评分

参与人数 1星屑 +150 收起 理由
VIPArcher + 150 我很赞同

查看全部评分

回复

使用道具 举报

梦石
0
星屑
60
在线时间
12 小时
注册时间
2017-1-20
回帖
4
 楼主| 发表于 2017-7-2 15:02:07 | 显示全部楼层
百里_飞柳 发表于 2017-7-2 13:41
这603行明显被篡改了,而且还是改的面目全非

重新找个有效的fuki对话框脚本 ...

谢谢指点!!我去找找!{:2_270:}
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部