设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1184|回复: 1
打印 上一主题 下一主题

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

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
261 小时
注册时间
2011-1-19
帖子
76
跳转到指定楼层
1
发表于 2017-2-4 14:53:59 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

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

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

附上脚本、

RUBY 代码复制
  1. =begin
  2. 吹きだしウィンドウVXAce
  3.  
  4. 2011年12月25日 tamura改造
  5. 2014年06月03日 改訂
  6.  
  7. ※このスクリプトは、ちいさな本屋様([url]http://xrxs.at-ninja.jp/[/url])
  8. が製作されたものをtamuraがACE用に改造した物です。
  9.  
  10. 原版:
  11.  ▽▽▽ XRXSv2. メッセージ表示フルグレードアップVX ▽▽▽
  12.  publish 2010/ 3/ 2
  13.  update  - 11/ 1/10a
  14.  
  15.  
  16. ※※警告※※
  17. THINK_TAIL や SYSTEM_LINE の機能を使わない場合は、
  18. これらに使用していないスイッチを割り当てておいてください。
  19.  
  20.  
  21. 「立ち絵機能」をONにしている時に、立ち絵を表示せずに、ウィンドウ位置を
  22. 右か左に変更した時、テールのY座標がずれるようです。
  23. 原因は調査中です。立ち絵を表示しない時は、イベントコマンド「注釈」で、
  24. 「立ち絵表示 off」と記述して立ち絵機能をOFFにしておいてください。
  25.  
  26. ●機能一覧
  27. ・イベントコマンド「スクリプト」で、$win_x $win_yに値を入力すると、
  28.  ($win_x 、$win_y)の位置にウィンドウを表示する。画面左上が(0,0)。
  29.  
  30. ・キーボードのQ(装備画面で前のキャラに戻るボタン)を押すと、
  31.  ウィンドウが消える。Qか決定、キャンセルキーで元に戻る。
  32.  
  33. ・イベントコマンド「スクリプト」で、
  34. $name_right = true
  35. と入力すれば、ネームウィンドウがウィンドウの右に移ります。
  36. 元に戻すには、イベントコマンド「スクリプト」で
  37. $name_right = false
  38. と入力すれば、左側に戻ります。
  39.  
  40.  
  41. ・SYSTEM_LINEに指定したスイッチをON/OFFにすると、
  42. 文章の1行目を表示しない/表示する を切り替えることができます。
  43.  
  44.  
  45. ・文章のどこでもいいので、以下の表記を行う。
  46. ・ \name[] : []の中の文字を、ウィンドウ左上に小さく表示する。
  47.  表示させる名前には、制御文字 \V、\P、\N、\G が使用可能。
  48.  
  49. ・ポップアップウィンドウの表示の仕方。
  50.  \h[-1] : プレーヤーの上にウィンドウをポップ。
  51.  \h[0] : 現在アクティブのイベントの上にウィンドウをポップ。
  52.  \h[1] : IDが1番のイベントの上にウィンドウをポップする。
  53.  hは大文字でもOK。
  54.  \h[ナタリー] : イベントの名前がナタリーとなっているイベントの上にポップする。
  55.  
  56. ・サイドビュー導入時
  57.  \h[1] : 指定された番号の者の上にウィンドウをポップ。
  58.   アクター側から1、2、3……、終わったら次に敵グループを加算して数える。
  59.   パーティの3番目は3、パーティが4人なら敵の1番目は5、ということ。
  60.  \h[スライムA] : 名前がスライムAとなっている者にポップ。
  61.  
  62.  ポップアップを行うとき、
  63.  「メッセージの表示」の設定で、ウィンドウの「表示位置」によって、
  64.  ウィンドウがイベントの上に出るか下に出るかを設定できます。
  65.  
  66. ウィンドウは通常の大きさのまま、テールだけ表示したい場合は、
  67.  \t[-2] : ウィンドウが上下に表示される時は、X座標をMINAS_TWE_X_POSで固定。
  68.            $win_x で左右に表示される時は、Y座標がウィンドウの中心やや下で固定。
  69.  \t[-3] : ウィンドウが上下に表示される時は、X座標をMINAS_THREE_X_POSで固定。
  70.            $win_x で左右に表示される時は、Y座標がウィンドウの中心やや下で固定。
  71.  \t[-1] : プレーヤーの上に向かってテール表示。
  72.  \t[0] : 現在アクティブのイベントに向かってテール表示。
  73.  \t[1] : IDが1番のイベントの上に向かってテール表示。
  74.  
  75.  その他
  76.  \O[128] : 文字を透明にする。128はalphaの値で、0で透明、255で通常。
  77.  \D : 文字に影をつける
  78.  \hold : メッセージ表示の、最後の文章に限定。
  79.       メッセージが終わっても、ウィンドウを閉じずに残します。
  80.       他のメッセージが表示されて次へ送られる時に消えます。
  81.       なお、ホールドされているウィンドウは、Qボタンで消せません。
  82.  
  83.  \skin[skin01] : ウィンドウスキンを、skin01.png に変更します。
  84.      VXACEのデフォルトに戻したい場合は \skin[Window] です。
  85.      スキンのファイルは必ず Graphics\System フォルダに入れておいてください。
  86.  
  87.  \tone[-34,0,68,0] : ウィンドウの色を変更します。
  88.    この例だとVXACEのデフォルトです。
  89.    データベースのシステムタブで、色を調べられます。
  90.    4つ目の値はgrayと呼ばれ、通常は0です。
  91.      
  92.  
  93.  
  94.  
  95.  
  96. ●その他
  97. ・ACEに標準装備されている機能は通常通り使用できます。
  98. ・A1殿([url]http://a1tktk.web.fc2.com/[/url])の立ち絵スクリプトに対応しています。
  99.  このスクリプトの上に「RGSS3用A1共通処理」
  100.  このスクリプトの下に「空メッセージでウィンドウを開かない」「立ち絵表示」を
  101.  配置して下さい。
  102.  残念ながら、「ネームウィンドウ」は使えません。上記\nameをお使いください。
  103. ※立ち絵を表示しない時は、注釈で「立ち絵表示 off」とした方が無難です。
  104. ・イベントの下から話しかけたら上へポップ、上から話しかけたら下へポップするという
  105.  機能を追加。カスタマイズポイントで POP_DIRECTION = ture と変更のこと。
  106.  
  107.  
  108. ●廃止機能 
  109. ・\Iがすでに使われているので、イタリック文字変換を廃止。
  110. ・スピード変更、改行、最後に入手したアイテムの表示を、ACE化にともない廃止。
  111.  
  112.  
  113. 【改訂履歴】
  114. 2012.01.10  ・ウィンドウを消したまま次のウィンドウを自動で表示すると、
  115.               ネームウィンドウが表示されるのを修正。
  116. 2012.01.11  ・ネームウィンドウが出しっぱなしになるのを修正。
  117. 2012.01.12  ・メニューを出してから決定ボタンを押すとネームウィンドウがでる不具合の修正。
  118. 2012.02.01 ・ネームウィンドウのオープン&クローズのタイミングを変更。
  119.       ・hold機能を追加。
  120. 2012.02.10 ・キャラポップした時、一行ずつしか表示されない不具合を修正。
  121. 2012.02.14 ・アイテム名などの文字数が正常に取得できなかったのを修正。
  122. 2012.02.21 ・話しかけられた方向によって、ポップ方向を変えられるようにした。
  123. 2012.02.25 ・すべてのシーン遷移の際はテールを破棄(イベント中でショップ起動など)
  124. 2012.02.28 ・エスケープ文字の処理が上手くいかない問題について暫定対策。
  125. 2012.03.05 ・微妙にウィンドウ幅が足りない時があったので、僅かにウィンドウ幅追加。
  126. 2012.03.14 ・ポップアップ時の顔グラ表示に対応。
  127. 2012.04.20 ・吹きだしが大型になると選択肢が入りきらない不具合の修正。
  128.             ・ネームウィンドウが残ったままシーン遷移があると、ネームウィンドウが
  129.              閉じない不具合の修正。
  130. 2012.05.02  ・名前には、制御文字 \V、\P、\N、\G が使用可能。
  131.             ・\V については、2段階の入れ子が使用可能。
  132.             ・ウィンドウ消去機能を、「背景を暗くする」に対応。
  133. 2012.05.09 ・通常の上表示のとき、ネームウィンドウが見切れるので少し下にずらす。
  134. 2012.05.12 ・ネームウィンドウの幅と高さを変更可能にした。
  135.             ・ネームウィンドウの高さを変えると、どんどん下に伸びるのを修正。
  136. 2012.07.15 ・イベントコマンドで、$name_right = true と入力すると、
  137.        名前ウィンドウが右に移ります。
  138. 2012.08.26 ・思案型テールへの変更機能追加。
  139.             ・文章の1行目を表示しない機能は、スイッチを使えるようにした。
  140.              (セーブ&ロードに対応していないため)
  141.              なお、従来の$system_line も使用可能。
  142. 2012.10.08 ・ウィンドウスキンおよびウィンドウの色を変更可能にした。
  143. 2012.10.16 ・立ち絵の指定がない時にエラーが起こるのを修正。
  144. 2012.10.17 ・A1殿の立ち絵スクリプトの最新版に対応。
  145. 2013.06.20 ・上記の説明が間違っている個所があったので修正。
  146. 2014.02.12 ・文字の色を変えると不自然なスペースができるのを修正。
  147. 2014.06.03 ・サイドビュー導入時でもウィンドウを表示できるようにしました。
  148.       ・名前を指定して、ポップアップウィンドウを表示できるようになりました。
  149.  
  150. =end
  151.  
  152. #==============================================================================
  153. # カスタマイズポイント
  154. #==============================================================================
  155. #=begin
  156. class Window_Message < Window_Base
  157.   #
  158.   # 基本行数
  159.   #
  160.   MAX_LINE = 4
  161.   #
  162.   # \p[] - キャラポップの高さ
  163.   #
  164.   CHARPOP_HEIGHT = 40
  165.   #
  166.   #
  167.   #\name[]で表示されるウィンドウのX座標、Y座標、幅、高さ の変更値。
  168.   #座標は、メッセージウィンドウの左上端が原点。名前はウィンドウ中央に表示。
  169.   NAME_WINDOW_OFFSET_X =   0
  170.   NAME_WINDOW_OFFSET_Y = -37
  171.   NAME_WINDOW_OFFSET_WIDTH = 0
  172.   NAME_WINDOW_OFFSET_HIGHT = 5
  173.  
  174.   #
  175.   #
  176.   MINAS_TWE_X_POS = 100 # $t[-2]のときの、テールのX座標。
  177.   MINAS_THREE_X_POS = 444 # $t[-3]のときの、テールのX座標。
  178.  
  179.   POP_DIRECTION = false #イベントの方向を考慮。
  180.  
  181.   THINK_TAIL = 101 #この番号のゲームスイッチがONの時、思案型テールになります。
  182.   SYSTEM_LINE = 102 #この番号のゲームスイッチがONの時、最初の1行を表示しません。
  183.  
  184. end
  185.  
  186. #(メモ)上表示で、ネームウィンドウのために少し下にずらす機能は、
  187. #再定義したupdate_placement_positionのところ。
  188.  
  189. #==============================================================================
  190. # ■ BattleManager
  191. #------------------------------------------------------------------------------
  192. #  戦闘の進行を管理するモジュールです。
  193. #==============================================================================
  194. module BattleManager
  195.   #--------------------------------------------------------------------------
  196.   # ● 逃走の処理
  197.   #--------------------------------------------------------------------------
  198.   def self.process_escape_hukidasi
  199.     $now_escape = true
  200.     process_escape_hukidasi_default
  201.   end
  202.   #--------------------------------------------------------------------------
  203.   # ● クラスメソッドのエイリアス
  204.   #--------------------------------------------------------------------------
  205.   class << self
  206.     alias :process_escape_hukidasi_default :process_escape
  207.     alias :process_escape :process_escape_hukidasi
  208.   end
  209. end  
  210.  
  211. #==============================================================================
  212. # 参照機能
  213. #==============================================================================
  214. class Game_Temp
  215.   attr_accessor :last_gain_material
  216.   attr_accessor :last_gain_holder
  217. end
  218.  
  219. #==============================================================================
  220. # ■ Game_Event
  221. #==============================================================================
  222. class Game_Event < Game_Character
  223.   #--------------------------------------------------------------------------
  224.   # ● 公開インスタンス変数
  225.   #--------------------------------------------------------------------------
  226.   attr_reader   :event
  227. end  
  228.  
  229. class Window_Message < Window_Base
  230.   #--------------------------------------------------------------------------
  231.   # ● 改ページ処理
  232.   #--------------------------------------------------------------------------
  233.   def new_page(text, pos)
  234.     contents.clear
  235.     draw_face($game_message.face_name, $game_message.face_index, 0, 0)
  236.     reset_font_settings
  237.     pos[:x] = new_line_x
  238.  
  239.     #変更部分。システム用の一行目を表示しない。
  240.     if $system_line != true and $game_switches[SYSTEM_LINE] != true
  241.       pos[:y] = 0
  242.     else
  243.       if !$game_party.in_battle or $svhuki
  244.         if $now_escape #逃走中。サイドビューでは、逃走中はin_battleがfalse
  245.           pos[:y] = 0
  246.           $now_escape = false
  247.         else
  248.           pos[:y] = 0 - line_height #最初の一行を表示しない。
  249.         end
  250.       else
  251.         pos[:y] = 0
  252.       end
  253.     end
  254.  
  255.     pos[:new_x] = new_line_x
  256.     pos[:height] = calc_line_height(text)
  257.     clear_flags
  258.   end
  259. end
  260.  
  261. #==============================================================================
  262. # フルグレードアップベース - 制御文字・基本機能
  263. #==============================================================================
  264. class Window_Message < Window_Base
  265.   attr_accessor :tail
  266.   #--------------------------------------------------------------------------
  267.   # ● 特殊文字の変換 + 準備
  268.   #     変換・消去してもいい部分を処理、フラグのセット。
  269.   #--------------------------------------------------------------------------
  270.   alias xrxsv2_convert_escape_characters convert_escape_characters
  271.   def convert_escape_characters(text)
  272.     #@textsが使いずらいので、ここで別変数に保管。
  273.     @all_texts = []
  274.     str = text.gsub(/\\/) { "\e" }
  275.     @all_texts = str.split("\n")
  276.  
  277.     #この段階で、変数・アクター名を変換してしまう。
  278.     #ネームウィンドウ内の文字を変換するため。
  279.     text = convert_escape_characters_easy(text)
  280.  
  281.     # 初期化
  282.     contents.font.size   = Font.default_size
  283.     contents.font.bold   = Font.default_italic
  284.     contents.font.italic = Font.default_bold
  285.     contents.font.shadow = Font.default_shadow
  286.     @type_wait = 0
  287.     @line_widths = []
  288.     @line_aligns = []
  289.     self.pop_character = nil
  290.     # ウィンドウ保持指定\holdがあるか?
  291.     @window_hold = (text.gsub!(/\\hold/) { "" } != nil)
  292.     # \info
  293.     @info_mode = (text.gsub!(/\\info/) { "" } != nil)
  294.     # 改行削除指定\_があるか?
  295.     if (/\\_(.*?)\x00/.match(@text)) != nil
  296.       $game_message.choice_start -= 1
  297.       text.gsub!(/\\_(.*?)\x00/) { $1.to_s }
  298.     end
  299.     # \name 判定
  300.     if text.sub!(/\\[Nn]ame\[(.*?)\]/) { "" }
  301.       name = $1
  302.       bitmap = @name_sprite.bitmap
  303.       w = [bitmap.text_size(name).width, 1].max + NAME_WINDOW_OFFSET_WIDTH
  304.       bitmap.dispose
  305.       @name_sprite.bitmap = Bitmap.new(w, 32)
  306.       bitmap = @name_sprite.bitmap
  307.       bitmap.draw_text(0, 0, bitmap.width, bitmap.height, name)
  308.       @name_window.width = w + 16
  309.       @name_window.height = bitmap.height + NAME_WINDOW_OFFSET_HIGHT
  310.       @name_window.create_contents
  311.       @name_window.open if @name_window.openness == 0
  312.       if self.visible #名前だけ表示されるのを防止。
  313.         @name_window.visible = true
  314.         @name_sprite.visible = true
  315.       else
  316.         @name_window.visible = false
  317.         @name_sprite.visible = false
  318.       end
  319.     else
  320.       @name_window.visible = false
  321.       @name_sprite.visible = false
  322.       @name_sprite.bitmap.dispose
  323.       @name_sprite.bitmap = Bitmap.new(32,32)
  324.     end
  325.     $name = $1 #あれこれで使うので、ネームウィンドウに表示予定の名前を取得。
  326.     #スキン変更
  327.     if text.sub!(/\\[Ss]kin\[(.*?)\]/) { "" }
  328.       skin = $1
  329.       self.windowskin = Cache.system(skin)
  330.       @name_window.windowskin = Cache.system(skin)
  331.     end
  332.     #ウィンドウトーン変更
  333.     if text.sub!(/\\[Tt]one\[(\-?\d+),(\-?\d+),(\-?\d+),(\-?\d+)\]/) { "" }
  334.       $game_system.window_tone.red = $1.to_f
  335.       $game_system.window_tone.green = $2.to_f
  336.       $game_system.window_tone.blue = $3.to_f
  337.       $game_system.window_tone.gray = $4.to_f
  338.     end
  339.     # キャラボップモード
  340.     if text.gsub!(/\\[Hh]\[-1\]/) { "" }
  341.       self.pop_character = -1
  342.     elsif text.gsub!(/\\[Hh]\[([0-9]+)\]/) { "" }
  343.       self.pop_character = $1.to_i
  344.     elsif text.gsub!(/\\[Hh]\[(.*?)\]/) { "" } #名前指定(サイドビュー対応)
  345.       self.pop_character = 0 #見つからないときのため、最初に0を入力。
  346.       if $game_party.in_battle
  347.         members = $game_party.members + $game_troop.members
  348.         members.each_with_index {|member , index|
  349.           if member.name == $1
  350.             self.pop_character = index +1
  351.             break
  352.           end
  353.         }
  354.       else
  355.         members = $game_map.events
  356.         members.each_with_index {|member , index|
  357.           if member[1].event.name == $1
  358.             self.pop_character = index + 1
  359.             break
  360.           end
  361.         }
  362.       end
  363.     elsif text.gsub!(/\\[Hh]/) { "" }
  364.       self.pop_character = 0
  365.     #テール表示モード
  366.     elsif text.gsub!(/\\[Tt]\[-1\]/) { "" }
  367.       self.tail_character = -1
  368.     elsif text.gsub!(/\\[Tt]\[-2\]/) { "" }
  369.       self.tail_character = -2
  370.     elsif text.gsub!(/\\[Tt]\[-3\]/) { "" }
  371.       self.tail_character = -3
  372.     elsif text.gsub!(/\\[Tt]\[([0-9]+)\]/) { "" }
  373.       self.tail_character = $1.to_i
  374.     elsif text.gsub!(/\\[Tt]/) { "" }
  375.       self.tail_character = 0
  376.     else
  377.       self.pop_character = nil
  378.     end
  379.  
  380.     # 制御文字処理
  381.     text = xrxsv2_convert_escape_characters(text)
  382.     text.gsub!(/\\[Ss]\[([0-9]+)\]/i) { "\eS[#{$1}]" }
  383.     text.gsub!(/\\[Oo]\[([0-9]+)\]/i) { "\eO[#{$1}]" }
  384.     text.gsub!(/\\last_holder/i) { "\e18" }
  385.     text.gsub!(/\\last_material/i) { "\e19" }
  386.     text.gsub!(/\\B/) { "\eB" }
  387.     text.gsub!(/\\D/) { "\eD" }
  388.     #text.gsub!(/\\n/) { "\n" }
  389.     #
  390.     # ライン情報の取得
  391.     rxs = ["\x01","\x02","\x03","\x04","\x05","\x06","\x07","\x08",
  392.       /\[([0-9]+)\]/,
  393.       "\x11","\x12","\x13","\x14", "\x15", "\x16", "\x17", "\x18","\x19"]
  394.     lines = text.split("\x00")
  395.     @lines_max = lines.size
  396.     for i in 0...@lines_max
  397.       line = lines[i]
  398.       for rx in rxs
  399.         line.gsub!(rx) {""}
  400.       end
  401.       @line_aligns[i] =
  402.         line.sub!(/\\center/) {""} ? CENTER :
  403.         line.sub!(/\\right/)  {""} ? RIGHT :
  404.                                      AUTO
  405.       # 行の横幅の取得と設定
  406.       cx = text_width_no_escape(line,text) #test
  407.       #cx = contents.text_size(line,text).width
  408.       @line_widths[i] = cx
  409.     end
  410.     # 位置揃え制御文字の削除
  411.     text.gsub!(/\\center/) {""}
  412.     text.gsub!(/\\right/) {""}
  413.     # キャラポップ時のウィンドウリサイズ
  414.     reszie_window_for_pop
  415.  
  416.     del_tail # if @tail != nil
  417.     # $mes_id が空のときと戦闘中はふきだしを表示しない
  418.     if defined?($game_system.show_stand_picture) #立ち絵に対応。
  419.       $mes_id = -1 if $game_system.show_stand_picture == true
  420.     end
  421.     if $mes_id != nil and (!$game_party.in_battle or $svhuki)
  422.       # ふきだしのテールを描画
  423.       skin = "Window"
  424.       if @background == 0
  425.         #画像の準備
  426.         @tail = Sprite.new
  427.         @tail.visible = false
  428.         # 位置を取得
  429.         tale_pos = get_tale_pos
  430.         if $win_x != nil
  431.           if $win_x > 0
  432.             @tail.bitmap = Cache.system(skin + "-right")
  433.             @tail.x = tale_pos[0]
  434.             @tail.y = tale_pos[1]
  435.             @tail.z = self.z + 1
  436.           elsif  $win_x < 0
  437.             @tail.bitmap = Cache.system(skin + "-left")
  438.             @tail.x = tale_pos[0]
  439.             @tail.y = tale_pos[1]
  440.             @tail.z = self.z + 1
  441.           else
  442.             create_tail_up_under
  443.           end
  444.         else
  445.           create_tail_up_under
  446.         end
  447.         # エクストラスプライトに登録
  448.         @extra_sprites = [] if @extra_sprites.nil?
  449.         @extra_sprites.push(@tail) if @tail != nil
  450.         # 更新
  451.         update_tail
  452.       end
  453.     end
  454.  
  455.     open_and_wait #リサイズが終わった時点でウィンドウオープン。
  456.  
  457.     return text
  458.   end
  459.   #--------------------------------------------------------------------------
  460.   # ● 制御文字の変換。
  461.   #    変数・パーティ名・アクター名・所持金のみ変換する。
  462.   #    文字「\」はエスケープ文字(\e)に変換。
  463.   #--------------------------------------------------------------------------
  464.   def convert_escape_characters_easy(text)
  465.     result = text.to_s.clone
  466.     result.gsub!(/\\[vV]\[/)          { "\eV\[" }
  467.     result.gsub!(/\\[nN]\[/)          { "\eN\[" }
  468.     result.gsub!(/\\[pP]\[/)          { "\eP\[" }
  469.     result.gsub!(/\\[gG]/)          { "\eG" }
  470.     result.gsub!(/\eV\[(\d+)\]/i) { $game_variables[$1.to_i] }
  471.     result.gsub!(/\eV\[(\d+)\]/i) { $game_variables[$1.to_i] }
  472.     result.gsub!(/\eN\[(\d+)\]/i) { actor_name($1.to_i) }
  473.     result.gsub!(/\eP\[(\d+)\]/i) { party_member_name($1.to_i) }
  474.     result.gsub!(/\eG/i)          { Vocab::currency_unit }
  475.     result
  476.   end
  477.   #--------------------------------------------------------------------------
  478.   # ● 文字の長さを取得する。エスケープ文字は含まない。
  479.   # line : 表示しようとしている全ての文字列。
  480.   # text : その列の文字。
  481.   #--------------------------------------------------------------------------
  482.   def text_width_no_escape(line , text_o)
  483.     add = 5 #微妙に足りないので水増し。
  484.     text = Marshal.load(Marshal.dump(text_o))
  485.     text.gsub!(/\ehold/) { "" }
  486.     text.gsub!(/\einfo/) { "" }
  487.     # 改行削除指定\_があるか?
  488.     if (/\\_(.*?)\x00/.match(@text)) != nil
  489.       $game_message.choice_start -= 1
  490.       text.gsub!(/\\_(.*?)\x00/) { "" }
  491.     end
  492.     # \name 判定
  493.     text.sub!(/\e[Nn]ame\[(.*?)\]/) { "" }
  494.     text.gsub!(/\e[Hh]\[-1\]/) { "" }
  495.     text.gsub!(/\e[Hh]\[([0-9]+)\]/) { "" }
  496.     text.gsub!(/\e[Hh]/) { "" }
  497.     text.gsub!(/\e[Tt]\[-1\]/) { "" }
  498.     text.gsub!(/\e[Tt]\[-2\]/) { "" }
  499.     text.gsub!(/\e[Tt]\[-3\]/) { "" }
  500.     text.gsub!(/\e[Tt]\[([0-9]+)\]/) { "" }
  501.     text.gsub!(/\e[Tt]/) { "" }
  502.     # 制御文字処理
  503.     text.gsub!(/\e[Ss]\[([0-9]+)\]/i) { "" }
  504.     text.gsub!(/\e[Oo]\[([0-9]+)\]/i) { "" }
  505.     text.gsub!(/\elast_holder/i) { "" }
  506.     text.gsub!(/\elast_material/i) { "" }
  507.     #text.gsub!(/\eV/) { "" } #変数に置き換える。
  508.     #text.gsub!(/\eN/) { "" } #名前へ置き換える。
  509.     #text.gsub!(/\eP/) { "" } #名前へ置き換える。
  510.     #text.gsub!(/\eG/) { "" } #金額へ置き換える。
  511.     text.gsub!(/\eC\[([0-9]+)\]/) { "" }
  512.     text.gsub!(/\eB/) { "" }
  513.     text.gsub!(/\eD/) { "" }
  514.     if text =~ /\eI/
  515.       loop do
  516.         if str = text.sub!(/\eI\[(\d+)\]/){ "" }
  517.           add += 24
  518.         else
  519.           break
  520.         end
  521.       end
  522.     end
  523.     #text.gsub!(/\\n/) { "\n" }
  524.     text.sub!(/\ecenter/) {""}
  525.     text.sub!(/\eright/)  {""}
  526.     text.gsub!(/\ecenter/) {""}
  527.     text.gsub!(/\eright/) {""}
  528.  
  529.     text = xrxsv2_convert_escape_characters(text)
  530.     basic_width = text_size(text).width + add
  531.     esc = text.scan(/\e(\S)/)
  532.     return ( basic_width - esc.size * (contents.font.size - 4) ) #\eの幅は20?
  533.   end
  534.   #--------------------------------------------------------------------------
  535.   # ● 最も長い列の長さを調べる。エスケープ文字は含まない。
  536.   #--------------------------------------------------------------------------
  537.   def max_width
  538.     text_size = []
  539.     for i in 0 ... @all_texts.size
  540.       text_size.push text_width_no_escape(@all_texts[i],@all_texts[i]) + 20
  541.     end
  542.     return text_size.max
  543.   end
  544.   #--------------------------------------------------------------------------
  545.   # ● 吹きだしテールが上か下の場合の画像を準備。
  546.   #--------------------------------------------------------------------------
  547.   def create_tail_up_under
  548.     skin = "Window"
  549.     tale_pos = get_tale_pos
  550.     case @position
  551.     when 0  # 上
  552.       @tail.bitmap = Cache.system(skin + "-top")
  553.       @tail.x = tale_pos[0]
  554.       @tail.y = tale_pos[1]
  555.       @tail.z = self.z + 1
  556.     when 1  # 中
  557.       @tail.dispose
  558.       @tail = nil
  559.     when 2  # 下
  560.       @tail.bitmap = Cache.system(skin + "-under")
  561.       @tail.x = tale_pos[0]
  562.       @tail.y = tale_pos[1]
  563.       @tail.z = self.z + 1
  564.     end
  565.   end
  566.   #--------------------------------------------------------------------------
  567.   # ● 全テキストの処理
  568.   #--------------------------------------------------------------------------
  569.   def process_all_text
  570.     #open_and_wait #リサイズがあるので、すぐにウィンドウをオープンしない。
  571.     text = convert_escape_characters($game_message.all_text)
  572.     pos = {}
  573.     new_page(text, pos)
  574.     process_character(text.slice!(0, 1), text, pos) until text.empty?
  575.   end
  576.   #--------------------------------------------------------------------------
  577.   # ● メッセージの更新 *
  578.   #--------------------------------------------------------------------------
  579.   def update_message
  580.     @wait_count = @type_wait
  581.     loop do
  582.       c = @text.slice!(/./m)
  583.       case update_message_type(c)
  584.       when 1
  585.         break
  586.       when 2
  587.         next
  588.       end
  589.       break unless @show_fast or @line_show_fast
  590.     end
  591.   end
  592.   #--------------------------------------------------------------------------
  593.   # 一文字の描画 (返り値 1:break, 2:next)
  594.   #--------------------------------------------------------------------------
  595. #=begin
  596.   def process_escape_character(code, text, pos)
  597.     case code.upcase
  598.     when '$'
  599.       @gold_window.open
  600.     when '.'
  601.       wait(15)
  602.     when '|'
  603.       wait(60)
  604.     when '!'
  605.       input_pause
  606.     when '>'
  607.       @line_show_fast = true
  608.     when '<'
  609.       @line_show_fast = false
  610.     when '^'
  611.       @pause_skip = true
  612.     #when 'n'                      # 改行
  613.     #  new_line
  614.     #  max = MAX_LINE
  615.     #  max = 14 if self.pop_character != nil
  616.     #  if @line_count >= max      # 行数が最大のとき
  617.     #    unless @text.empty?           # さらに続きがあるなら
  618.     #      self.pause = true           # 入力待ちを入れる
  619.           #return 1
  620.     #    end
  621.     #  end
  622.     #when 'S'                       # \S[n]  (スピード変更)
  623.     #  text.sub!(/\[([0-9]+)\]/, "")
  624.     #  @type_wait = $1.to_i
  625.     #  return 2
  626.     when 'O'                       # \O 文字を透明にする。
  627.       text.sub!(/\[([0-9]+)\]/, "")
  628.       contents.font.color.alpha = $1.to_i
  629.       #return 2
  630.     when 'D' #\D 文字に影をつける
  631.       contents.font.shadow ^= true
  632.     #when '18'
  633.     #  name = ($game_temp.last_gain_holder.name rescue "")
  634.     #  update_message_type_draw_at(name)
  635.     #when '19'
  636.     #  item = ($game_temp.last_gain_material.item rescue nil)
  637.     #  draw_item_name(item, @contents_x, @contents_y)
  638.     #  @contents_x += 196
  639.     else
  640.       super
  641.     end
  642.  
  643.   end
  644. #=end
  645.   #--------------------------------------------------------------------------
  646.   # ● 改ページ処理
  647.   #--------------------------------------------------------------------------
  648.   alias xrxsv2_new_page new_page
  649.   def new_page(text, pos)
  650.     xrxsv2_new_page(text, pos)
  651.     update_charpop_window
  652.   end
  653.   #--------------------------------------------------------------------------
  654.   # ● 改行位置の取得
  655.   #--------------------------------------------------------------------------
  656.   #def new_line_x
  657.   #  $game_message.face_name.empty? ? 0 : 112
  658.   #end
  659.   #--------------------------------------------------------------------------
  660.   # ● 改行処理
  661.   #--------------------------------------------------------------------------
  662.   alias xrxsv2_new_line_x new_line_x
  663.   def new_line
  664.     xrxsv2_new_line
  665.     set_align
  666.   end
  667.   #--------------------------------------------------------------------------
  668.   # 位置揃え
  669.   #--------------------------------------------------------------------------
  670.   def set_align
  671.     w = @line_widths[@line_count].to_i
  672.     a = @line_aligns[@line_count]
  673.     case a
  674.     when CENTER
  675.       @contents_x = @contents_x + ((contents.width - @contents_x) - w) / 2
  676.     when RIGHT
  677.       @contents_x = contents.width - w
  678.     end
  679.   end
  680.   #--------------------------------------------------------------------------
  681.   # ● ファイバーのメイン処理 ☆再定義
  682.   #--------------------------------------------------------------------------
  683.   def fiber_main
  684.     $game_message.visible = true
  685.     update_background
  686.     update_placement
  687.     loop do
  688.       process_all_text if $game_message.has_text?
  689.       process_input
  690.       $game_message.clear
  691.       @gold_window.close
  692.       process_hold #ホールドウィンドウの処理。
  693.       Fiber.yield
  694.       break unless text_continue?
  695.     end
  696.     close_and_wait
  697.     $game_message.visible = false
  698.     @fiber = nil
  699.   end
  700.   #--------------------------------------------------------------------------
  701.   # 定数
  702.   #--------------------------------------------------------------------------
  703.   AUTO   = 0
  704.   LEFT   = 1
  705.   CENTER = 2
  706.   RIGHT  = 3
  707. end
  708. #==============================================================================
  709. # アクティブイベント取得
  710. #==============================================================================
  711. class Game_Interpreter
  712.   attr_reader   :event_id
  713. end
  714.  
  715.  
  716. #==============================================================================
  717. # 各種機能の追加 - キャラポップ/ネーム/ホールド
  718. #==============================================================================
  719. class Window_Message < Window_Base
  720.   #--------------------------------------------------------------------------
  721.   # ● カーソルの更新 *
  722.   #--------------------------------------------------------------------------
  723.   def update_cursor
  724.     if @index >= 0
  725.       x = ($game_message.face_name.empty? ? 0 : 112)
  726.       y = ($game_message.choice_start + @index) * WLH - 1
  727.       w = contents.width - x
  728.       if self.pop_character != nil
  729.         x += 28
  730.         w -= 20
  731.       end
  732.       self.cursor_rect.set(x, y, w, WLH)
  733.     else
  734.       self.cursor_rect.empty
  735.     end
  736.   end
  737.   #--------------------------------------------------------------------------
  738.   # キャラクターの取得
  739.   #   parameter : パラメータ
  740.   #--------------------------------------------------------------------------
  741.   def get_character(parameter)
  742.     # パラメータで分岐
  743.     case parameter
  744.     when -1  # プレイヤー
  745.       return $game_player
  746.     when 0  # 現在アクティブなイベント
  747.       id = $game_map.interpreter.event_id
  748.       events = $game_map.events
  749.       return events == nil ? nil : events[id]
  750.     else  # 特定のイベント
  751.       if $game_party.in_battle and $svhuki #サイドビュー対応
  752.         battle_chara = [nil] + $game_party.members + $game_troop.members
  753.         return battle_chara[parameter]
  754.       else
  755.         events = $game_map.events
  756.         return events == nil ? nil : events[parameter]
  757.       end  
  758.     end
  759.   end
  760.   #--------------------------------------------------------------------------
  761.   # (メッセージ終了時)ホールドの処理
  762.   #--------------------------------------------------------------------------
  763.   def process_hold
  764.     if @window_hold
  765.       @held_windows.push(Window_Copy.new(self))
  766.       @held_windows.push(Window_Copy.new(@name_window))
  767.       @held_windows.push(Sprite_Copy.new(@name_sprite))
  768.       @held_windows.push(Sprite_Copy.new(@back_sprite))
  769.       for sprite in @extra_sprites
  770.         next if sprite.disposed?
  771.         @held_windows.push(Sprite_Copy.new(sprite))
  772.       end
  773.       @extra_sprites.clear
  774.       self.openness = 0
  775.       #@name_window.openness = 0
  776.       @back_sprite.visible = false
  777.     else
  778.       @held_windows.each {|object| object.dispose}
  779.       @held_windows.clear
  780.     end
  781.     #@name_window.close
  782.     #@name_sprite.visible = false
  783.   end
  784.   #--------------------------------------------------------------------------
  785.   # キャラポップ位置の設定と取得
  786.   #--------------------------------------------------------------------------
  787.   def pop_character=(character_id)
  788.     @pop_character = character_id
  789.   end
  790.   def pop_character
  791.     return @pop_character
  792.   end
  793.   #--------------------------------------------------------------------------
  794.   # キャラポップ時のウィンドウリサイズ
  795.   #--------------------------------------------------------------------------
  796.   def reszie_window_for_pop
  797.     #キャラポップ
  798.     if self.pop_character != nil
  799.       #max_x = @line_widths.max.to_i
  800.       #n  = max_x + 32
  801.       n = 0
  802.       n += $game_message.face_name.empty? ? 0 : 122
  803.       m  = $game_message.face_name.empty? ? 0 : 96
  804.       w  = @name_sprite.bitmap.width
  805.       self.width  = max_width + n
  806.       self.height = [@all_texts.size * line_height, m].max + 32
  807.  
  808.       #システム用の一行目を表示しない。
  809.       if $system_line or $game_switches[SYSTEM_LINE]
  810.         self.height -= line_height if !$game_party.in_battle or $svhuki
  811.       end
  812.  
  813.       create_contents
  814.       update_charpop_window
  815.     elsif @info_mode
  816.       @line_aligns[0] = CENTER
  817.       self.x = - 8
  818.       self.width = Graphics.width + 16
  819.       self.height = 56
  820.       create_contents
  821.     else
  822.       self.x = 0
  823.       self.width  = Graphics.width
  824.       self.height = MAX_LINE * line_height + 32
  825.       update_placement #位置情報修正。
  826.       create_contents
  827.     end
  828.   end
  829.   #--------------------------------------------------------------------------
  830.   # ● 背景スプライトの作成
  831.   #--------------------------------------------------------------------------
  832.   alias xrxsv2_create_back_sprite create_back_sprite
  833.   def create_back_sprite
  834.     xrxsv2_create_back_sprite
  835.     @back_sprite.zoom_x = 1.0 * Graphics.width / @back_sprite.bitmap.width
  836.     @name_window = Window_Base.new(0,0,112,32)
  837.     @name_window.visible = false
  838.     @name_sprite = Sprite.new
  839.     @name_sprite.bitmap = Bitmap.new(32,32)
  840.     @name_sprite.visible = false
  841.     self.x = self.x
  842.     self.y = self.y
  843.     self.z = self.z
  844.     @held_windows = []
  845.     @extra_sprites = []
  846.   end
  847.   #--------------------------------------------------------------------------
  848.   # ● 背景スプライトの解放
  849.   #--------------------------------------------------------------------------
  850.   alias xrxsv2_dispose_back_sprite dispose_back_sprite
  851.   def dispose_back_sprite
  852.     xrxsv2_dispose_back_sprite
  853.     @name_window.dispose if @name_window != nil #メニュー画面を出そうとするとエラー?
  854.     @name_sprite.dispose if @name_sprite != nil
  855.     for window in @held_windows
  856.       window.dispose
  857.     end
  858.   end
  859.   #--------------------------------------------------------------------------
  860.   # ● 背景スプライトの更新
  861.   #--------------------------------------------------------------------------
  862.   alias xrxsv2_update_back_sprite update_back_sprite
  863.   def update_back_sprite
  864.     @name_window.update
  865.     xrxsv2_update_back_sprite
  866.     update_charpop_window
  867.   end
  868.   #--------------------------------------------------------------------------
  869.   # ウィンドウの位置と不透明度の設定 (キャラポップ)
  870.   #--------------------------------------------------------------------------
  871.   def update_charpop_window
  872.     if self.pop_character
  873.       character = get_character(self.pop_character)
  874.       return if character == nil
  875.  
  876.       if defined?(character.sv) and $svhuki #サイドビュー対応
  877.         chara_x = character.sv.x / 100 #- $sv_camera.x * 2
  878.         chara_y = character.sv.y / 100 #- $sv_camera.y
  879.       else
  880.         chara_x = character.screen_x
  881.         chara_y = character.screen_y
  882.       end
  883.  
  884.       # [X座標]
  885.       n = self.width / 2
  886.       n = [n, @name_skin.width + 16].max if @current_name != nil
  887.       w = @name_sprite.bitmap.width
  888.       x = chara_x - [[n, w].max, self.width - 32].min
  889.  
  890.       # [Y座標]
  891.       if self.pop_character == 0 and POP_DIRECTION #イベントの方向を考慮。
  892.         if character.direction == 2 #下向き
  893.           @position = 0 #上にポップ
  894.         elsif character.direction == 2 #上向き
  895.           @position = 2 #下にポップ
  896.         end
  897.       end
  898.       case @position
  899.       when 0
  900.         y = chara_y - CHARPOP_HEIGHT - self.height
  901.       else
  902.         y = chara_y + 16
  903.       end
  904.       x_max = Graphics.width - 4 - self.width
  905.       x_min = 4
  906.       y_max = Graphics.height - self.height
  907.       y_min = 4
  908.       self.x = [[x, x_max].min, x_min].max
  909.       self.y = [[y, y_max].min, y_min].max
  910.     end
  911.   end
  912.   #--------------------------------------------------------------------------
  913.   # 位置の連動
  914.   #--------------------------------------------------------------------------
  915.   def x=(n)
  916.     super
  917.     if @name_window
  918.       if $name_right
  919.         @name_window.x = n + self.width - @name_window.width - NAME_WINDOW_OFFSET_X
  920.         @name_sprite.x = @name_window.x + 8 + NAME_WINDOW_OFFSET_WIDTH / 2
  921.       else
  922.         @name_window.x = n + NAME_WINDOW_OFFSET_X
  923.         @name_sprite.x = @name_window.x + 8 + NAME_WINDOW_OFFSET_WIDTH / 2
  924.       end
  925.     end
  926.   end
  927.   def y=(n)
  928.     super
  929.     if @name_window
  930.       @name_window.y = n + NAME_WINDOW_OFFSET_Y
  931.       @name_sprite.y = n + NAME_WINDOW_OFFSET_Y + 2 + NAME_WINDOW_OFFSET_HIGHT / 2
  932.     end
  933.   end
  934.   def z=(n)
  935.     super
  936.     if @name_window
  937.       @name_window.z = n + 11#1 テールの上に表示されるので、Zを水増しする。
  938.       @name_sprite.z = n + 12#2
  939.     end
  940.   end
  941.   #--------------------------------------------------------------------------
  942.   # ● ファイバーのメイン処理
  943.   #--------------------------------------------------------------------------
  944.   def fiber_main_namewin
  945.     fiber_main_namewin_default
  946.     @name_window.openness = 0
  947.     @name_sprite.bitmap.clear
  948.     $name = ""
  949.   end
  950.   alias :fiber_main_namewin_default :fiber_main
  951.   alias :fiber_main :fiber_main_namewin
  952. end
  953. #==============================================================================
  954. # 伸縮対応
  955. #==============================================================================
  956. class Window_Message < Window_Base
  957.   #--------------------------------------------------------------------------
  958.   # ● ウィンドウの背景と位置の設定 [再定義]
  959.   #--------------------------------------------------------------------------
  960.   def reset_window
  961.     @background = $game_message.background
  962.     @position = $game_message.position
  963.     if @background == 0   # 通常ウィンドウ
  964.       self.opacity = 255
  965.     else                  # 背景を暗くする、透明にする
  966.       self.opacity = 0
  967.     end
  968.     case @position
  969.     when 0  # 上
  970.       self.y = 0
  971.       @gold_window.y = 360
  972.     when 1  # 中
  973.       self.y = (Graphics.height - self.height) / 2
  974.       @gold_window.y = 0
  975.     when 2  # 下
  976.       self.y = Graphics.height - self.height
  977.       @gold_window.y = 0
  978.     end
  979.   end
  980. end
  981. #==============================================================================
  982. # □ Window_Copy
  983. #------------------------------------------------------------------------------
  984. #   指定のウィンドウのコピーを作成します。
  985. #==============================================================================
  986. class Window_Copy < Window_Base
  987.   #--------------------------------------------------------------------------
  988.   # ○ オブジェクト初期化
  989.   #--------------------------------------------------------------------------
  990.   def initialize(window)
  991.     super(window.x, window.y, window.width, window.height)
  992.     self.contents = window.contents.dup unless window.contents.nil?
  993.     self.opacity = window.opacity
  994.     self.back_opacity = window.back_opacity
  995.     self.z = window.z - 3
  996.     self.visible = window.visible
  997.   end
  998. end
  999. #==============================================================================
  1000. # □ Sprite_Copy
  1001. #------------------------------------------------------------------------------
  1002. #   指定のスプライトのコピーを作成します。
  1003. #==============================================================================
  1004. class Sprite_Copy < Sprite
  1005.   #--------------------------------------------------------------------------
  1006.   # ○ オブジェクト初期化
  1007.   #--------------------------------------------------------------------------
  1008.   def initialize(sprite)
  1009.     super()
  1010.     self.bitmap = sprite.bitmap.dup unless sprite.bitmap.nil?
  1011.     self.opacity = sprite.opacity
  1012.     self.x = sprite.x
  1013.     self.y = sprite.y
  1014.     self.z = sprite.z - 3
  1015.     self.ox = sprite.ox
  1016.     self.oy = sprite.oy
  1017.     self.zoom_x = sprite.zoom_x
  1018.     self.visible = sprite.visible
  1019.   end
  1020. end
  1021.  
  1022.  
  1023.  
  1024. #■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□
  1025. #■吹きだしテールの表示ルーチン。
  1026. #■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□
  1027. #==============================================================================
  1028. # +++ 「+ふきだし表示」VX +++
  1029. # by パラ犬  [url]http://2d6.parasite.jp/[/url]
  1030. #      ×
  1031. #    row       [url]http://xms.rdy.jp/[/url]
  1032. #
  1033. # publish 2010/ 3/ 2
  1034. # update  -
  1035. #
  1036. #------------------------------------------------------------------------------
  1037. #    ほぼどんなメッセージウィンドウに対しても後付け可能な「ふきだし表示」です。
  1038. #  また、テール部分のみの自動追尾機能を持ちます。
  1039. #   ふきだし表示をするには、
  1040. #  テール用画像「Window-top」「Window-under」を
  1041. #  「Graphics/System」フォルダにインポートしておく必要があります。
  1042. #==============================================================================
  1043. # ■ Window_Message
  1044. #==============================================================================
  1045. class Window_Message < Window_Base
  1046.   #--------------------------------------------------------------------------
  1047.   # ● メッセージの開始
  1048.   #--------------------------------------------------------------------------
  1049.   alias parashelf_update_all_windows update_all_windows
  1050.   def update_all_windows
  1051.     parashelf_update_all_windows
  1052.     update_tail
  1053.   end
  1054.   #--------------------------------------------------------------------------
  1055.   # クローズ [オーバーライド]
  1056.   #--------------------------------------------------------------------------
  1057.   def close
  1058.     super
  1059.     del_tail
  1060.     @name_window.close if @name_window != nil #ネームウィンドウのクローズ動作。
  1061.   end
  1062.   #--------------------------------------------------------------------------
  1063.   # ● 背景スプライトの更新
  1064.   #--------------------------------------------------------------------------
  1065.   alias parashelf_update_back_sprite update_back_sprite
  1066.   def update_back_sprite
  1067.     parashelf_update_back_sprite
  1068.     update_tail
  1069.   end
  1070.   #--------------------------------------------------------------------------
  1071.   # ○ フレーム更新 (ふきだしテールの更新)
  1072.   #--------------------------------------------------------------------------
  1073.   def update_tail
  1074.     # ふきだしモードではイベントの動きに追従
  1075.     if $mes_id != nil and @tail != nil
  1076.       tale_pos = get_tale_pos
  1077.       @tail.x = tale_pos[0]
  1078.       @tail.y = tale_pos[1]
  1079.       update_tail_bitmap
  1080.     end
  1081.   end
  1082.   ##--------------------------------------------------------------------------
  1083.   # ○ ふきだしテールの画像を更新。
  1084.   #--------------------------------------------------------------------------
  1085.   def update_tail_bitmap
  1086.     skin = "Window"
  1087.     skin = "Think" if $game_switches[THINK_TAIL]
  1088.     if $win_x != nil
  1089.       if $win_x > 0
  1090.         @tail.bitmap = Cache.system(skin + "-right")
  1091.       elsif  $win_x < 0
  1092.         @tail.bitmap = Cache.system(skin + "-left")
  1093.       else
  1094.         case @position
  1095.         when 0  # 上
  1096.           @tail.bitmap = Cache.system(skin + "-top")
  1097.         when 2  # 下
  1098.           @tail.bitmap = Cache.system(skin + "-under")
  1099.         end
  1100.       end
  1101.     else
  1102.       case @position
  1103.       when 0  # 上
  1104.         @tail.bitmap = Cache.system(skin + "-top")
  1105.       when 2  # 下
  1106.         @tail.bitmap = Cache.system(skin + "-under")
  1107.       end
  1108.     end
  1109.     # 可視状態
  1110.     if self.visible == true
  1111.       @tail.visible = self.openness == 255
  1112.     else
  1113.       @tail.visible = false
  1114.     end
  1115.   end
  1116.   #--------------------------------------------------------------------------
  1117.   # ○ テールの位置を計算
  1118.   #--------------------------------------------------------------------------
  1119.   def get_tale_pos
  1120.     if defined?($game_system.show_stand_picture) #A1立ち絵スクリプトを入れている。
  1121.       if $game_system.show_stand_picture #立ち絵on
  1122.         pos = get_tale_pos_stand_pic
  1123.       else
  1124.         pos = get_tale_pos_normal
  1125.       end
  1126.     else
  1127.       pos = get_tale_pos_normal
  1128.     end
  1129.     return pos
  1130.   end
  1131.   #--------------------------------------------------------------------------
  1132.   # ○ テールの位置を計算/立ち絵使用時。※NAME_CHANGEの編集必須。
  1133.   #--------------------------------------------------------------------------
  1134.   def get_tale_pos_stand_pic
  1135.     if $game_message.face_name != ""  and @tail != nil
  1136.       target_name = $game_message.face_name + "_" + $game_message.face_index.to_s
  1137.       name = A1_System::StandPicture::NAME_CHANGE[target_name]
  1138.       chara = name[0] if name != nil
  1139.       if @stand_pic[chara] != nil #立ち絵無しの場合通常通り。
  1140.         x = @stand_pic[chara].pic_sprite.x + @stand_pic[chara].pic_sprite.width / 2
  1141.         y = get_tale_pos_normal_updown
  1142.         update_tail_bitmap
  1143.       else
  1144.         return get_tale_pos_normal #立ち絵が見つからない場合は通常通り。
  1145.       end
  1146.     else
  1147.       return get_tale_pos_normal #立ち絵が見つからない場合は通常通り。
  1148.     end
  1149.     return [x,y]
  1150.   end
  1151.   #--------------------------------------------------------------------------
  1152.   # ○ テールの位置を計算/立ち絵未使用時。
  1153.   #--------------------------------------------------------------------------
  1154.   def get_tale_pos_normal
  1155.     if $mes_id == (-2) #左右の場合は高さはウィンドウ中心。上下ならやや左に配置。
  1156.       if $win_x != nil
  1157.         if $win_x > 0
  1158.           x = $win_x - @tail.width / 2
  1159.           y = self.y + self.height / 2 - @tail.height / 2
  1160.         elsif $win_x < 0
  1161.           x = self.width - @tail.width / 2
  1162.           y = self.y + self.height / 2 - @tail.height / 2
  1163.         else
  1164.           x = MINAS_TWE_X_POS
  1165.           y = get_tale_pos_normal_updown
  1166.         end
  1167.       else
  1168.         x = MINAS_TWE_X_POS
  1169.         y = get_tale_pos_normal_updown
  1170.       end
  1171.     elsif $mes_id <= (-3) #左右の場合は高さはウィンドウ中心。上下ならやや左に配置。
  1172.       if $win_x != nil
  1173.         if $win_x > 0
  1174.           x = $win_x - @tail.width / 2
  1175.           y = self.y + self.height / 2
  1176.         elsif $win_x < 0
  1177.           x = self.width - @tail.width / 2
  1178.           y = self.y + self.height / 2
  1179.         else
  1180.           x = MINAS_THREE_X_POS
  1181.           y = get_tale_pos_normal_updown
  1182.         end
  1183.       else
  1184.         x = MINAS_THREE_X_POS
  1185.         y = get_tale_pos_normal_updown
  1186.       end
  1187.     else
  1188.       character = get_character($mes_id)
  1189.  
  1190.       if defined?(character.sv) and $svhuki #サイドビュー対応
  1191.         if $sv_camera.mirror #バックアタック
  1192.           chara_x = character.sv.x / 100 - $sv_camera.x
  1193.         else
  1194.           chara_x = character.sv.x / 100 - $sv_camera.x * 2
  1195.         end
  1196.         chara_y = character.sv.y / 100 - $sv_camera.y
  1197.       else
  1198.         chara_x = character.screen_x
  1199.         chara_y = character.screen_y
  1200.       end
  1201.  
  1202.       x = [[chara_x - 16, self.x].max, self.x + self.width - 32].min
  1203.       if $win_x != nil
  1204.         if $win_x > 0
  1205.           x = $win_x - @tail.width / 2
  1206.           y = chara_y
  1207.         elsif $win_x < 0
  1208.           x = self.width
  1209.           y = chara_y
  1210.         else
  1211.           y = get_tale_pos_normal_updown
  1212.         end
  1213.       else
  1214.         y = get_tale_pos_normal_updown
  1215.       end
  1216.     end
  1217.     return [x, y]
  1218.   end
  1219.   #--------------------------------------------------------------------------
  1220.   # ○ テールが上下の時、かつ[-2][-3]でない時のy座標の取得。
  1221.   #--------------------------------------------------------------------------
  1222.   def get_tale_pos_normal_updown
  1223.     case @position
  1224.     when 0
  1225.       y = self.y + self.height - @tail.height / 2
  1226.     else
  1227.       y = self.y - @tail.height / 2
  1228.     end
  1229.     return y
  1230.   end
  1231.   #--------------------------------------------------------------------------
  1232.   # ○ ふきだしを破棄
  1233.   #--------------------------------------------------------------------------
  1234.   def del_tail
  1235.     if @tail != nil
  1236.       @tail.dispose
  1237.       @tail = nil
  1238.     end
  1239.   end
  1240. end
  1241. #
  1242. # ▼▲▼ XRXS 9拡張CO-X. ふきだし自動設定 ▼▲▼
  1243. #==============================================================================
  1244. # ■ Window_Message
  1245. #==============================================================================
  1246. class Window_Message < Window_Base
  1247.   #--------------------------------------------------------------------------
  1248.   # ○ ポップキャラクターの設定
  1249.   #--------------------------------------------------------------------------
  1250.   def pop_character=(character_id)
  1251.     @pop_character = character_id
  1252.     $mes_id = character_id
  1253.   end
  1254.   #--------------------------------------------------------------------------
  1255.   # ○ テールキャラクターの設定
  1256.   #--------------------------------------------------------------------------
  1257.   def tail_character=(character_id)
  1258.     #@pop_character = character_id
  1259.     $mes_id = character_id
  1260.   end
  1261. end
  1262.  
  1263.  
  1264. #==============================================================================
  1265. # ■ Window_ChoiceList
  1266. #------------------------------------------------------------------------------
  1267. #  イベントコマンド[選択肢の表示]で、Y座標を修正します。
  1268. #==============================================================================
  1269. class Window_ChoiceList < Window_Command
  1270.   #--------------------------------------------------------------------------
  1271.   # ● ウィンドウ位置の更新
  1272.   #--------------------------------------------------------------------------
  1273.   def update_placement_hukidasi
  1274.     #self.width = [max_choice_width + 12, 96].max + padding * 2
  1275.     #self.width = [width, Graphics.width].min
  1276.     #self.height = fitting_height($game_message.choices.size)
  1277.     #self.x = Graphics.width - width
  1278.     #if @message_window.y >= Graphics.height / 2
  1279.     #  self.y = @message_window.y - height
  1280.     #else
  1281.     #  self.y = @message_window.y + @message_window.height
  1282.     #end
  1283.     update_placement_hukidasi_default
  1284.     if self.y + self.height > Graphics.height
  1285.       self.y -= ( ( self.height + self.y ) - Graphics.height)
  1286.       self.z += 100
  1287.     end
  1288.   end
  1289.   alias :update_placement_hukidasi_default :update_placement
  1290.   alias :update_placement :update_placement_hukidasi
  1291. end
  1292.  
  1293. #==============================================================================
  1294. # ■ Scene_Menu
  1295. #------------------------------------------------------------------------------
  1296. #  メニューを開いてからウィンドウが出るとネームウィンドウが表示される不具合修正。
  1297. #==============================================================================
  1298. #class Scene_Menu < Scene_MenuBase
  1299. #  def terminate_hukidasi_menyu
  1300. #    @name_window.openness = 0 if @name_window != nil
  1301. #    terminate_hukidasi_menyu_default
  1302. #  end
  1303. #  alias :terminate_hukidasi_menyu_default :terminate
  1304. #  alias :terminate :terminate_hukidasi_menyu
  1305. #end
  1306.  
  1307. #■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□
  1308. #■ウィンドウ非表示ルーチン
  1309. #■吹きだしテールとネームウィンドウに対応。
  1310. #■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□
  1311. #==============================================================================
  1312. # L(キーボードのQ)を押すと、メッセージウィンドウを表示・非表示
  1313. #==============================================================================
  1314. class Window_Message < Window_Base
  1315.   def update_winoff
  1316.     unless $game_party.in_battle #バトル中は無効。
  1317.       if Input.trigger?(Input::L)
  1318.         if self.visible == true
  1319.           self.visible = false
  1320.           @background = 777 if @back_sprite != nil and @background == 1 #「背景を暗くする」
  1321.           @tail.visible = false if @tail != nil
  1322.         else
  1323.           self.visible = true
  1324.           @background = 1 if @back_sprite != nil and @background == 777 #「背景を暗くする」
  1325.         end
  1326.         if @name_window != nil
  1327.           if @name_window.visible == false and $name != nil and $name != ""
  1328.             @name_window.visible = true
  1329.             @name_sprite.visible = true
  1330.           else
  1331.             @name_window.visible = false
  1332.             @name_sprite.visible = false
  1333.           end
  1334.         end
  1335.       elsif Input.trigger?(Input::C) or Input.trigger?(Input::B)
  1336.         if self.visible == false
  1337.           self.visible = true
  1338.           @back_sprite.visible = true unless @back_sprite
  1339.         end
  1340.         @tail.visible = true if @tail != nil and @tail.visible == false
  1341.         if @name_window != nil and $name != nil
  1342.           if $name != ""
  1343.             @name_window.visible = true
  1344.             @name_sprite.visible = true
  1345.           end
  1346.         end
  1347.       end
  1348.     end
  1349.     update_winoff_default
  1350.   end
  1351.   alias :update_winoff_default :update
  1352.   alias :update :update_winoff
  1353. end
  1354.  
  1355.  
  1356. #■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□
  1357. #■ウィンドウ表示位置指定ルーチン
  1358. #■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□
  1359. #===========================================================================
  1360. #イベントコマンド「スクリプト」を使い、
  1361. #$win_x=100 
  1362. #$win_y=100
  1363. #と入力すれば、ウィンドウを(100、100)の位置に表示します。
  1364. #使わない時は
  1365. #$win_x=nil
  1366. #などとnilを入力しておいてください。
  1367. #===========================================================================
  1368. class Window_Message < Window_Base
  1369.   #--------------------------------------------------------------------------
  1370.   # ● ウィンドウの背景と位置の設定 [再定義]
  1371.   #--------------------------------------------------------------------------
  1372.   def update_placement_position
  1373.     update_placement_position_default
  1374.     if $win_x != nil
  1375.       if $win_x > 0
  1376.         self.x = $win_x
  1377.         self.width -= $win_x
  1378.       else
  1379.         self.x = 0
  1380.         self.width += $win_x
  1381.       end
  1382.     end
  1383.     if $win_y != nil
  1384.       self.y = $win_y
  1385.     end
  1386.     #上表示の時、ネームウィンドウが見切れるので少し下にずらす。
  1387.     if self.y == 0 and @position == 0 and @name_window != nil and $name != nil
  1388.       self.y += (-NAME_WINDOW_OFFSET_Y)
  1389.     end
  1390.   end
  1391.   alias_method :update_placement_position_default, :update_placement
  1392.   alias_method :update_placement, :update_placement_position
  1393. end
  1394.  
  1395.  
  1396. #==============================================================================
  1397. # ■ SceneManager
  1398. #------------------------------------------------------------------------------
  1399. #  シーン遷移のさい、テールを破棄。ネームウィンドウのデータをクリア。
  1400. #==============================================================================
  1401. module SceneManager
  1402.   #--------------------------------------------------------------------------
  1403.   # ● 呼び出し
  1404.   #--------------------------------------------------------------------------
  1405.   def self.call_sceman_hukidasi(scene_class)
  1406.     if defined?(self.scene.message_window)
  1407.       self.scene.message_window.del_tail if self.scene.message_window.tail != nil
  1408.       $name = ""
  1409.     end
  1410.     @stack.push(@scene)
  1411.     @scene = scene_class.new
  1412.   end
  1413.   #--------------------------------------------------------------------------
  1414.   # ● クラスメソッドのエイリアス
  1415.   #--------------------------------------------------------------------------
  1416.   class << self
  1417.     alias :call_sceman_hukidasi_default :call
  1418.     alias :call :call_sceman_hukidasi
  1419.   end
  1420. end
  1421.  
  1422. #==============================================================================
  1423. # ■ Scene_Map
  1424. #------------------------------------------------------------------------------
  1425. #  戦闘トランジションのさい、テールを破棄。
  1426. #==============================================================================
  1427. class Scene_Map < Scene_Base
  1428.   attr_accessor :message_window
  1429.   #--------------------------------------------------------------------------
  1430.   # ● 戦闘前トランジション実行
  1431.   #--------------------------------------------------------------------------
  1432.   def perform_battle_transition_hukidasi
  1433.     @message_window.del_tail #テールの破棄
  1434.     perform_battle_transition_hukidasi_default
  1435.   end
  1436.   alias_method :perform_battle_transition_hukidasi_default, :perform_battle_transition
  1437.   alias_method :perform_battle_transition, :perform_battle_transition_hukidasi
  1438. end
  1439.  
  1440.  
  1441. #=end





图像 1.png (33.98 KB, 下载次数: 15)

图像 1.png

Lv1.梦旅人

梦石
0
星屑
50
在线时间
261 小时
注册时间
2011-1-19
帖子
76
2
 楼主| 发表于 2017-2-6 09:42:35 | 只看该作者
解决了,是我自己犯二了、囧、
只要在\name[]\h[]后面写就不会有空白了、

图像 1.png (2.55 KB, 下载次数: 16)

图像 1.png

图像 2.png (42.63 KB, 下载次数: 14)

图像 2.png
回复 支持 反对

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-26 18:17

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表