查看: 1723|回复: 2

[已经解决] 某FUKI式對話框的問題

[复制链接]
梦石
0
星屑
284
在线时间
271 小时
注册时间
2013-4-23
回帖
122
发表于 2013-12-24 20:32:31 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 yiu889 于 2013-12-24 20:35 编辑

用是用到可是當用上大於1格的事件或角色時對話向上會重疊,
像是這樣:
未命名-1.png

如何把設定正常?

還有那個  \t[-2]  用了好像沒什麼效果……那是什麼囧''

這是腳本:
  1. =begin
  2. 吹きだしウィンドウVXAce

  3. 2011.12.25 tamura改造
  4. 2012年02月28日 改訂

  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. 「立ち絵機能」ON時、立ち絵(指定圖片)會表示、窗口位置
  13. 右左変更時、圖片Y座標不正常。
  14. 原因調査中。若不想立ち絵不表示時、亊件指今中的「注釈」填入
  15. 「立ち絵表示 off」的記述、可把立ち絵機能関閉。

  16. ●機能一覧
  17. ・亊件指今「脚本」中、$win_x $win_y値、
  18.  ($win_x 、$win_y)指定表示窗口位置。画面左上(0,0)。

  19. ・按下鍵盤Q、
  20.  窗口消失。Q決定、取消鍵元戻。

  21. ・文章設定、可用以下文字操作。
  22. ・ \name[] : 在對話窗口上出現小窗口中,出現[]内的文字。

  23. \h[-1] : 在玩者上面出現對話窗口。
  24. \h[0] : 在正發生的事件出現對話窗口。
  25. \h[1] : 在[]内的ID號的事件出現對話窗口。
  26. H可用大文字。

  27. 通常的窗口、但對話吹出位置不同、
  28. \t[-2] : 窗口上下に表示時、X座標MINAS_TWE_X_POS固定。
  29.            $win_x 左右表示時、Y座標窗口中心下固定。
  30. \t[-3] : 窗口上下に表示時、X座標MINAS_THREE_X_POS固定。
  31.            $win_x 左右表示時、Y座標窗口中心下固定。
  32. \t[-1] : 玩者向對話吹出位置表示。
  33. \t[0] : 現在執行的事件對話吹出位置表示。
  34. \t[1] : []内的ID事件對話吹出位置表示。

  35. \O[128] : 文字透明。[]内是alpha値、0透明、255通常。
  36. \D : 文字影有
  37. \hold : 最後的文章限定。信息結束,不關上窗口。
  38.       其他的信息被表示時消失。
  39.       被鎖定的窗,不能用Q按鈕消去。


  40. ●その他
  41. ・ACE标准機能可正常使用。
  42. ・A1殿([url]http://a1tktk.web.fc2.com/[/url])的立ち絵脚本対応。
  43.  這脚本放在「RGSS3用A1共通処理」脚本之下
  44.  這脚本放在「空メッセージでウィンドウを開かない」「立ち絵表示」以上(若需用到這两脚本時)。
  45.  「ネームウィンドウ」不能使用。上記\name代替。
  46. ※立ち絵を表示しない時は、注釈で「立ち絵表示 off」とした方が無難です。
  47. ・イベントの下から話しかけたら上へポップ、上から話しかけたら下へポップするという
  48.  機能を追加。カスタマイズポイントで POP_DIRECTION = ture と変更のこと。


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



  52. 【改訂履歴】
  53. 2012.01.10  ?ウィンドウを消したまま次のウィンドウを自動で表示すると、
  54.               ネームウィンドウが表示されるのを修正。
  55. 2012.01.11  ?ネームウィンドウが出しっぱなしになるのを修正。
  56. 2012.01.12  ?メニューを出してから決定ボタンを押すとネームウィンドウがでる不具合の修正。
  57. 2012.02.01 ?ネームウィンドウのオープン&クローズのタイミングを変更。
  58.       ?hold機能を追加。
  59. 2012.02.10 ?キャラポップした時、一行ずつしか表示されない不具合を修正。
  60. 2012.02.14 ?アイテム名などの文字数が正常に取得できなかったのを修正。
  61. 2012.02.21 ?話しかけられた方向によって、ポップ方向を変えられるようにした。
  62. 2012.02.25 ?すべてのシーン遷移の際はテールを破棄(イベント中でショップ起動など)
  63. 2012.02.28 ?エスケープ文字の処理が上手くいかない問題について暫定対策。

  64. =end

  65. #==============================================================================
  66. # カスタマイズポイント
  67. #==============================================================================
  68. #=begin
  69. class Window_Message < Window_Base
  70.   #
  71.   # 基本行数
  72.   #
  73.   MAX_LINE = 4
  74.   #
  75.   # \p[] - キャラポップの高さ
  76.   #
  77.   CHARPOP_HEIGHT = 40
  78.   #
  79.   # \name[] - 名前枠 X,Y座標
  80.   #
  81.   NAME_WINDOW_OFFSET_X =   0
  82.   NAME_WINDOW_OFFSET_Y = -24
  83.   #
  84.   #
  85.   MINAS_TWE_X_POS = 100 # $t[-2]のときの、テールのX座標。
  86.   MINAS_THREE_X_POS = 444 # $t[-3]のときの、テールのX座標。
  87.   
  88.   POP_DIRECTION = true #イベントの方向を考慮。
  89. end
  90. #==============================================================================
  91. # 参照機能
  92. #==============================================================================
  93. class Game_Temp
  94.   attr_accessor :last_gain_material
  95.   attr_accessor :last_gain_holder
  96. end
  97. #==============================================================================
  98. # フルグレードアップベース - 制御文字?基本機能
  99. #==============================================================================
  100. class Window_Message < Window_Base
  101.   attr_accessor :tail
  102.   #--------------------------------------------------------------------------
  103.   # ● 特殊文字の変換 + 準備
  104.   #     変換?消去してもいい部分を処理、フラグのセット。
  105.   #--------------------------------------------------------------------------
  106.   alias xrxsv2_convert_escape_characters convert_escape_characters
  107.   def convert_escape_characters(text)
  108.     #@textsが使いずらいので、ここで別変数に保管。
  109.     @all_texts = []
  110.     str = text.gsub(/\\/) { "\e" }
  111.     @all_texts = str.split("\n")
  112.    
  113.     # 初期化
  114.     contents.font.size   = Font.default_size
  115.     contents.font.bold   = Font.default_italic
  116.     contents.font.italic = Font.default_bold
  117.     contents.font.shadow = Font.default_shadow
  118.     @type_wait = 0
  119.     @line_widths = []
  120.     @line_aligns = []
  121.     self.pop_character = nil
  122.     # ウィンドウ保持指定\holdがあるか?
  123.     @window_hold = (text.gsub!(/\\hold/) { "" } != nil)
  124.     # \info
  125.     @info_mode = (text.gsub!(/\\info/) { "" } != nil)
  126.     # 改行削除指定\_があるか?
  127.     if (/\\_(.*?)\x00/.match(@text)) != nil
  128.       $game_message.choice_start -= 1
  129.       text.gsub!(/\\_(.*?)\x00/) { $1.to_s }
  130.     end
  131.     # \name 判定
  132.     if text.sub!(/\\[Nn]ame\[(.*?)\]/) { "" }
  133.       name = $1
  134.       bitmap = @name_sprite.bitmap
  135.       w = [bitmap.text_size(name).width, 1].max
  136.       bitmap.dispose
  137.       @name_sprite.bitmap = Bitmap.new(w, 32)
  138.       bitmap = @name_sprite.bitmap
  139.       bitmap.draw_text(0, 0, bitmap.width, bitmap.height, name)
  140.       @name_window.width = w + 16
  141.       @name_window.create_contents
  142.       @name_window.open if @name_window.openness == 0
  143.       if self.visible #名前だけ表示されるのを防止。
  144.         @name_window.visible = true
  145.         @name_sprite.visible = true
  146.       else
  147.         @name_window.visible = false
  148.         @name_sprite.visible = false
  149.       end
  150.     else
  151.       @name_window.visible = false
  152.       @name_sprite.visible = false
  153.       @name_sprite.bitmap.dispose
  154.       @name_sprite.bitmap = Bitmap.new(32,32)
  155.     end
  156.     $name = $1 #あれこれで使うので、ネームウィンドウに表示予定の名前を取得。
  157.     # キャラボップモード
  158.     if text.gsub!(/\\[Hh]\[-1\]/) { "" }
  159.       self.pop_character = -1
  160.     elsif text.gsub!(/\\[Hh]\[([0-9]+)\]/) { "" }
  161.       self.pop_character = $1.to_i
  162.     elsif text.gsub!(/\\[Hh]/) { "" }
  163.       self.pop_character = 0
  164.     #テール表示モード
  165.     elsif text.gsub!(/\\[Tt]\[-1\]/) { "" }
  166.       self.tail_character = -1
  167.     elsif text.gsub!(/\\[Tt]\[-2\]/) { "" }
  168.       self.tail_character = -2
  169.     elsif text.gsub!(/\\[Tt]\[-3\]/) { "" }
  170.       self.tail_character = -3
  171.     elsif text.gsub!(/\\[Tt]\[([0-9]+)\]/) { "" }
  172.       self.tail_character = $1.to_i
  173.     elsif text.gsub!(/\\[Tt]/) { "" }
  174.       self.tail_character = 0
  175.     else
  176.       self.pop_character = nil
  177.     end
  178.    
  179.     # 制御文字処理
  180.     text = xrxsv2_convert_escape_characters(text)
  181.     text.gsub!(/\\[Ss]\[([0-9]+)\]/i) { "\eS[#{$1}]" }
  182.     text.gsub!(/\\[Oo]\[([0-9]+)\]/i) { "\eO[#{$1}]" }
  183.     text.gsub!(/\\last_holder/i) { "\e18" }
  184.     text.gsub!(/\\last_material/i) { "\e19" }
  185.     text.gsub!(/\\B/) { "\eB" }
  186.     text.gsub!(/\\D/) { "\eD" }
  187.     #text.gsub!(/\\n/) { "\n" }
  188.     #
  189.     # ライン情報の取得
  190.     rxs = ["\x01","\x02","\x03","\x04","\x05","\x06","\x07","\x08",
  191.       /\[([0-9]+)\]/,
  192.       "\x11","\x12","\x13","\x14", "\x15", "\x16", "\x17", "\x18","\x19"]
  193.     lines = text.split("\x00")
  194.     @lines_max = lines.size
  195.     for i in 0...@lines_max
  196.       line = lines[i]
  197.       for rx in rxs
  198.         line.gsub!(rx) {""}
  199.       end
  200.       @line_aligns[i] =
  201.         line.sub!(/\\center/) {""} ? CENTER :
  202.         line.sub!(/\\right/)  {""} ? RIGHT :
  203.                                      AUTO
  204.       # 行の横幅の取得と設定
  205.       cx = text_width_no_escape(line,text) #test
  206.       #cx = contents.text_size(line,text).width
  207.       @line_widths[i] = cx
  208.     end
  209.     # 位置揃え制御文字の削除
  210.     text.gsub!(/\\center/) {""}
  211.     text.gsub!(/\\right/) {""}
  212.     # キャラポップ時のウィンドウリサイズ
  213.     reszie_window_for_pop
  214.    
  215.     del_tail # if @tail != nil
  216.     # $mes_id が空のときと戦闘中はふきだしを表示しない
  217.     if defined?($game_system.show_stand_picture) #立ち絵に対応。
  218.       $mes_id = -1 if $game_system.show_stand_picture == true
  219.     end
  220.     if $mes_id != nil and not $game_party.in_battle
  221.       # ふきだしのテールを描画
  222.       skin = "Window"
  223.       if @background == 0
  224.         #画像の準備
  225.         @tail = Sprite.new
  226.         @tail.visible = false
  227.         # 位置を取得
  228.         tale_pos = get_tale_pos
  229.         if $win_x != nil
  230.           if $win_x > 0
  231.             @tail.bitmap = Cache.system(skin + "-right")
  232.             @tail.x = tale_pos[0]
  233.             @tail.y = tale_pos[1]
  234.             @tail.z = self.z + 1
  235.           elsif  $win_x < 0
  236.             @tail.bitmap = Cache.system(skin + "-left")
  237.             @tail.x = tale_pos[0]
  238.             @tail.y = tale_pos[1]
  239.             @tail.z = self.z + 1
  240.           else
  241.             create_tail_up_under
  242.           end
  243.         else
  244.           create_tail_up_under
  245.         end
  246.         # エクストラスプライトに登録
  247.         @extra_sprites = [] if @extra_sprites.nil?
  248.         @extra_sprites.push(@tail) if @tail != nil
  249.         # 更新
  250.         update_tail
  251.       end
  252.     end

  253.     open_and_wait #リサイズが終わった時点でウィンドウオープン。
  254.    
  255.     return text
  256.   end
  257.   #--------------------------------------------------------------------------
  258.   # ● 文字の長さを取得する。エスケープ文字は含まない。
  259.   # line : 表示しようとしている全ての文字列。
  260.   # text : その列の文字。
  261.   #--------------------------------------------------------------------------
  262.   def text_width_no_escape(line , text_o)
  263.     add = 0
  264.     text = Marshal.load(Marshal.dump(text_o))
  265.     text.gsub!(/\ehold/) { "" }
  266.     text.gsub!(/\einfo/) { "" }
  267.     # 改行削除指定\_があるか?
  268.     if (/\\_(.*?)\x00/.match(@text)) != nil
  269.       $game_message.choice_start -= 1
  270.       text.gsub!(/\\_(.*?)\x00/) { "" }
  271.     end
  272.     # \name 判定
  273.     text.sub!(/\e[Nn]ame\[(.*?)\]/) { "" }
  274.     text.gsub!(/\e[Hh]\[-1\]/) { "" }
  275.     text.gsub!(/\e[Hh]\[([0-9]+)\]/) { "" }
  276.     text.gsub!(/\e[Hh]/) { "" }
  277.     text.gsub!(/\e[Tt]\[-1\]/) { "" }
  278.     text.gsub!(/\e[Tt]\[-2\]/) { "" }
  279.     text.gsub!(/\e[Tt]\[-3\]/) { "" }
  280.     text.gsub!(/\e[Tt]\[([0-9]+)\]/) { "" }
  281.     text.gsub!(/\e[Tt]/) { "" }
  282.     # 制御文字処理
  283.     text.gsub!(/\e[Ss]\[([0-9]+)\]/i) { "" }
  284.     text.gsub!(/\e[Oo]\[([0-9]+)\]/i) { "" }
  285.     text.gsub!(/\elast_holder/i) { "" }
  286.     text.gsub!(/\elast_material/i) { "" }
  287.     #text.gsub!(/\eV/) { "" } #変数に置き換える。
  288.     #text.gsub!(/\eN/) { "" } #名前へ置き換える。
  289.     #text.gsub!(/\eP/) { "" } #名前へ置き換える。
  290.     #text.gsub!(/\eG/) { "" } #金額へ置き換える。
  291.     #text.gsub!(/\eC/) { "" }
  292.     text.gsub!(/\eB/) { "" }
  293.     text.gsub!(/\eD/) { "" }
  294.     if text =~ /\eI/
  295.       loop do
  296.         if str = text.sub!(/\eI\[(\d+)\]/){ "" }
  297.           add += 24
  298.         else
  299.           break
  300.         end
  301.       end
  302.     end
  303.     #text.gsub!(/\\n/) { "\n" }
  304.     text.sub!(/\ecenter/) {""}
  305.     text.sub!(/\eright/)  {""}
  306.     text.gsub!(/\ecenter/) {""}
  307.     text.gsub!(/\eright/) {""}
  308.    
  309.     text = xrxsv2_convert_escape_characters(text)
  310.     basic_width = text_size(text).width + add
  311.     esc = text.scan(/\e(\S)/)
  312.     return ( basic_width - esc.size * (contents.font.size - 4) ) #\eの幅は20?
  313.   end
  314.   #--------------------------------------------------------------------------
  315.   # ● 最も長い列の長さを調べる。エスケープ文字は含まない。
  316.   #--------------------------------------------------------------------------
  317.   def max_width
  318.     text_size = []
  319.     for i in 0 ... @all_texts.size
  320.       text_size.push text_width_no_escape(@all_texts[i],@all_texts[i]) + 20
  321.     end
  322.     return text_size.max
  323.   end
  324.   #--------------------------------------------------------------------------
  325.   # ● 吹きだしテールが上か下の場合の画像を準備。
  326.   #--------------------------------------------------------------------------
  327.   def create_tail_up_under
  328.     skin = "Window"
  329.     tale_pos = get_tale_pos
  330.     case @position
  331.     when 0  # 上
  332.       @tail.bitmap = Cache.system(skin + "-top")
  333.       @tail.x = tale_pos[0]
  334.       @tail.y = tale_pos[1]
  335.       @tail.z = self.z + 1
  336.     when 1  # 中
  337.       @tail.dispose
  338.       @tail = nil
  339.     when 2  # 下
  340.       @tail.bitmap = Cache.system(skin + "-under")
  341.       @tail.x = tale_pos[0]
  342.       @tail.y = tale_pos[1]
  343.       @tail.z = self.z + 1
  344.     end
  345.   end
  346.   #--------------------------------------------------------------------------
  347.   # ● 全テキストの処理
  348.   #--------------------------------------------------------------------------
  349.   def process_all_text
  350.     #open_and_wait #リサイズがあるので、すぐにウィンドウをオープンしない。
  351.     text = convert_escape_characters($game_message.all_text)
  352.     pos = {}
  353.     new_page(text, pos)
  354.     process_character(text.slice!(0, 1), text, pos) until text.empty?
  355.   end
  356.   #--------------------------------------------------------------------------
  357.   # ● メッセージの更新 *
  358.   #--------------------------------------------------------------------------
  359.   def update_message
  360.     @wait_count = @type_wait
  361.     loop do
  362.       c = @text.slice!(/./m)
  363.       case update_message_type(c)
  364.       when 1
  365.         break
  366.       when 2
  367.         next
  368.       end
  369.       break unless @show_fast or @line_show_fast
  370.     end
  371.   end
  372.   #--------------------------------------------------------------------------
  373.   # 一文字の描画 (返り値 1:break, 2:next)
  374.   #--------------------------------------------------------------------------
  375. #=begin
  376.   def process_escape_character(code, text, pos)
  377.     case code.upcase
  378.     when '$'
  379.       @gold_window.open
  380.     when '.'
  381.       wait(15)
  382.     when '|'
  383.       wait(60)
  384.     when '!'
  385.       input_pause
  386.     when '>'
  387.       @line_show_fast = true
  388.     when '<'
  389.       @line_show_fast = false
  390.     when '^'
  391.       @pause_skip = true
  392.     #when 'n'                      # 改行
  393.     #  new_line
  394.     #  max = MAX_LINE
  395.     #  max = 14 if self.pop_character != nil
  396.     #  if @line_count >= max      # 行数が最大のとき
  397.     #    unless @text.empty?           # さらに続きがあるなら
  398.     #      self.pause = true           # 入力待ちを入れる
  399.           #return 1
  400.     #    end
  401.     #  end
  402.     #when 'S'                       # \S[n]  (スピード変更)
  403.     #  text.sub!(/\[([0-9]+)\]/, "")
  404.     #  @type_wait = $1.to_i
  405.     #  return 2
  406.     when 'O'                       # \O 文字を透明にする。
  407.       text.sub!(/\[([0-9]+)\]/, "")
  408.       contents.font.color.alpha = $1.to_i
  409.       #return 2
  410.     when 'D' #\D 文字に影をつける
  411.       contents.font.shadow ^= true
  412.     #when '18'
  413.     #  name = ($game_temp.last_gain_holder.name rescue "")
  414.     #  update_message_type_draw_at(name)
  415.     #when '19'
  416.     #  item = ($game_temp.last_gain_material.item rescue nil)
  417.     #  draw_item_name(item, @contents_x, @contents_y)
  418.     #  @contents_x += 196
  419.     else
  420.       super
  421.     end
  422.         
  423.   end
  424. #=end
  425.   #--------------------------------------------------------------------------
  426.   # ● 改ページ処理
  427.   #--------------------------------------------------------------------------
  428.   alias xrxsv2_new_page new_page
  429.   def new_page(text, pos)
  430.     xrxsv2_new_page(text, pos)
  431.     update_charpop_window
  432.   end
  433.   #--------------------------------------------------------------------------
  434.   # ● 改行位置の取得
  435.   #--------------------------------------------------------------------------
  436.   #def new_line_x
  437.   #  $game_message.face_name.empty? ? 0 : 112
  438.   #end
  439.   #--------------------------------------------------------------------------
  440.   # ● 改行処理
  441.   #--------------------------------------------------------------------------
  442.   alias xrxsv2_new_line_x new_line_x
  443.   def new_line
  444.     xrxsv2_new_line
  445.     set_align
  446.   end
  447.   #--------------------------------------------------------------------------
  448.   # 位置揃え
  449.   #--------------------------------------------------------------------------
  450.   def set_align
  451.     w = @line_widths[@line_count].to_i
  452.     a = @line_aligns[@line_count]
  453.     case a
  454.     when CENTER
  455.       @contents_x = @contents_x + ((contents.width - @contents_x) - w) / 2
  456.     when RIGHT
  457.       @contents_x = contents.width - w
  458.     end
  459.   end
  460.   #--------------------------------------------------------------------------
  461.   # ● ファイバーのメイン処理 ☆再定義
  462.   #--------------------------------------------------------------------------
  463.   def fiber_main
  464.     $game_message.visible = true
  465.     update_background
  466.     update_placement
  467.     loop do
  468.       process_all_text if $game_message.has_text?
  469.       process_input
  470.       $game_message.clear
  471.       @gold_window.close
  472.       process_hold #ホールドウィンドウの処理。
  473.       Fiber.yield
  474.       break unless text_continue?
  475.     end
  476.     close_and_wait
  477.     $game_message.visible = false
  478.     @fiber = nil
  479.   end
  480.   #--------------------------------------------------------------------------
  481.   # 定数
  482.   #--------------------------------------------------------------------------
  483.   AUTO   = 0
  484.   LEFT   = 1
  485.   CENTER = 2
  486.   RIGHT  = 3
  487. end
  488. #==============================================================================
  489. # アクティブイベント取得
  490. #==============================================================================
  491. class Game_Interpreter
  492.   attr_reader   :event_id
  493. end


  494. #==============================================================================
  495. # 各種機能の追加 - キャラポップ/ネーム/ホールド
  496. #==============================================================================
  497. class Window_Message < Window_Base
  498.   #--------------------------------------------------------------------------
  499.   # ● カーソルの更新 *
  500.   #--------------------------------------------------------------------------
  501.   def update_cursor
  502.     if [url=home.php?mod=space&uid=370741]@Index[/url] >= 0
  503.       x = ($game_message.face_name.empty? ? 0 : 112)
  504.       y = ($game_message.choice_start + @index) * WLH - 1
  505.       w = contents.width - x
  506.       if self.pop_character != nil
  507.         x += 28
  508.         w -= 20
  509.       end
  510.       self.cursor_rect.set(x, y, w, WLH)
  511.     else
  512.       self.cursor_rect.empty
  513.     end
  514.   end
  515.   #--------------------------------------------------------------------------
  516.   # キャラクターの取得
  517.   #   parameter : パラメータ
  518.   #--------------------------------------------------------------------------
  519.   def get_character(parameter)
  520.     # パラメータで分岐
  521.     case parameter
  522.     when -1  # プレイヤー
  523.       return $game_player
  524.     when 0  # 現在アクティブなイベント
  525.       id = $game_map.interpreter.event_id
  526.       events = $game_map.events
  527.       return events == nil ? nil : events[id]
  528.     else  # 特定のイベント
  529.       events = $game_map.events
  530.       return events == nil ? nil : events[parameter]
  531.     end
  532.   end
  533.   #--------------------------------------------------------------------------
  534.   # (メッセージ終了時)ホールドの処理
  535.   #--------------------------------------------------------------------------
  536.   def process_hold
  537.     if @window_hold
  538.       @held_windows.push(Window_Copy.new(self))
  539.       @held_windows.push(Window_Copy.new(@name_window))
  540.       @held_windows.push(Sprite_Copy.new(@name_sprite))
  541.       @held_windows.push(Sprite_Copy.new(@back_sprite))
  542.       for sprite in @extra_sprites
  543.         next if sprite.disposed?
  544.         @held_windows.push(Sprite_Copy.new(sprite))
  545.       end
  546.       @extra_sprites.clear
  547.       self.openness = 0
  548.       #@name_window.openness = 0
  549.       @back_sprite.visible = false
  550.     else
  551.       @held_windows.each {|object| object.dispose}
  552.       @held_windows.clear
  553.     end
  554.     #@name_window.close
  555.     #@name_sprite.visible = false
  556.   end
  557.   #--------------------------------------------------------------------------
  558.   # キャラポップ位置の設定と取得
  559.   #--------------------------------------------------------------------------
  560.   def pop_character=(character_id)
  561.     @pop_character = character_id
  562.   end
  563.   def pop_character
  564.     return @pop_character
  565.   end
  566.   #--------------------------------------------------------------------------
  567.   # キャラポップ時のウィンドウリサイズ
  568.   #--------------------------------------------------------------------------
  569.   def reszie_window_for_pop
  570.     #キャラポップ
  571.     if self.pop_character != nil
  572.       max_x = @line_widths.max.to_i
  573.       n  = max_x + 32
  574.       n += $game_message.face_name.empty? ? 0 : 122
  575.       m  = $game_message.face_name.empty? ? 0 : 96
  576.       w  = @name_sprite.bitmap.width
  577.       #self.width  = [n, w].max
  578.       self.width  = max_width
  579.       #self.height = [@lines_max * line_height, m].max + 32
  580.       self.height = [@all_texts.size * line_height, m].max + 32
  581.       create_contents
  582.       update_charpop_window
  583.     elsif @info_mode
  584.       @line_aligns[0] = CENTER
  585.       self.x = - 8
  586.       self.width = Graphics.width + 16
  587.       self.height = 56
  588.       create_contents
  589.     else
  590.       self.x = 0
  591.       self.width  = Graphics.width
  592.       self.height = MAX_LINE * line_height + 32
  593.       update_placement #位置情報修正。
  594.       create_contents
  595.     end
  596.   end
  597.   #--------------------------------------------------------------------------
  598.   # ● 背景スプライトの作成
  599.   #--------------------------------------------------------------------------
  600.   alias xrxsv2_create_back_sprite create_back_sprite
  601.   def create_back_sprite
  602.     xrxsv2_create_back_sprite
  603.     @back_sprite.zoom_x = 1.0 * Graphics.width / @back_sprite.bitmap.width
  604.     @name_window = Window_Base.new(0,0,112,36)
  605.     @name_window.visible = false
  606.     @name_sprite = Sprite.new
  607.     @name_sprite.bitmap = Bitmap.new(32,32)
  608.     @name_sprite.visible = false
  609.     self.x = self.x
  610.     self.y = self.y
  611.     self.z = self.z
  612.     @held_windows = []
  613.     @extra_sprites = []
  614.   end
  615.   #--------------------------------------------------------------------------
  616.   # ● 背景スプライトの解放
  617.   #--------------------------------------------------------------------------
  618.   alias xrxsv2_dispose_back_sprite dispose_back_sprite
  619.   def dispose_back_sprite
  620.     xrxsv2_dispose_back_sprite
  621.     @name_window.dispose if @name_window != nil #メニュー画面を出そうとするとエラー?
  622.     @name_sprite.dispose if @name_sprite != nil
  623.     for window in @held_windows
  624.       window.dispose
  625.     end
  626.   end
  627.   #--------------------------------------------------------------------------
  628.   # ● 背景スプライトの更新
  629.   #--------------------------------------------------------------------------
  630.   alias xrxsv2_update_back_sprite update_back_sprite
  631.   def update_back_sprite
  632.     @name_window.update
  633.     xrxsv2_update_back_sprite
  634.     update_charpop_window
  635.   end
  636.   #--------------------------------------------------------------------------
  637.   # ウィンドウの位置と不透明度の設定 (キャラポップ)
  638.   #--------------------------------------------------------------------------
  639.   def update_charpop_window
  640.     if self.pop_character
  641.       character = get_character(self.pop_character)
  642.       return if character == nil
  643.       # [X座標]
  644.       n = self.width / 2
  645.       n = [n, @name_skin.width + 16].max if @current_name != nil
  646.       w = @name_sprite.bitmap.width
  647.       x = character.screen_x - [[n, w].max, self.width - 32].min
  648.       # [Y座標]
  649.       if self.pop_character == 0 and POP_DIRECTION #イベントの方向を考慮。
  650.         if character.direction == 2 #下向き
  651.           @position = 0 #上にポップ
  652.         elsif character.direction == 8 #上向き
  653.           @position = 2 #下にポップ
  654.         end
  655.       end
  656.       case @position
  657.       when 0
  658.         y = character.screen_y - CHARPOP_HEIGHT - self.height
  659.       else
  660.         y = character.screen_y + 16
  661.       end
  662.       x_max = Graphics.width - 4 - self.width
  663.       x_min = 4
  664.       y_max = Graphics.height - self.height
  665.       y_min = 4
  666.       self.x = [[x, x_max].min, x_min].max
  667.       self.y = [[y, y_max].min, y_min].max
  668.     end
  669.   end
  670.   #--------------------------------------------------------------------------
  671.   # 位置の連動
  672.   #--------------------------------------------------------------------------
  673.   def x=(n)
  674.     super
  675.     if @name_window
  676.       @name_window.x = n + NAME_WINDOW_OFFSET_X
  677.       @name_sprite.x = n + NAME_WINDOW_OFFSET_X + 8
  678.     end
  679.   end
  680.   def y=(n)
  681.     super
  682.     if @name_window
  683.       @name_window.y = n + NAME_WINDOW_OFFSET_Y
  684.       @name_sprite.y = n + NAME_WINDOW_OFFSET_Y + 2
  685.     end
  686.   end
  687.   def z=(n)
  688.     super
  689.     if @name_window
  690.       @name_window.z = n + 11#1 テールの上に表示されるので、Zを水増しする。
  691.       @name_sprite.z = n + 12#2
  692.     end
  693.   end
  694.   #--------------------------------------------------------------------------
  695.   # ● ファイバーのメイン処理
  696.   #--------------------------------------------------------------------------
  697.   def fiber_main_namewin
  698.     fiber_main_namewin_default
  699.     @name_window.openness = 0
  700.     @name_sprite.bitmap.clear
  701.     $name = ""
  702.   end
  703.   alias :fiber_main_namewin_default :fiber_main
  704.   alias :fiber_main :fiber_main_namewin
  705. end
  706. #==============================================================================
  707. # 伸縮対応
  708. #==============================================================================
  709. class Window_Message < Window_Base
  710.   #--------------------------------------------------------------------------
  711.   # ● ウィンドウの背景と位置の設定 [再定義]
  712.   #--------------------------------------------------------------------------
  713.   def reset_window
  714.     @background = $game_message.background
  715.     @position = $game_message.position
  716.     if @background == 0   # 通常ウィンドウ
  717.       self.opacity = 255
  718.     else                  # 背景を暗くする、透明にする
  719.       self.opacity = 0
  720.     end
  721.     case @position
  722.     when 0  # 上
  723.       self.y = 0
  724.       @gold_window.y = 360
  725.     when 1  # 中
  726.       self.y = (Graphics.height - self.height) / 2
  727.       @gold_window.y = 0
  728.     when 2  # 下
  729.       self.y = Graphics.height - self.height
  730.       @gold_window.y = 0
  731.     end
  732.   end
  733. end
  734. #==============================================================================
  735. # □ Window_Copy
  736. #------------------------------------------------------------------------------
  737. #   指定のウィンドウのコピーを作成します。
  738. #==============================================================================
  739. class Window_Copy < Window_Base
  740.   #--------------------------------------------------------------------------
  741.   # ○ オブジェクト初期化
  742.   #--------------------------------------------------------------------------
  743.   def initialize(window)
  744.     super(window.x, window.y, window.width, window.height)
  745.     self.contents = window.contents.dup unless window.contents.nil?
  746.     self.opacity = window.opacity
  747.     self.back_opacity = window.back_opacity
  748.     self.z = window.z - 3
  749.     self.visible = window.visible
  750.   end
  751. end
  752. #==============================================================================
  753. # □ Sprite_Copy
  754. #------------------------------------------------------------------------------
  755. #   指定のスプライトのコピーを作成します。
  756. #==============================================================================
  757. class Sprite_Copy < Sprite
  758.   #--------------------------------------------------------------------------
  759.   # ○ オブジェクト初期化
  760.   #--------------------------------------------------------------------------
  761.   def initialize(sprite)
  762.     super()
  763.     self.bitmap = sprite.bitmap.dup unless sprite.bitmap.nil?
  764.     self.opacity = sprite.opacity
  765.     self.x = sprite.x
  766.     self.y = sprite.y
  767.     self.z = sprite.z - 3
  768.     self.ox = sprite.ox
  769.     self.oy = sprite.oy
  770.     self.zoom_x = sprite.zoom_x
  771.     self.visible = sprite.visible
  772.   end
  773. end



  774. #■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□
  775. #■吹きだしテールの表示ルーチン。
  776. #■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□
  777. #==============================================================================
  778. # +++ 「+ふきだし表示」VX +++
  779. # by パラ犬  [url]http://2d6.parasite.jp/[/url]
  780. #      ×
  781. #    row       [url]http://xms.rdy.jp/[/url]
  782. #
  783. # publish 2010/ 3/ 2
  784. # update  -
  785. #
  786. #------------------------------------------------------------------------------
  787. #    ほぼどんなメッセージウィンドウに対しても後付け可能な「ふきだし表示」です。
  788. #  また、テール部分のみの自動追尾機能を持ちます。
  789. #   ふきだし表示をするには、
  790. #  テール用画像「Window-top」「Window-under」を
  791. #  「Graphics/System」フォルダにインポートしておく必要があります。
  792. #==============================================================================
  793. # ■ Window_Message
  794. #==============================================================================
  795. class Window_Message < Window_Base
  796.   #--------------------------------------------------------------------------
  797.   # ● メッセージの開始
  798.   #--------------------------------------------------------------------------
  799.   alias parashelf_update_all_windows update_all_windows
  800.   def update_all_windows
  801.     parashelf_update_all_windows
  802.     update_tail
  803.   end
  804.   #--------------------------------------------------------------------------
  805.   # クローズ [オーバーライド]
  806.   #--------------------------------------------------------------------------
  807.   def close
  808.     super
  809.     del_tail
  810.     @name_window.close if @name_window != nil #ネームウィンドウのクローズ動作。
  811.   end
  812.   #--------------------------------------------------------------------------
  813.   # ● 背景スプライトの更新
  814.   #--------------------------------------------------------------------------
  815.   alias parashelf_update_back_sprite update_back_sprite
  816.   def update_back_sprite
  817.     parashelf_update_back_sprite
  818.     update_tail
  819.   end
  820.   #--------------------------------------------------------------------------
  821.   # ○ フレーム更新 (ふきだしテールの更新)
  822.   #--------------------------------------------------------------------------
  823.   def update_tail
  824.     # ふきだしモードではイベントの動きに追従
  825.     if $mes_id != nil and @tail != nil
  826.       tale_pos = get_tale_pos
  827.       @tail.x = tale_pos[0]
  828.       @tail.y = tale_pos[1]
  829.       update_tail_bitmap
  830.     end
  831.   end
  832.   ##--------------------------------------------------------------------------
  833.   # ○ ふきだしテールの画像を更新。
  834.   #--------------------------------------------------------------------------
  835.   def update_tail_bitmap
  836.     skin = "Window"
  837.     if $win_x != nil
  838.       if $win_x > 0
  839.         @tail.bitmap = Cache.system(skin + "-right")
  840.       elsif  $win_x < 0
  841.         @tail.bitmap = Cache.system(skin + "-left")
  842.       else
  843.         case @position
  844.         when 0  # 上
  845.           @tail.bitmap = Cache.system(skin + "-top")
  846.         when 2  # 下
  847.           @tail.bitmap = Cache.system(skin + "-under")
  848.         end
  849.       end
  850.     else
  851.       case @position
  852.       when 0  # 上
  853.         @tail.bitmap = Cache.system(skin + "-top")
  854.       when 2  # 下
  855.         @tail.bitmap = Cache.system(skin + "-under")
  856.       end
  857.     end
  858.     # 可視状態
  859.     if self.visible == true
  860.       @tail.visible = self.openness == 255
  861.     else
  862.       @tail.visible = false
  863.     end
  864.   end
  865.   #--------------------------------------------------------------------------
  866.   # ○ テールの位置を計算
  867.   #--------------------------------------------------------------------------
  868.   def get_tale_pos
  869.     if defined?($game_system.show_stand_picture) #A1立ち絵スクリプトを入れている。
  870.       if $game_system.show_stand_picture #立ち絵on
  871.         pos = get_tale_pos_stand_pic
  872.       else
  873.         pos = get_tale_pos_normal
  874.       end
  875.     else
  876.       pos = get_tale_pos_normal
  877.     end
  878.     return pos
  879.   end
  880.   #--------------------------------------------------------------------------
  881.   # ○ テールの位置を計算/立ち絵使用時。※NAME_CHANGEの編集必須。
  882.   #--------------------------------------------------------------------------
  883.   def get_tale_pos_stand_pic
  884.     if $game_message.face_name != ""  and @tail != nil
  885.       name = A1_System::StandPicture::NAME_CHANGE[$game_message.face_name]
  886.       chara = name[$game_message.face_index][0]
  887.       if @stand_pic[chara] != nil #立ち絵無しの場合通常通り。
  888.         x = @stand_pic[chara].pic_sprite.x + @stand_pic[chara].pic_sprite.width / 2
  889.         y = get_tale_pos_normal_updown
  890.         update_tail_bitmap
  891.       else
  892.         return get_tale_pos_normal #立ち絵が見つからない場合は通常通り。
  893.       end
  894.     else
  895.       return get_tale_pos_normal #立ち絵が見つからない場合は通常通り。
  896.     end
  897.     return [x,y]
  898.   end
  899.   #--------------------------------------------------------------------------
  900.   # ○ テールの位置を計算/立ち絵未使用時。
  901.   #--------------------------------------------------------------------------
  902.   def get_tale_pos_normal
  903.     if $mes_id == (-2) #左右の場合は高さはウィンドウ中心。上下ならやや左に配置。
  904.       if $win_x != nil
  905.         if $win_x > 0
  906.           x = $win_x - @tail.width / 2
  907.           y = self.y + self.height / 2 - @tail.height / 2
  908.         elsif $win_x < 0
  909.           x = self.width - @tail.width / 2
  910.           y = self.y + self.height / 2 - @tail.height / 2
  911.         else
  912.           x = MINAS_TWE_X_POS
  913.           y = get_tale_pos_normal_updown
  914.         end
  915.       else
  916.         x = MINAS_TWE_X_POS
  917.         y = get_tale_pos_normal_updown
  918.       end
  919.     elsif $mes_id <= (-3) #左右の場合は高さはウィンドウ中心。上下ならやや左に配置。
  920.       if $win_x != nil
  921.         if $win_x > 0
  922.           x = $win_x - @tail.width / 2
  923.           y = self.y + self.height / 2
  924.         elsif $win_x < 0
  925.           x = self.width - @tail.width / 2
  926.           y = self.y + self.height / 2
  927.         else
  928.           x = MINAS_THREE_X_POS
  929.           y = get_tale_pos_normal_updown
  930.         end
  931.       else
  932.         x = MINAS_THREE_X_POS
  933.         y = get_tale_pos_normal_updown
  934.       end
  935.     else
  936.       character = get_character($mes_id)
  937.       x = [[character.screen_x - 16, self.x].max, self.x + self.width - 32].min
  938.       if $win_x != nil
  939.         if $win_x > 0
  940.           x = $win_x - @tail.width / 2
  941.           y = character.screen_y
  942.         elsif $win_x < 0
  943.           x = self.width
  944.           y = character.screen_y
  945.         else
  946.           y = get_tale_pos_normal_updown
  947.         end
  948.       else
  949.         y = get_tale_pos_normal_updown
  950.       end
  951.     end
  952.     return [x, y]
  953.   end
  954.   #--------------------------------------------------------------------------
  955.   # ○ テールが上下の時、かつ[-2][-3]でない時のy座標の取得。
  956.   #--------------------------------------------------------------------------
  957.   def get_tale_pos_normal_updown
  958.     case @position
  959.     when 0
  960.       y = self.y + self.height - @tail.height / 2
  961.     else
  962.       y = self.y - @tail.height / 2
  963.     end
  964.     return y
  965.   end
  966.   #--------------------------------------------------------------------------
  967.   # ○ ふきだしを破棄
  968.   #--------------------------------------------------------------------------
  969.   def del_tail
  970.     if @tail != nil
  971.       @tail.dispose
  972.       @tail = nil
  973.     end
  974.   end
  975. end
  976. #
  977. # ▼▲▼ XRXS 9拡張CO-X. ふきだし自動設定 ▼▲▼
  978. #==============================================================================
  979. # ■ Window_Message
  980. #==============================================================================
  981. class Window_Message < Window_Base
  982.   #--------------------------------------------------------------------------
  983.   # ○ ポップキャラクターの設定
  984.   #--------------------------------------------------------------------------
  985.   def pop_character=(character_id)
  986.     @pop_character = character_id
  987.     $mes_id = character_id
  988.   end
  989.   #--------------------------------------------------------------------------
  990.   # ○ テールキャラクターの設定
  991.   #--------------------------------------------------------------------------
  992.   def tail_character=(character_id)
  993.     #@pop_character = character_id
  994.     $mes_id = character_id
  995.   end
  996. end

  997. #==============================================================================
  998. # ■ Scene_Menu
  999. #------------------------------------------------------------------------------
  1000. #  メニューを開いてからウィンドウが出るとネームウィンドウが表示される不具合修正。
  1001. #==============================================================================
  1002. #class Scene_Menu < Scene_MenuBase
  1003. #  def terminate_hukidasi_menyu
  1004. #    @name_window.openness = 0 if @name_window != nil
  1005. #    terminate_hukidasi_menyu_default
  1006. #  end
  1007. #  alias :terminate_hukidasi_menyu_default :terminate
  1008. #  alias :terminate :terminate_hukidasi_menyu
  1009. #end

  1010. #■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□
  1011. #■ウィンドウ非表示ルーチン
  1012. #■吹きだしテールとネームウィンドウに対応。
  1013. #■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□
  1014. #==============================================================================
  1015. # L(キーボードのQ)を押すと、メッセージウィンドウを表示?非表示
  1016. #==============================================================================
  1017. class Window_Message < Window_Base
  1018.   def update_winoff
  1019.     unless $game_party.in_battle #バトル中は無効。
  1020.       if Input.trigger?(Input::L)
  1021.         if self.visible == true
  1022.           self.visible = false
  1023.           @tail.visible = false if @tail != nil
  1024.         else
  1025.           self.visible = true
  1026.         end
  1027.         if @name_window != nil
  1028.           if @name_window.visible == false and $name != nil and $name != ""
  1029.             @name_window.visible = true
  1030.             @name_sprite.visible = true
  1031.           else
  1032.             @name_window.visible = false
  1033.             @name_sprite.visible = false
  1034.           end
  1035.         end
  1036.       elsif Input.trigger?(Input::C) or Input.trigger?(Input::B)
  1037.         self.visible = true if self.visible == false
  1038.         @tail.visible = true if @tail != nil and @tail.visible == false
  1039.         if @name_window != nil and $name != nil
  1040.           if $name != ""
  1041.             @name_window.visible = true
  1042.             @name_sprite.visible = true
  1043.           end
  1044.         end
  1045.       end
  1046.     end
  1047.     update_winoff_default
  1048.   end
  1049.   alias :update_winoff_default :update
  1050.   alias :update :update_winoff
  1051. end


  1052. #■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□
  1053. #■ウィンドウ表示位置指定ルーチン
  1054. #■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□
  1055. #===========================================================================
  1056. #イベントコマンド「スクリプト」を使い、
  1057. #$win_x=100 
  1058. #$win_y=100
  1059. #と入力すれば、ウィンドウを(100、100)の位置に表示します。
  1060. #使わない時は
  1061. #$win_x=nil
  1062. #などとnilを入力しておいてください。
  1063. #===========================================================================
  1064. class Window_Message < Window_Base
  1065.   #--------------------------------------------------------------------------
  1066.   # ● ウィンドウの背景と位置の設定 [再定義]
  1067.   #--------------------------------------------------------------------------
  1068.   def update_placement_position
  1069.     update_placement_position_default
  1070.     if $win_x != nil
  1071.       if $win_x > 0
  1072.         self.x = $win_x
  1073.         self.width -= $win_x
  1074.       else
  1075.         self.x = 0
  1076.         self.width += $win_x
  1077.       end
  1078.     end
  1079.     if $win_y != nil
  1080.       self.y = $win_y
  1081.     end
  1082.   end
  1083.   alias_method :update_placement_position_default, :update_placement
  1084.   alias_method :update_placement, :update_placement_position
  1085. end


  1086. #==============================================================================
  1087. # ■ SceneManager
  1088. #------------------------------------------------------------------------------
  1089. #  シーン遷移のさい、テールを破棄する。
  1090. #==============================================================================
  1091. module SceneManager
  1092.   #--------------------------------------------------------------------------
  1093.   # ● 呼び出し
  1094.   #--------------------------------------------------------------------------
  1095.   def self.call_sceman_hukidasi(scene_class)
  1096.     if defined?(self.scene.message_window)
  1097.       #self.scene.message_window.del_tail if self.scene.message_window.tail != nil
  1098.     end
  1099.     @stack.push(@scene)
  1100.     [url=home.php?mod=space&uid=420706]@Scene[/url] = scene_class.new
  1101.   end
  1102.   #--------------------------------------------------------------------------
  1103.   # ● クラスメソッドのエイリアス
  1104.   #--------------------------------------------------------------------------
  1105.   class << self
  1106.     alias :call_sceman_hukidasi_default :call
  1107.     alias :call :call_sceman_hukidasi
  1108.   end
  1109. end

  1110. #==============================================================================
  1111. # ■ Scene_Map
  1112. #------------------------------------------------------------------------------
  1113. #  戦闘トランジションのさい、テールを破棄。
  1114. #==============================================================================
  1115. class Scene_Map < Scene_Base
  1116.   attr_accessor :message_window
  1117.   #--------------------------------------------------------------------------
  1118.   # ● 戦闘前トランジション実行
  1119.   #--------------------------------------------------------------------------
  1120.   def perform_battle_transition_hukidasi
  1121.     @message_window.del_tail #テールの破棄
  1122.     perform_battle_transition_hukidasi_default
  1123.   end
  1124.   alias_method :perform_battle_transition_hukidasi_default, :perform_battle_transition
  1125.   alias_method :perform_battle_transition, :perform_battle_transition_hukidasi
  1126. end
复制代码
梦石
0
星屑
266
在线时间
2355 小时
注册时间
2009-3-13
回帖
2257

贵宾

发表于 2013-12-24 23:13:36 | 显示全部楼层
看了一下好像脚本里没有这个功能,修改的话大概在97行或者680行的位置,改改y坐标试试吧。
回复

使用道具 举报

梦石
0
星屑
284
在线时间
271 小时
注册时间
2013-4-23
回帖
122
 楼主| 发表于 2013-12-24 23:39:16 | 显示全部楼层
Sion 发表于 2013-12-24 23:13
看了一下好像脚本里没有这个功能,修改的话大概在97行或者680行的位置,改改y坐标试试吧。 ...

OHOHOH改了97行增加60以上問題解決了{:2_249:}
小小的問題老是麻煩大大解答真不好意思…_(:3」∠)_
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部