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

Project1

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

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

[复制链接]

Lv1.梦旅人

梦石
0
星屑
60
在线时间
12 小时
注册时间
2017-1-20
帖子
7
跳转到指定楼层
1
发表于 2017-7-2 13:02:43 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

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

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

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

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

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

QQ图片20170702125221.png (7.98 KB, 下载次数: 23)

QQ图片20170702125221.png

QQ图片20170702125434.png (4.21 KB, 下载次数: 17)

QQ图片20170702125434.png

Lv6.析梦学徒

老鹰

梦石
40
星屑
35612
在线时间
6821 小时
注册时间
2012-5-26
帖子
3277

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

2
发表于 2017-7-2 13:41:33 | 只看该作者
这603行明显被篡改了,而且还是改的面目全非

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

评分

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

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

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

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

谢谢指点!!我去找找!{:2_270:}
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-7-23 07:53

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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