查看: 1987|回复: 1

[已经解决] fuki对话怎么调整对话框大小?、

[复制链接]
梦石
0
星屑
50
在线时间
261 小时
注册时间
2011-1-19
回帖
62
发表于 2017-2-4 14:53:59 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 见习魔法师 于 2017-2-4 14:57 编辑

请问怎样才能把红色的部分去掉呢?、谢谢、

附上脚本、

  1. =begin
  2. 吹きだしウィンドウVXAce

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

  5. ※このスクリプトは、ちいさな本屋様([url]http://xrxs.at-ninja.jp/[/url])
  6. が製作されたものをtamuraがACE用に改造した物です。

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


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


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

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

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

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


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


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

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

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

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

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

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

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

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




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


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


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

  120. =end

  121. #==============================================================================
  122. # カスタマイズポイント
  123. #==============================================================================
  124. #=begin
  125. class Window_Message < Window_Base
  126.   #
  127.   # 基本行数
  128.   #
  129.   MAX_LINE = 4
  130.   #
  131.   # \p[] - キャラポップの高さ
  132.   #
  133.   CHARPOP_HEIGHT = 40
  134.   #
  135.   #
  136.   #\name[]で表示されるウィンドウのX座標、Y座標、幅、高さ の変更値。
  137.   #座標は、メッセージウィンドウの左上端が原点。名前はウィンドウ中央に表示。
  138.   NAME_WINDOW_OFFSET_X =   0
  139.   NAME_WINDOW_OFFSET_Y = -37
  140.   NAME_WINDOW_OFFSET_WIDTH = 0
  141.   NAME_WINDOW_OFFSET_HIGHT = 5
  142.   
  143.   #
  144.   #
  145.   MINAS_TWE_X_POS = 100 # $t[-2]のときの、テールのX座標。
  146.   MINAS_THREE_X_POS = 444 # $t[-3]のときの、テールのX座標。
  147.   
  148.   POP_DIRECTION = false #イベントの方向を考慮。
  149.   
  150.   THINK_TAIL = 101 #この番号のゲームスイッチがONの時、思案型テールになります。
  151.   SYSTEM_LINE = 102 #この番号のゲームスイッチがONの時、最初の1行を表示しません。
  152.   
  153. end

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

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

  177. #==============================================================================
  178. # 参照機能
  179. #==============================================================================
  180. class Game_Temp
  181.   attr_accessor :last_gain_material
  182.   attr_accessor :last_gain_holder
  183. end
  184.   
  185. #==============================================================================
  186. # ■ Game_Event
  187. #==============================================================================
  188. class Game_Event < Game_Character
  189.   #--------------------------------------------------------------------------
  190.   # ● 公開インスタンス変数
  191.   #--------------------------------------------------------------------------
  192.   attr_reader   :event
  193. end  
  194.   
  195. class Window_Message < Window_Base
  196.   #--------------------------------------------------------------------------
  197.   # ● 改ページ処理
  198.   #--------------------------------------------------------------------------
  199.   def new_page(text, pos)
  200.     contents.clear
  201.     draw_face($game_message.face_name, $game_message.face_index, 0, 0)
  202.     reset_font_settings
  203.     pos[:x] = new_line_x
  204.    
  205.     #変更部分。システム用の一行目を表示しない。
  206.     if $system_line != true and $game_switches[SYSTEM_LINE] != true
  207.       pos[:y] = 0
  208.     else
  209.       if !$game_party.in_battle or $svhuki
  210.         if $now_escape #逃走中。サイドビューでは、逃走中はin_battleがfalse
  211.           pos[:y] = 0
  212.           $now_escape = false
  213.         else
  214.           pos[:y] = 0 - line_height #最初の一行を表示しない。
  215.         end
  216.       else
  217.         pos[:y] = 0
  218.       end
  219.     end

  220.     pos[:new_x] = new_line_x
  221.     pos[:height] = calc_line_height(text)
  222.     clear_flags
  223.   end
  224. end

  225. #==============================================================================
  226. # フルグレードアップベース - 制御文字・基本機能
  227. #==============================================================================
  228. class Window_Message < Window_Base
  229.   attr_accessor :tail
  230.   #--------------------------------------------------------------------------
  231.   # ● 特殊文字の変換 + 準備
  232.   #     変換・消去してもいい部分を処理、フラグのセット。
  233.   #--------------------------------------------------------------------------
  234.   alias xrxsv2_convert_escape_characters convert_escape_characters
  235.   def convert_escape_characters(text)
  236.     #@textsが使いずらいので、ここで別変数に保管。
  237.     @all_texts = []
  238.     str = text.gsub(/\\/) { "\e" }
  239.     @all_texts = str.split("\n")
  240.    
  241.     #この段階で、変数・アクター名を変換してしまう。
  242.     #ネームウィンドウ内の文字を変換するため。
  243.     text = convert_escape_characters_easy(text)
  244.    
  245.     # 初期化
  246.     contents.font.size   = Font.default_size
  247.     contents.font.bold   = Font.default_italic
  248.     contents.font.italic = Font.default_bold
  249.     contents.font.shadow = Font.default_shadow
  250.     @type_wait = 0
  251.     @line_widths = []
  252.     @line_aligns = []
  253.     self.pop_character = nil
  254.     # ウィンドウ保持指定\holdがあるか?
  255.     @window_hold = (text.gsub!(/\\hold/) { "" } != nil)
  256.     # \info
  257.     @info_mode = (text.gsub!(/\\info/) { "" } != nil)
  258.     # 改行削除指定\_があるか?
  259.     if (/\\_(.*?)\x00/.match(@text)) != nil
  260.       $game_message.choice_start -= 1
  261.       text.gsub!(/\\_(.*?)\x00/) { $1.to_s }
  262.     end
  263.     # \name 判定
  264.     if text.sub!(/\\[Nn]ame\[(.*?)\]/) { "" }
  265.       name = $1
  266.       bitmap = @name_sprite.bitmap
  267.       w = [bitmap.text_size(name).width, 1].max + NAME_WINDOW_OFFSET_WIDTH
  268.       bitmap.dispose
  269.       @name_sprite.bitmap = Bitmap.new(w, 32)
  270.       bitmap = @name_sprite.bitmap
  271.       bitmap.draw_text(0, 0, bitmap.width, bitmap.height, name)
  272.       @name_window.width = w + 16
  273.       @name_window.height = bitmap.height + NAME_WINDOW_OFFSET_HIGHT
  274.       @name_window.create_contents
  275.       @name_window.open if @name_window.openness == 0
  276.       if self.visible #名前だけ表示されるのを防止。
  277.         @name_window.visible = true
  278.         @name_sprite.visible = true
  279.       else
  280.         @name_window.visible = false
  281.         @name_sprite.visible = false
  282.       end
  283.     else
  284.       @name_window.visible = false
  285.       @name_sprite.visible = false
  286.       @name_sprite.bitmap.dispose
  287.       @name_sprite.bitmap = Bitmap.new(32,32)
  288.     end
  289.     $name = $1 #あれこれで使うので、ネームウィンドウに表示予定の名前を取得。
  290.     #スキン変更
  291.     if text.sub!(/\\[Ss]kin\[(.*?)\]/) { "" }
  292.       skin = $1
  293.       self.windowskin = Cache.system(skin)
  294.       @name_window.windowskin = Cache.system(skin)
  295.     end
  296.     #ウィンドウトーン変更
  297.     if text.sub!(/\\[Tt]one\[(\-?\d+),(\-?\d+),(\-?\d+),(\-?\d+)\]/) { "" }
  298.       $game_system.window_tone.red = $1.to_f
  299.       $game_system.window_tone.green = $2.to_f
  300.       $game_system.window_tone.blue = $3.to_f
  301.       $game_system.window_tone.gray = $4.to_f
  302.     end
  303.     # キャラボップモード
  304.     if text.gsub!(/\\[Hh]\[-1\]/) { "" }
  305.       self.pop_character = -1
  306.     elsif text.gsub!(/\\[Hh]\[([0-9]+)\]/) { "" }
  307.       self.pop_character = $1.to_i
  308.     elsif text.gsub!(/\\[Hh]\[(.*?)\]/) { "" } #名前指定(サイドビュー対応)
  309.       self.pop_character = 0 #見つからないときのため、最初に0を入力。
  310.       if $game_party.in_battle
  311.         members = $game_party.members + $game_troop.members
  312.         members.each_with_index {|member , index|
  313.           if member.name == $1
  314.             self.pop_character = index +1
  315.             break
  316.           end
  317.         }
  318.       else
  319.         members = $game_map.events
  320.         members.each_with_index {|member , index|
  321.           if member[1].event.name == $1
  322.             self.pop_character = index + 1
  323.             break
  324.           end
  325.         }
  326.       end
  327.     elsif text.gsub!(/\\[Hh]/) { "" }
  328.       self.pop_character = 0
  329.     #テール表示モード
  330.     elsif text.gsub!(/\\[Tt]\[-1\]/) { "" }
  331.       self.tail_character = -1
  332.     elsif text.gsub!(/\\[Tt]\[-2\]/) { "" }
  333.       self.tail_character = -2
  334.     elsif text.gsub!(/\\[Tt]\[-3\]/) { "" }
  335.       self.tail_character = -3
  336.     elsif text.gsub!(/\\[Tt]\[([0-9]+)\]/) { "" }
  337.       self.tail_character = $1.to_i
  338.     elsif text.gsub!(/\\[Tt]/) { "" }
  339.       self.tail_character = 0
  340.     else
  341.       self.pop_character = nil
  342.     end
  343.    
  344.     # 制御文字処理
  345.     text = xrxsv2_convert_escape_characters(text)
  346.     text.gsub!(/\\[Ss]\[([0-9]+)\]/i) { "\eS[#{$1}]" }
  347.     text.gsub!(/\\[Oo]\[([0-9]+)\]/i) { "\eO[#{$1}]" }
  348.     text.gsub!(/\\last_holder/i) { "\e18" }
  349.     text.gsub!(/\\last_material/i) { "\e19" }
  350.     text.gsub!(/\\B/) { "\eB" }
  351.     text.gsub!(/\\D/) { "\eD" }
  352.     #text.gsub!(/\\n/) { "\n" }
  353.     #
  354.     # ライン情報の取得
  355.     rxs = ["\x01","\x02","\x03","\x04","\x05","\x06","\x07","\x08",
  356.       /\[([0-9]+)\]/,
  357.       "\x11","\x12","\x13","\x14", "\x15", "\x16", "\x17", "\x18","\x19"]
  358.     lines = text.split("\x00")
  359.     @lines_max = lines.size
  360.     for i in 0...@lines_max
  361.       line = lines[i]
  362.       for rx in rxs
  363.         line.gsub!(rx) {""}
  364.       end
  365.       @line_aligns[i] =
  366.         line.sub!(/\\center/) {""} ? CENTER :
  367.         line.sub!(/\\right/)  {""} ? RIGHT :
  368.                                      AUTO
  369.       # 行の横幅の取得と設定
  370.       cx = text_width_no_escape(line,text) #test
  371.       #cx = contents.text_size(line,text).width
  372.       @line_widths[i] = cx
  373.     end
  374.     # 位置揃え制御文字の削除
  375.     text.gsub!(/\\center/) {""}
  376.     text.gsub!(/\\right/) {""}
  377.     # キャラポップ時のウィンドウリサイズ
  378.     reszie_window_for_pop
  379.    
  380.     del_tail # if @tail != nil
  381.     # $mes_id が空のときと戦闘中はふきだしを表示しない
  382.     if defined?($game_system.show_stand_picture) #立ち絵に対応。
  383.       $mes_id = -1 if $game_system.show_stand_picture == true
  384.     end
  385.     if $mes_id != nil and (!$game_party.in_battle or $svhuki)
  386.       # ふきだしのテールを描画
  387.       skin = "Window"
  388.       if @background == 0
  389.         #画像の準備
  390.         @tail = Sprite.new
  391.         @tail.visible = false
  392.         # 位置を取得
  393.         tale_pos = get_tale_pos
  394.         if $win_x != nil
  395.           if $win_x > 0
  396.             @tail.bitmap = Cache.system(skin + "-right")
  397.             @tail.x = tale_pos[0]
  398.             @tail.y = tale_pos[1]
  399.             @tail.z = self.z + 1
  400.           elsif  $win_x < 0
  401.             @tail.bitmap = Cache.system(skin + "-left")
  402.             @tail.x = tale_pos[0]
  403.             @tail.y = tale_pos[1]
  404.             @tail.z = self.z + 1
  405.           else
  406.             create_tail_up_under
  407.           end
  408.         else
  409.           create_tail_up_under
  410.         end
  411.         # エクストラスプライトに登録
  412.         @extra_sprites = [] if @extra_sprites.nil?
  413.         @extra_sprites.push(@tail) if @tail != nil
  414.         # 更新
  415.         update_tail
  416.       end
  417.     end

  418.     open_and_wait #リサイズが終わった時点でウィンドウオープン。
  419.    
  420.     return text
  421.   end
  422.   #--------------------------------------------------------------------------
  423.   # ● 制御文字の変換。
  424.   #    変数・パーティ名・アクター名・所持金のみ変換する。
  425.   #    文字「\」はエスケープ文字(\e)に変換。
  426.   #--------------------------------------------------------------------------
  427.   def convert_escape_characters_easy(text)
  428.     result = text.to_s.clone
  429.     result.gsub!(/\\[vV]\[/)          { "\eV\[" }
  430.     result.gsub!(/\\[nN]\[/)          { "\eN\[" }
  431.     result.gsub!(/\\[pP]\[/)          { "\eP\[" }
  432.     result.gsub!(/\\[gG]/)          { "\eG" }
  433.     result.gsub!(/\eV\[(\d+)\]/i) { $game_variables[$1.to_i] }
  434.     result.gsub!(/\eV\[(\d+)\]/i) { $game_variables[$1.to_i] }
  435.     result.gsub!(/\eN\[(\d+)\]/i) { actor_name($1.to_i) }
  436.     result.gsub!(/\eP\[(\d+)\]/i) { party_member_name($1.to_i) }
  437.     result.gsub!(/\eG/i)          { Vocab::currency_unit }
  438.     result
  439.   end
  440.   #--------------------------------------------------------------------------
  441.   # ● 文字の長さを取得する。エスケープ文字は含まない。
  442.   # line : 表示しようとしている全ての文字列。
  443.   # text : その列の文字。
  444.   #--------------------------------------------------------------------------
  445.   def text_width_no_escape(line , text_o)
  446.     add = 5 #微妙に足りないので水増し。
  447.     text = Marshal.load(Marshal.dump(text_o))
  448.     text.gsub!(/\ehold/) { "" }
  449.     text.gsub!(/\einfo/) { "" }
  450.     # 改行削除指定\_があるか?
  451.     if (/\\_(.*?)\x00/.match(@text)) != nil
  452.       $game_message.choice_start -= 1
  453.       text.gsub!(/\\_(.*?)\x00/) { "" }
  454.     end
  455.     # \name 判定
  456.     text.sub!(/\e[Nn]ame\[(.*?)\]/) { "" }
  457.     text.gsub!(/\e[Hh]\[-1\]/) { "" }
  458.     text.gsub!(/\e[Hh]\[([0-9]+)\]/) { "" }
  459.     text.gsub!(/\e[Hh]/) { "" }
  460.     text.gsub!(/\e[Tt]\[-1\]/) { "" }
  461.     text.gsub!(/\e[Tt]\[-2\]/) { "" }
  462.     text.gsub!(/\e[Tt]\[-3\]/) { "" }
  463.     text.gsub!(/\e[Tt]\[([0-9]+)\]/) { "" }
  464.     text.gsub!(/\e[Tt]/) { "" }
  465.     # 制御文字処理
  466.     text.gsub!(/\e[Ss]\[([0-9]+)\]/i) { "" }
  467.     text.gsub!(/\e[Oo]\[([0-9]+)\]/i) { "" }
  468.     text.gsub!(/\elast_holder/i) { "" }
  469.     text.gsub!(/\elast_material/i) { "" }
  470.     #text.gsub!(/\eV/) { "" } #変数に置き換える。
  471.     #text.gsub!(/\eN/) { "" } #名前へ置き換える。
  472.     #text.gsub!(/\eP/) { "" } #名前へ置き換える。
  473.     #text.gsub!(/\eG/) { "" } #金額へ置き換える。
  474.     text.gsub!(/\eC\[([0-9]+)\]/) { "" }
  475.     text.gsub!(/\eB/) { "" }
  476.     text.gsub!(/\eD/) { "" }
  477.     if text =~ /\eI/
  478.       loop do
  479.         if str = text.sub!(/\eI\[(\d+)\]/){ "" }
  480.           add += 24
  481.         else
  482.           break
  483.         end
  484.       end
  485.     end
  486.     #text.gsub!(/\\n/) { "\n" }
  487.     text.sub!(/\ecenter/) {""}
  488.     text.sub!(/\eright/)  {""}
  489.     text.gsub!(/\ecenter/) {""}
  490.     text.gsub!(/\eright/) {""}
  491.    
  492.     text = xrxsv2_convert_escape_characters(text)
  493.     basic_width = text_size(text).width + add
  494.     esc = text.scan(/\e(\S)/)
  495.     return ( basic_width - esc.size * (contents.font.size - 4) ) #\eの幅は20?
  496.   end
  497.   #--------------------------------------------------------------------------
  498.   # ● 最も長い列の長さを調べる。エスケープ文字は含まない。
  499.   #--------------------------------------------------------------------------
  500.   def max_width
  501.     text_size = []
  502.     for i in 0 ... @all_texts.size
  503.       text_size.push text_width_no_escape(@all_texts[i],@all_texts[i]) + 20
  504.     end
  505.     return text_size.max
  506.   end
  507.   #--------------------------------------------------------------------------
  508.   # ● 吹きだしテールが上か下の場合の画像を準備。
  509.   #--------------------------------------------------------------------------
  510.   def create_tail_up_under
  511.     skin = "Window"
  512.     tale_pos = get_tale_pos
  513.     case @position
  514.     when 0  # 上
  515.       @tail.bitmap = Cache.system(skin + "-top")
  516.       @tail.x = tale_pos[0]
  517.       @tail.y = tale_pos[1]
  518.       @tail.z = self.z + 1
  519.     when 1  # 中
  520.       @tail.dispose
  521.       @tail = nil
  522.     when 2  # 下
  523.       @tail.bitmap = Cache.system(skin + "-under")
  524.       @tail.x = tale_pos[0]
  525.       @tail.y = tale_pos[1]
  526.       @tail.z = self.z + 1
  527.     end
  528.   end
  529.   #--------------------------------------------------------------------------
  530.   # ● 全テキストの処理
  531.   #--------------------------------------------------------------------------
  532.   def process_all_text
  533.     #open_and_wait #リサイズがあるので、すぐにウィンドウをオープンしない。
  534.     text = convert_escape_characters($game_message.all_text)
  535.     pos = {}
  536.     new_page(text, pos)
  537.     process_character(text.slice!(0, 1), text, pos) until text.empty?
  538.   end
  539.   #--------------------------------------------------------------------------
  540.   # ● メッセージの更新 *
  541.   #--------------------------------------------------------------------------
  542.   def update_message
  543.     @wait_count = @type_wait
  544.     loop do
  545.       c = @text.slice!(/./m)
  546.       case update_message_type(c)
  547.       when 1
  548.         break
  549.       when 2
  550.         next
  551.       end
  552.       break unless @show_fast or @line_show_fast
  553.     end
  554.   end
  555.   #--------------------------------------------------------------------------
  556.   # 一文字の描画 (返り値 1:break, 2:next)
  557.   #--------------------------------------------------------------------------
  558. #=begin
  559.   def process_escape_character(code, text, pos)
  560.     case code.upcase
  561.     when '$'
  562.       @gold_window.open
  563.     when '.'
  564.       wait(15)
  565.     when '|'
  566.       wait(60)
  567.     when '!'
  568.       input_pause
  569.     when '>'
  570.       @line_show_fast = true
  571.     when '<'
  572.       @line_show_fast = false
  573.     when '^'
  574.       @pause_skip = true
  575.     #when 'n'                      # 改行
  576.     #  new_line
  577.     #  max = MAX_LINE
  578.     #  max = 14 if self.pop_character != nil
  579.     #  if @line_count >= max      # 行数が最大のとき
  580.     #    unless @text.empty?           # さらに続きがあるなら
  581.     #      self.pause = true           # 入力待ちを入れる
  582.           #return 1
  583.     #    end
  584.     #  end
  585.     #when 'S'                       # \S[n]  (スピード変更)
  586.     #  text.sub!(/\[([0-9]+)\]/, "")
  587.     #  @type_wait = $1.to_i
  588.     #  return 2
  589.     when 'O'                       # \O 文字を透明にする。
  590.       text.sub!(/\[([0-9]+)\]/, "")
  591.       contents.font.color.alpha = $1.to_i
  592.       #return 2
  593.     when 'D' #\D 文字に影をつける
  594.       contents.font.shadow ^= true
  595.     #when '18'
  596.     #  name = ($game_temp.last_gain_holder.name rescue "")
  597.     #  update_message_type_draw_at(name)
  598.     #when '19'
  599.     #  item = ($game_temp.last_gain_material.item rescue nil)
  600.     #  draw_item_name(item, @contents_x, @contents_y)
  601.     #  @contents_x += 196
  602.     else
  603.       super
  604.     end
  605.         
  606.   end
  607. #=end
  608.   #--------------------------------------------------------------------------
  609.   # ● 改ページ処理
  610.   #--------------------------------------------------------------------------
  611.   alias xrxsv2_new_page new_page
  612.   def new_page(text, pos)
  613.     xrxsv2_new_page(text, pos)
  614.     update_charpop_window
  615.   end
  616.   #--------------------------------------------------------------------------
  617.   # ● 改行位置の取得
  618.   #--------------------------------------------------------------------------
  619.   #def new_line_x
  620.   #  $game_message.face_name.empty? ? 0 : 112
  621.   #end
  622.   #--------------------------------------------------------------------------
  623.   # ● 改行処理
  624.   #--------------------------------------------------------------------------
  625.   alias xrxsv2_new_line_x new_line_x
  626.   def new_line
  627.     xrxsv2_new_line
  628.     set_align
  629.   end
  630.   #--------------------------------------------------------------------------
  631.   # 位置揃え
  632.   #--------------------------------------------------------------------------
  633.   def set_align
  634.     w = @line_widths[@line_count].to_i
  635.     a = @line_aligns[@line_count]
  636.     case a
  637.     when CENTER
  638.       @contents_x = @contents_x + ((contents.width - @contents_x) - w) / 2
  639.     when RIGHT
  640.       @contents_x = contents.width - w
  641.     end
  642.   end
  643.   #--------------------------------------------------------------------------
  644.   # ● ファイバーのメイン処理 ☆再定義
  645.   #--------------------------------------------------------------------------
  646.   def fiber_main
  647.     $game_message.visible = true
  648.     update_background
  649.     update_placement
  650.     loop do
  651.       process_all_text if $game_message.has_text?
  652.       process_input
  653.       $game_message.clear
  654.       @gold_window.close
  655.       process_hold #ホールドウィンドウの処理。
  656.       Fiber.yield
  657.       break unless text_continue?
  658.     end
  659.     close_and_wait
  660.     $game_message.visible = false
  661.     @fiber = nil
  662.   end
  663.   #--------------------------------------------------------------------------
  664.   # 定数
  665.   #--------------------------------------------------------------------------
  666.   AUTO   = 0
  667.   LEFT   = 1
  668.   CENTER = 2
  669.   RIGHT  = 3
  670. end
  671. #==============================================================================
  672. # アクティブイベント取得
  673. #==============================================================================
  674. class Game_Interpreter
  675.   attr_reader   :event_id
  676. end


  677. #==============================================================================
  678. # 各種機能の追加 - キャラポップ/ネーム/ホールド
  679. #==============================================================================
  680. class Window_Message < Window_Base
  681.   #--------------------------------------------------------------------------
  682.   # ● カーソルの更新 *
  683.   #--------------------------------------------------------------------------
  684.   def update_cursor
  685.     if @index >= 0
  686.       x = ($game_message.face_name.empty? ? 0 : 112)
  687.       y = ($game_message.choice_start + @index) * WLH - 1
  688.       w = contents.width - x
  689.       if self.pop_character != nil
  690.         x += 28
  691.         w -= 20
  692.       end
  693.       self.cursor_rect.set(x, y, w, WLH)
  694.     else
  695.       self.cursor_rect.empty
  696.     end
  697.   end
  698.   #--------------------------------------------------------------------------
  699.   # キャラクターの取得
  700.   #   parameter : パラメータ
  701.   #--------------------------------------------------------------------------
  702.   def get_character(parameter)
  703.     # パラメータで分岐
  704.     case parameter
  705.     when -1  # プレイヤー
  706.       return $game_player
  707.     when 0  # 現在アクティブなイベント
  708.       id = $game_map.interpreter.event_id
  709.       events = $game_map.events
  710.       return events == nil ? nil : events[id]
  711.     else  # 特定のイベント
  712.       if $game_party.in_battle and $svhuki #サイドビュー対応
  713.         battle_chara = [nil] + $game_party.members + $game_troop.members
  714.         return battle_chara[parameter]
  715.       else
  716.         events = $game_map.events
  717.         return events == nil ? nil : events[parameter]
  718.       end  
  719.     end
  720.   end
  721.   #--------------------------------------------------------------------------
  722.   # (メッセージ終了時)ホールドの処理
  723.   #--------------------------------------------------------------------------
  724.   def process_hold
  725.     if @window_hold
  726.       @held_windows.push(Window_Copy.new(self))
  727.       @held_windows.push(Window_Copy.new(@name_window))
  728.       @held_windows.push(Sprite_Copy.new(@name_sprite))
  729.       @held_windows.push(Sprite_Copy.new(@back_sprite))
  730.       for sprite in @extra_sprites
  731.         next if sprite.disposed?
  732.         @held_windows.push(Sprite_Copy.new(sprite))
  733.       end
  734.       @extra_sprites.clear
  735.       self.openness = 0
  736.       #@name_window.openness = 0
  737.       @back_sprite.visible = false
  738.     else
  739.       @held_windows.each {|object| object.dispose}
  740.       @held_windows.clear
  741.     end
  742.     #@name_window.close
  743.     #@name_sprite.visible = false
  744.   end
  745.   #--------------------------------------------------------------------------
  746.   # キャラポップ位置の設定と取得
  747.   #--------------------------------------------------------------------------
  748.   def pop_character=(character_id)
  749.     @pop_character = character_id
  750.   end
  751.   def pop_character
  752.     return @pop_character
  753.   end
  754.   #--------------------------------------------------------------------------
  755.   # キャラポップ時のウィンドウリサイズ
  756.   #--------------------------------------------------------------------------
  757.   def reszie_window_for_pop
  758.     #キャラポップ
  759.     if self.pop_character != nil
  760.       #max_x = @line_widths.max.to_i
  761.       #n  = max_x + 32
  762.       n = 0
  763.       n += $game_message.face_name.empty? ? 0 : 122
  764.       m  = $game_message.face_name.empty? ? 0 : 96
  765.       w  = @name_sprite.bitmap.width
  766.       self.width  = max_width + n
  767.       self.height = [@all_texts.size * line_height, m].max + 32
  768.       
  769.       #システム用の一行目を表示しない。
  770.       if $system_line or $game_switches[SYSTEM_LINE]
  771.         self.height -= line_height if !$game_party.in_battle or $svhuki
  772.       end
  773.       
  774.       create_contents
  775.       update_charpop_window
  776.     elsif @info_mode
  777.       @line_aligns[0] = CENTER
  778.       self.x = - 8
  779.       self.width = Graphics.width + 16
  780.       self.height = 56
  781.       create_contents
  782.     else
  783.       self.x = 0
  784.       self.width  = Graphics.width
  785.       self.height = MAX_LINE * line_height + 32
  786.       update_placement #位置情報修正。
  787.       create_contents
  788.     end
  789.   end
  790.   #--------------------------------------------------------------------------
  791.   # ● 背景スプライトの作成
  792.   #--------------------------------------------------------------------------
  793.   alias xrxsv2_create_back_sprite create_back_sprite
  794.   def create_back_sprite
  795.     xrxsv2_create_back_sprite
  796.     @back_sprite.zoom_x = 1.0 * Graphics.width / @back_sprite.bitmap.width
  797.     @name_window = Window_Base.new(0,0,112,32)
  798.     @name_window.visible = false
  799.     @name_sprite = Sprite.new
  800.     @name_sprite.bitmap = Bitmap.new(32,32)
  801.     @name_sprite.visible = false
  802.     self.x = self.x
  803.     self.y = self.y
  804.     self.z = self.z
  805.     @held_windows = []
  806.     @extra_sprites = []
  807.   end
  808.   #--------------------------------------------------------------------------
  809.   # ● 背景スプライトの解放
  810.   #--------------------------------------------------------------------------
  811.   alias xrxsv2_dispose_back_sprite dispose_back_sprite
  812.   def dispose_back_sprite
  813.     xrxsv2_dispose_back_sprite
  814.     @name_window.dispose if @name_window != nil #メニュー画面を出そうとするとエラー?
  815.     @name_sprite.dispose if @name_sprite != nil
  816.     for window in @held_windows
  817.       window.dispose
  818.     end
  819.   end
  820.   #--------------------------------------------------------------------------
  821.   # ● 背景スプライトの更新
  822.   #--------------------------------------------------------------------------
  823.   alias xrxsv2_update_back_sprite update_back_sprite
  824.   def update_back_sprite
  825.     @name_window.update
  826.     xrxsv2_update_back_sprite
  827.     update_charpop_window
  828.   end
  829.   #--------------------------------------------------------------------------
  830.   # ウィンドウの位置と不透明度の設定 (キャラポップ)
  831.   #--------------------------------------------------------------------------
  832.   def update_charpop_window
  833.     if self.pop_character
  834.       character = get_character(self.pop_character)
  835.       return if character == nil
  836.       
  837.       if defined?(character.sv) and $svhuki #サイドビュー対応
  838.         chara_x = character.sv.x / 100 #- $sv_camera.x * 2
  839.         chara_y = character.sv.y / 100 #- $sv_camera.y
  840.       else
  841.         chara_x = character.screen_x
  842.         chara_y = character.screen_y
  843.       end
  844.       
  845.       # [X座標]
  846.       n = self.width / 2
  847.       n = [n, @name_skin.width + 16].max if @current_name != nil
  848.       w = @name_sprite.bitmap.width
  849.       x = chara_x - [[n, w].max, self.width - 32].min
  850.       
  851.       # [Y座標]
  852.       if self.pop_character == 0 and POP_DIRECTION #イベントの方向を考慮。
  853.         if character.direction == 2 #下向き
  854.           @position = 0 #上にポップ
  855.         elsif character.direction == 2 #上向き
  856.           @position = 2 #下にポップ
  857.         end
  858.       end
  859.       case @position
  860.       when 0
  861.         y = chara_y - CHARPOP_HEIGHT - self.height
  862.       else
  863.         y = chara_y + 16
  864.       end
  865.       x_max = Graphics.width - 4 - self.width
  866.       x_min = 4
  867.       y_max = Graphics.height - self.height
  868.       y_min = 4
  869.       self.x = [[x, x_max].min, x_min].max
  870.       self.y = [[y, y_max].min, y_min].max
  871.     end
  872.   end
  873.   #--------------------------------------------------------------------------
  874.   # 位置の連動
  875.   #--------------------------------------------------------------------------
  876.   def x=(n)
  877.     super
  878.     if @name_window
  879.       if $name_right
  880.         @name_window.x = n + self.width - @name_window.width - NAME_WINDOW_OFFSET_X
  881.         @name_sprite.x = @name_window.x + 8 + NAME_WINDOW_OFFSET_WIDTH / 2
  882.       else
  883.         @name_window.x = n + NAME_WINDOW_OFFSET_X
  884.         @name_sprite.x = @name_window.x + 8 + NAME_WINDOW_OFFSET_WIDTH / 2
  885.       end
  886.     end
  887.   end
  888.   def y=(n)
  889.     super
  890.     if @name_window
  891.       @name_window.y = n + NAME_WINDOW_OFFSET_Y
  892.       @name_sprite.y = n + NAME_WINDOW_OFFSET_Y + 2 + NAME_WINDOW_OFFSET_HIGHT / 2
  893.     end
  894.   end
  895.   def z=(n)
  896.     super
  897.     if @name_window
  898.       @name_window.z = n + 11#1 テールの上に表示されるので、Zを水増しする。
  899.       @name_sprite.z = n + 12#2
  900.     end
  901.   end
  902.   #--------------------------------------------------------------------------
  903.   # ● ファイバーのメイン処理
  904.   #--------------------------------------------------------------------------
  905.   def fiber_main_namewin
  906.     fiber_main_namewin_default
  907.     @name_window.openness = 0
  908.     @name_sprite.bitmap.clear
  909.     $name = ""
  910.   end
  911.   alias :fiber_main_namewin_default :fiber_main
  912.   alias :fiber_main :fiber_main_namewin
  913. end
  914. #==============================================================================
  915. # 伸縮対応
  916. #==============================================================================
  917. class Window_Message < Window_Base
  918.   #--------------------------------------------------------------------------
  919.   # ● ウィンドウの背景と位置の設定 [再定義]
  920.   #--------------------------------------------------------------------------
  921.   def reset_window
  922.     @background = $game_message.background
  923.     @position = $game_message.position
  924.     if @background == 0   # 通常ウィンドウ
  925.       self.opacity = 255
  926.     else                  # 背景を暗くする、透明にする
  927.       self.opacity = 0
  928.     end
  929.     case @position
  930.     when 0  # 上
  931.       self.y = 0
  932.       @gold_window.y = 360
  933.     when 1  # 中
  934.       self.y = (Graphics.height - self.height) / 2
  935.       @gold_window.y = 0
  936.     when 2  # 下
  937.       self.y = Graphics.height - self.height
  938.       @gold_window.y = 0
  939.     end
  940.   end
  941. end
  942. #==============================================================================
  943. # □ Window_Copy
  944. #------------------------------------------------------------------------------
  945. #   指定のウィンドウのコピーを作成します。
  946. #==============================================================================
  947. class Window_Copy < Window_Base
  948.   #--------------------------------------------------------------------------
  949.   # ○ オブジェクト初期化
  950.   #--------------------------------------------------------------------------
  951.   def initialize(window)
  952.     super(window.x, window.y, window.width, window.height)
  953.     self.contents = window.contents.dup unless window.contents.nil?
  954.     self.opacity = window.opacity
  955.     self.back_opacity = window.back_opacity
  956.     self.z = window.z - 3
  957.     self.visible = window.visible
  958.   end
  959. end
  960. #==============================================================================
  961. # □ Sprite_Copy
  962. #------------------------------------------------------------------------------
  963. #   指定のスプライトのコピーを作成します。
  964. #==============================================================================
  965. class Sprite_Copy < Sprite
  966.   #--------------------------------------------------------------------------
  967.   # ○ オブジェクト初期化
  968.   #--------------------------------------------------------------------------
  969.   def initialize(sprite)
  970.     super()
  971.     self.bitmap = sprite.bitmap.dup unless sprite.bitmap.nil?
  972.     self.opacity = sprite.opacity
  973.     self.x = sprite.x
  974.     self.y = sprite.y
  975.     self.z = sprite.z - 3
  976.     self.ox = sprite.ox
  977.     self.oy = sprite.oy
  978.     self.zoom_x = sprite.zoom_x
  979.     self.visible = sprite.visible
  980.   end
  981. end



  982. #■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□
  983. #■吹きだしテールの表示ルーチン。
  984. #■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□
  985. #==============================================================================
  986. # +++ 「+ふきだし表示」VX +++
  987. # by パラ犬  [url]http://2d6.parasite.jp/[/url]
  988. #      ×
  989. #    row       [url]http://xms.rdy.jp/[/url]
  990. #
  991. # publish 2010/ 3/ 2
  992. # update  -
  993. #
  994. #------------------------------------------------------------------------------
  995. #    ほぼどんなメッセージウィンドウに対しても後付け可能な「ふきだし表示」です。
  996. #  また、テール部分のみの自動追尾機能を持ちます。
  997. #   ふきだし表示をするには、
  998. #  テール用画像「Window-top」「Window-under」を
  999. #  「Graphics/System」フォルダにインポートしておく必要があります。
  1000. #==============================================================================
  1001. # ■ Window_Message
  1002. #==============================================================================
  1003. class Window_Message < Window_Base
  1004.   #--------------------------------------------------------------------------
  1005.   # ● メッセージの開始
  1006.   #--------------------------------------------------------------------------
  1007.   alias parashelf_update_all_windows update_all_windows
  1008.   def update_all_windows
  1009.     parashelf_update_all_windows
  1010.     update_tail
  1011.   end
  1012.   #--------------------------------------------------------------------------
  1013.   # クローズ [オーバーライド]
  1014.   #--------------------------------------------------------------------------
  1015.   def close
  1016.     super
  1017.     del_tail
  1018.     @name_window.close if @name_window != nil #ネームウィンドウのクローズ動作。
  1019.   end
  1020.   #--------------------------------------------------------------------------
  1021.   # ● 背景スプライトの更新
  1022.   #--------------------------------------------------------------------------
  1023.   alias parashelf_update_back_sprite update_back_sprite
  1024.   def update_back_sprite
  1025.     parashelf_update_back_sprite
  1026.     update_tail
  1027.   end
  1028.   #--------------------------------------------------------------------------
  1029.   # ○ フレーム更新 (ふきだしテールの更新)
  1030.   #--------------------------------------------------------------------------
  1031.   def update_tail
  1032.     # ふきだしモードではイベントの動きに追従
  1033.     if $mes_id != nil and @tail != nil
  1034.       tale_pos = get_tale_pos
  1035.       @tail.x = tale_pos[0]
  1036.       @tail.y = tale_pos[1]
  1037.       update_tail_bitmap
  1038.     end
  1039.   end
  1040.   ##--------------------------------------------------------------------------
  1041.   # ○ ふきだしテールの画像を更新。
  1042.   #--------------------------------------------------------------------------
  1043.   def update_tail_bitmap
  1044.     skin = "Window"
  1045.     skin = "Think" if $game_switches[THINK_TAIL]
  1046.     if $win_x != nil
  1047.       if $win_x > 0
  1048.         @tail.bitmap = Cache.system(skin + "-right")
  1049.       elsif  $win_x < 0
  1050.         @tail.bitmap = Cache.system(skin + "-left")
  1051.       else
  1052.         case @position
  1053.         when 0  # 上
  1054.           @tail.bitmap = Cache.system(skin + "-top")
  1055.         when 2  # 下
  1056.           @tail.bitmap = Cache.system(skin + "-under")
  1057.         end
  1058.       end
  1059.     else
  1060.       case @position
  1061.       when 0  # 上
  1062.         @tail.bitmap = Cache.system(skin + "-top")
  1063.       when 2  # 下
  1064.         @tail.bitmap = Cache.system(skin + "-under")
  1065.       end
  1066.     end
  1067.     # 可視状態
  1068.     if self.visible == true
  1069.       @tail.visible = self.openness == 255
  1070.     else
  1071.       @tail.visible = false
  1072.     end
  1073.   end
  1074.   #--------------------------------------------------------------------------
  1075.   # ○ テールの位置を計算
  1076.   #--------------------------------------------------------------------------
  1077.   def get_tale_pos
  1078.     if defined?($game_system.show_stand_picture) #A1立ち絵スクリプトを入れている。
  1079.       if $game_system.show_stand_picture #立ち絵on
  1080.         pos = get_tale_pos_stand_pic
  1081.       else
  1082.         pos = get_tale_pos_normal
  1083.       end
  1084.     else
  1085.       pos = get_tale_pos_normal
  1086.     end
  1087.     return pos
  1088.   end
  1089.   #--------------------------------------------------------------------------
  1090.   # ○ テールの位置を計算/立ち絵使用時。※NAME_CHANGEの編集必須。
  1091.   #--------------------------------------------------------------------------
  1092.   def get_tale_pos_stand_pic
  1093.     if $game_message.face_name != ""  and @tail != nil
  1094.       target_name = $game_message.face_name + "_" + $game_message.face_index.to_s
  1095.       name = A1_System::StandPicture::NAME_CHANGE[target_name]
  1096.       chara = name[0] if name != nil
  1097.       if @stand_pic[chara] != nil #立ち絵無しの場合通常通り。
  1098.         x = @stand_pic[chara].pic_sprite.x + @stand_pic[chara].pic_sprite.width / 2
  1099.         y = get_tale_pos_normal_updown
  1100.         update_tail_bitmap
  1101.       else
  1102.         return get_tale_pos_normal #立ち絵が見つからない場合は通常通り。
  1103.       end
  1104.     else
  1105.       return get_tale_pos_normal #立ち絵が見つからない場合は通常通り。
  1106.     end
  1107.     return [x,y]
  1108.   end
  1109.   #--------------------------------------------------------------------------
  1110.   # ○ テールの位置を計算/立ち絵未使用時。
  1111.   #--------------------------------------------------------------------------
  1112.   def get_tale_pos_normal
  1113.     if $mes_id == (-2) #左右の場合は高さはウィンドウ中心。上下ならやや左に配置。
  1114.       if $win_x != nil
  1115.         if $win_x > 0
  1116.           x = $win_x - @tail.width / 2
  1117.           y = self.y + self.height / 2 - @tail.height / 2
  1118.         elsif $win_x < 0
  1119.           x = self.width - @tail.width / 2
  1120.           y = self.y + self.height / 2 - @tail.height / 2
  1121.         else
  1122.           x = MINAS_TWE_X_POS
  1123.           y = get_tale_pos_normal_updown
  1124.         end
  1125.       else
  1126.         x = MINAS_TWE_X_POS
  1127.         y = get_tale_pos_normal_updown
  1128.       end
  1129.     elsif $mes_id <= (-3) #左右の場合は高さはウィンドウ中心。上下ならやや左に配置。
  1130.       if $win_x != nil
  1131.         if $win_x > 0
  1132.           x = $win_x - @tail.width / 2
  1133.           y = self.y + self.height / 2
  1134.         elsif $win_x < 0
  1135.           x = self.width - @tail.width / 2
  1136.           y = self.y + self.height / 2
  1137.         else
  1138.           x = MINAS_THREE_X_POS
  1139.           y = get_tale_pos_normal_updown
  1140.         end
  1141.       else
  1142.         x = MINAS_THREE_X_POS
  1143.         y = get_tale_pos_normal_updown
  1144.       end
  1145.     else
  1146.       character = get_character($mes_id)
  1147.       
  1148.       if defined?(character.sv) and $svhuki #サイドビュー対応
  1149.         if $sv_camera.mirror #バックアタック
  1150.           chara_x = character.sv.x / 100 - $sv_camera.x
  1151.         else
  1152.           chara_x = character.sv.x / 100 - $sv_camera.x * 2
  1153.         end
  1154.         chara_y = character.sv.y / 100 - $sv_camera.y
  1155.       else
  1156.         chara_x = character.screen_x
  1157.         chara_y = character.screen_y
  1158.       end
  1159.       
  1160.       x = [[chara_x - 16, self.x].max, self.x + self.width - 32].min
  1161.       if $win_x != nil
  1162.         if $win_x > 0
  1163.           x = $win_x - @tail.width / 2
  1164.           y = chara_y
  1165.         elsif $win_x < 0
  1166.           x = self.width
  1167.           y = chara_y
  1168.         else
  1169.           y = get_tale_pos_normal_updown
  1170.         end
  1171.       else
  1172.         y = get_tale_pos_normal_updown
  1173.       end
  1174.     end
  1175.     return [x, y]
  1176.   end
  1177.   #--------------------------------------------------------------------------
  1178.   # ○ テールが上下の時、かつ[-2][-3]でない時のy座標の取得。
  1179.   #--------------------------------------------------------------------------
  1180.   def get_tale_pos_normal_updown
  1181.     case @position
  1182.     when 0
  1183.       y = self.y + self.height - @tail.height / 2
  1184.     else
  1185.       y = self.y - @tail.height / 2
  1186.     end
  1187.     return y
  1188.   end
  1189.   #--------------------------------------------------------------------------
  1190.   # ○ ふきだしを破棄
  1191.   #--------------------------------------------------------------------------
  1192.   def del_tail
  1193.     if @tail != nil
  1194.       @tail.dispose
  1195.       @tail = nil
  1196.     end
  1197.   end
  1198. end
  1199. #
  1200. # ▼▲▼ XRXS 9拡張CO-X. ふきだし自動設定 ▼▲▼
  1201. #==============================================================================
  1202. # ■ Window_Message
  1203. #==============================================================================
  1204. class Window_Message < Window_Base
  1205.   #--------------------------------------------------------------------------
  1206.   # ○ ポップキャラクターの設定
  1207.   #--------------------------------------------------------------------------
  1208.   def pop_character=(character_id)
  1209.     @pop_character = character_id
  1210.     $mes_id = character_id
  1211.   end
  1212.   #--------------------------------------------------------------------------
  1213.   # ○ テールキャラクターの設定
  1214.   #--------------------------------------------------------------------------
  1215.   def tail_character=(character_id)
  1216.     #@pop_character = character_id
  1217.     $mes_id = character_id
  1218.   end
  1219. end


  1220. #==============================================================================
  1221. # ■ Window_ChoiceList
  1222. #------------------------------------------------------------------------------
  1223. #  イベントコマンド[選択肢の表示]で、Y座標を修正します。
  1224. #==============================================================================
  1225. class Window_ChoiceList < Window_Command
  1226.   #--------------------------------------------------------------------------
  1227.   # ● ウィンドウ位置の更新
  1228.   #--------------------------------------------------------------------------
  1229.   def update_placement_hukidasi
  1230.     #self.width = [max_choice_width + 12, 96].max + padding * 2
  1231.     #self.width = [width, Graphics.width].min
  1232.     #self.height = fitting_height($game_message.choices.size)
  1233.     #self.x = Graphics.width - width
  1234.     #if @message_window.y >= Graphics.height / 2
  1235.     #  self.y = @message_window.y - height
  1236.     #else
  1237.     #  self.y = @message_window.y + @message_window.height
  1238.     #end
  1239.     update_placement_hukidasi_default
  1240.     if self.y + self.height > Graphics.height
  1241.       self.y -= ( ( self.height + self.y ) - Graphics.height)
  1242.       self.z += 100
  1243.     end
  1244.   end
  1245.   alias :update_placement_hukidasi_default :update_placement
  1246.   alias :update_placement :update_placement_hukidasi
  1247. end

  1248. #==============================================================================
  1249. # ■ Scene_Menu
  1250. #------------------------------------------------------------------------------
  1251. #  メニューを開いてからウィンドウが出るとネームウィンドウが表示される不具合修正。
  1252. #==============================================================================
  1253. #class Scene_Menu < Scene_MenuBase
  1254. #  def terminate_hukidasi_menyu
  1255. #    @name_window.openness = 0 if @name_window != nil
  1256. #    terminate_hukidasi_menyu_default
  1257. #  end
  1258. #  alias :terminate_hukidasi_menyu_default :terminate
  1259. #  alias :terminate :terminate_hukidasi_menyu
  1260. #end

  1261. #■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□
  1262. #■ウィンドウ非表示ルーチン
  1263. #■吹きだしテールとネームウィンドウに対応。
  1264. #■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□
  1265. #==============================================================================
  1266. # L(キーボードのQ)を押すと、メッセージウィンドウを表示・非表示
  1267. #==============================================================================
  1268. class Window_Message < Window_Base
  1269.   def update_winoff
  1270.     unless $game_party.in_battle #バトル中は無効。
  1271.       if Input.trigger?(Input::L)
  1272.         if self.visible == true
  1273.           self.visible = false
  1274.           @background = 777 if @back_sprite != nil and @background == 1 #「背景を暗くする」
  1275.           @tail.visible = false if @tail != nil
  1276.         else
  1277.           self.visible = true
  1278.           @background = 1 if @back_sprite != nil and @background == 777 #「背景を暗くする」
  1279.         end
  1280.         if @name_window != nil
  1281.           if @name_window.visible == false and $name != nil and $name != ""
  1282.             @name_window.visible = true
  1283.             @name_sprite.visible = true
  1284.           else
  1285.             @name_window.visible = false
  1286.             @name_sprite.visible = false
  1287.           end
  1288.         end
  1289.       elsif Input.trigger?(Input::C) or Input.trigger?(Input::B)
  1290.         if self.visible == false
  1291.           self.visible = true
  1292.           @back_sprite.visible = true unless @back_sprite
  1293.         end
  1294.         @tail.visible = true if @tail != nil and @tail.visible == false
  1295.         if @name_window != nil and $name != nil
  1296.           if $name != ""
  1297.             @name_window.visible = true
  1298.             @name_sprite.visible = true
  1299.           end
  1300.         end
  1301.       end
  1302.     end
  1303.     update_winoff_default
  1304.   end
  1305.   alias :update_winoff_default :update
  1306.   alias :update :update_winoff
  1307. end


  1308. #■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□
  1309. #■ウィンドウ表示位置指定ルーチン
  1310. #■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□
  1311. #===========================================================================
  1312. #イベントコマンド「スクリプト」を使い、
  1313. #$win_x=100 
  1314. #$win_y=100
  1315. #と入力すれば、ウィンドウを(100、100)の位置に表示します。
  1316. #使わない時は
  1317. #$win_x=nil
  1318. #などとnilを入力しておいてください。
  1319. #===========================================================================
  1320. class Window_Message < Window_Base
  1321.   #--------------------------------------------------------------------------
  1322.   # ● ウィンドウの背景と位置の設定 [再定義]
  1323.   #--------------------------------------------------------------------------
  1324.   def update_placement_position
  1325.     update_placement_position_default
  1326.     if $win_x != nil
  1327.       if $win_x > 0
  1328.         self.x = $win_x
  1329.         self.width -= $win_x
  1330.       else
  1331.         self.x = 0
  1332.         self.width += $win_x
  1333.       end
  1334.     end
  1335.     if $win_y != nil
  1336.       self.y = $win_y
  1337.     end
  1338.     #上表示の時、ネームウィンドウが見切れるので少し下にずらす。
  1339.     if self.y == 0 and @position == 0 and @name_window != nil and $name != nil
  1340.       self.y += (-NAME_WINDOW_OFFSET_Y)
  1341.     end
  1342.   end
  1343.   alias_method :update_placement_position_default, :update_placement
  1344.   alias_method :update_placement, :update_placement_position
  1345. end


  1346. #==============================================================================
  1347. # ■ SceneManager
  1348. #------------------------------------------------------------------------------
  1349. #  シーン遷移のさい、テールを破棄。ネームウィンドウのデータをクリア。
  1350. #==============================================================================
  1351. module SceneManager
  1352.   #--------------------------------------------------------------------------
  1353.   # ● 呼び出し
  1354.   #--------------------------------------------------------------------------
  1355.   def self.call_sceman_hukidasi(scene_class)
  1356.     if defined?(self.scene.message_window)
  1357.       self.scene.message_window.del_tail if self.scene.message_window.tail != nil
  1358.       $name = ""
  1359.     end
  1360.     @stack.push(@scene)
  1361.     @scene = scene_class.new
  1362.   end
  1363.   #--------------------------------------------------------------------------
  1364.   # ● クラスメソッドのエイリアス
  1365.   #--------------------------------------------------------------------------
  1366.   class << self
  1367.     alias :call_sceman_hukidasi_default :call
  1368.     alias :call :call_sceman_hukidasi
  1369.   end
  1370. end

  1371. #==============================================================================
  1372. # ■ Scene_Map
  1373. #------------------------------------------------------------------------------
  1374. #  戦闘トランジションのさい、テールを破棄。
  1375. #==============================================================================
  1376. class Scene_Map < Scene_Base
  1377.   attr_accessor :message_window
  1378.   #--------------------------------------------------------------------------
  1379.   # ● 戦闘前トランジション実行
  1380.   #--------------------------------------------------------------------------
  1381.   def perform_battle_transition_hukidasi
  1382.     @message_window.del_tail #テールの破棄
  1383.     perform_battle_transition_hukidasi_default
  1384.   end
  1385.   alias_method :perform_battle_transition_hukidasi_default, :perform_battle_transition
  1386.   alias_method :perform_battle_transition, :perform_battle_transition_hukidasi
  1387. end


  1388. #=end
复制代码





图像 1.png
梦石
0
星屑
50
在线时间
261 小时
注册时间
2011-1-19
回帖
62
 楼主| 发表于 2017-2-6 09:42:35 | 显示全部楼层
解决了,是我自己犯二了、囧、
只要在\name[]\h[]后面写就不会有空白了、
图像 1.png
图像 2.png
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部