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

Project1

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

[已经解决] 气泡对话框

[复制链接]

Lv1.梦旅人

梦石
0
星屑
39
在线时间
115 小时
注册时间
2012-1-23
帖子
103
跳转到指定楼层
1
发表于 2012-6-16 21:32:45 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
  1. #===============================================================
  2. #
  3. #    呼出对话框 ver. 1.31 By パラ犬(日)
  4. #  来自 http://rpg.para.s3p.net/
  5. #
  6. #  汉化修改 66RPG bbschat(2006.1.5)
  7. #    来自
  8. #
  9. #    脚本更新:by KKME◎66RPG.com,2007年2月
  10. #    by 沉影不器
  11. #    modified by 熊的选民 chosen of bear
  12. #
  13. #===============================================================

  14. module FUKI

  15.   # 是否显示尾部图标
  16.   TAIL_SHOW = true

  17.   # Skin的设定
  18.   # 使用数据库默认窗口Skin情况下这里使用[""]
  19.   SAY_SKIN_NAME = "say"   # 呼出对话框用Skin
  20.   THINK_SKIN_NAME = "think"
  21.   VOICE_SKIN_NAME = "voiceover"

  22.   # 字体大小
  23.   MES_FONT_SIZE = GAME_FONT_SIZE    # 呼出对话框

  24.   # 字体颜色
  25.   #(设定为 Color.new(0, 0, 0, 0) 表示使用普通文字色)
  26.   FUKI_COLOR = Color.new(255, 255, 255, 255)  # 呼出对话框

  27.   # 窗口透明度
  28.   # 如修改窗口透明度请同时修改尾部箭头图形内部的透明度
  29.   FUKI_OPACITY = 255    # 呼出对话框
  30.   MES_OPACITY = 255     # 默认信息窗口

  31.   # 窗口表示时是否根据画面大小自动检查窗口出现的位置,
  32.   # 自动改变位置( true / false )
  33.   # 设置成 true 在某些变态情况下可能出现箭头图标颠倒的问题 <- bbschat <= KKME
  34.   POS_FIX = true

  35.   # 在画面最边缘表示时的稍微挪动
  36.   # 使用圆形Skin的角和方框的角重合的情况下为 true
  37.   CORNER_SHIFT = false
  38.   SHIFT_PIXEL = 4   # true 时挪动的象素

  39.   # 呼出对话框的相对位置(纵坐标)
  40.   POP_SHIFT_TOP = 0         # 表示位置为上的时候
  41.   POP_SHIFT_UNDER = 0       # 表示位置为下的时候

  42.   # 信息的表示速度(数字越小速度越快,0为瞬间表示)
  43.   # 游戏中 可随时用数字代入 $mes_speed 来改变消息表示速度。
  44.   MES_SPEED = 0
  45.   # 默认的文字自动消失时间为45帧
  46.   DEFAULT_AUTO_CLOSE_TIME = 45

  47.   FRAME_WIDTH = 5
  48.   HEAD_WIDTH = 100
  49.   FADE_IN_STEP = 48
  50.   FADE_OUT_STEP = 48
  51. end


  52. #===============================================================
  53. # 初始化两个变量,不要动(by KKME◎66RPG.com)
  54. #===============================================================
  55. $mes_center = -1


  56. #===============================================================
  57. # □ Game_Temp
  58. #===============================================================

  59. class Game_Temp
  60.   attr_accessor  :namebmp              #保存头像图片的Hash表
  61.   alias initialize_fuki initialize
  62.   def initialize
  63.     initialize_fuki
  64.     # 如果不想使用角色名字直接作为头像文件名
  65.     # 可在这里重新设定角色名字与文件名的对应关系
  66.     @namebmp = {}
  67.   end
  68. end

  69. #===============================================================
  70. # □ Window_Message
  71. #===============================================================

  72. class Window_Message < Window_Selectable
  73.   MARGIN_WIDTH = 0

  74.   #-----------------------------------------------------------
  75.   # ● 初始化状态
  76.   #-----------------------------------------------------------
  77.   def initialize
  78.     super(MARGIN_WIDTH, 304, 640 - MARGIN_WIDTH * 2, 160)
  79.     self.contents = Bitmap.new(width - 32, height - 32)
  80.     self.visible = false
  81.     self.z = 9998
  82.     @fade_in = false
  83.     @fade_out = false
  84.     @contents_showing = false
  85.     @cursor_width = 0
  86.     @kkme_name = ""
  87.     @head_name = nil
  88.     self.active = false
  89.     self.index = -1
  90.     @wait = 0
  91.     @dx = 0
  92.     @dy = 0
  93.     @auto_close=-1
  94.     $mes_speed = FUKI::MES_SPEED
  95.     @think = false
  96.     skin = FUKI::SAY_SKIN_NAME != "" ? FUKI::SAY_SKIN_NAME : FUKI::VOICE_SKIN_NAME
  97.     self.windowskin = RPG::Cache.windowskin(skin)
  98.   end

  99.   #-----------------------------------------------------------
  100.   # ○ 决定窗口尺寸并生成窗口
  101.   #-----------------------------------------------------------
  102.   def refresh_create
  103.     @wait = $mes_speed
  104.     @kkme_name = nil
  105.     @head_name = nil
  106.     @think = true
  107.     begin
  108.       temp = $game_temp.message_text.split("*")
  109.       if temp[1] != nil
  110.         @kkme_name = temp[0]
  111.         
  112.         @kkme_name.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  113.           $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  114.         end
  115.         
  116.         @head_name = @kkme_name.clone
  117.         @head_name.sub!(/([0-9])/,"")
  118.   
  119.         @kkme_name = @kkme_name.split("-")[0] if @kkme_name.size > 0
  120.         
  121.         if @kkme_name == ""
  122.           @head_name = $game_party.actors[0].name + @head_name
  123.           #@head_name = "华音" + @head_name
  124.         elsif @kkme_name.to_i != 0
  125.           @head_name = $game_party.actors[@kkme_name.to_i].name + @head_name
  126.         end
  127.         
  128.         if @head_name == "无"
  129.           @head_name = nil
  130.         end
  131.         
  132.         #@head_name = "我" if @head_name == "我"
  133.         
  134.         if temp[2] != nil
  135.           $game_temp.message_text = temp[2][1, temp[2].size]
  136.         else
  137.           @think = false
  138.           $game_temp.message_text = temp[1][1, temp[1].size]
  139.         end         

  140.         #$game_temp.message_text = $game_temp.message_text[@kkme_name.size + 2, $game_temp.message_text.size]
  141.       end
  142.     rescue
  143.     end
  144.       
  145.     self.contents.clear
  146.     self.contents.font.color = normal_color
  147.     self.contents.font.size = FUKI::MES_FONT_SIZE
  148.       
  149.     update_character
  150.    
  151.     #cob
  152.     if @character == nil
  153.       if $game_switches[31]
  154.         skin = $game_system.windowskin_name
  155.       else
  156.         skin = FUKI::VOICE_SKIN_NAME
  157.       end
  158.       #self.back_opacity = 180
  159.     elsif @think
  160.       skin = FUKI::THINK_SKIN_NAME != "" ? FUKI::THINK_SKIN_NAME : FUKI::VOICE_SKIN_NAME
  161.       #$game_temp.message_text = "(" + $game_temp.message_text + ")" unless $game_system.message_position == 1
  162.     else
  163.       skin = FUKI::SAY_SKIN_NAME != "" ? FUKI::SAY_SKIN_NAME : FUKI::VOICE_SKIN_NAME
  164.     end
  165.    
  166.     self.windowskin = RPG::Cache.windowskin(skin)
  167.    
  168.    
  169.     if @character != nil        
  170.       # 生成呼出窗口
  171.       set_fukidasi
  172.       # 生成角色名字窗口
  173.       set_namewindow if @head_name != nil
  174.     else
  175.       reset_window
  176.     end
  177.    
  178.     if $game_system.menu_disabled
  179.       self.pause = false
  180.       @auto_close = 20 + $game_temp.message_text.size * 2
  181.       @auto_close = 80 if @auto_close < 80        
  182.     end

  183.     # 初始化信息表示使用的变量
  184.     @dx = @dy = 0
  185.     @cursor_width = 0
  186.     @contents_drawing = true
  187.     # 瞬间表示的情况下
  188.     if $mes_speed == 0
  189.       # 循环信息描绘处理
  190.       while $game_temp.message_text != ""
  191.         draw_massage
  192.       end
  193.       draw_opt_text
  194.       @contents_showing_end = true
  195.       @contents_drawing = false
  196.     else
  197.       # 一个一个描绘文字
  198.       refresh_drawtext
  199.     end
  200.   end

  201.   #-----------------------------------------------------------
  202.   # ○ 一个一个描绘文字
  203.   #-----------------------------------------------------------
  204.   def refresh_drawtext
  205.     if $game_temp.message_text != nil
  206.       if @wait > 0
  207.         @wait -= 1
  208.         draw_massage
  209.         @wait = $mes_speed if @wait == 0
  210.       end
  211.     end
  212.     # 描绘结束
  213.     if $game_temp.message_text == ""
  214.       draw_opt_text
  215.       @contents_showing_end = true
  216.       @contents_drawing = false
  217.     end
  218.   end

  219.   #-----------------------------------------------------------
  220.   # ○ 取得窗口尺寸
  221.   #-----------------------------------------------------------
  222.   def update_window_size
  223.     x = y = 0
  224.     h = w = 0
  225.     @cursor_width = 0
  226.     # 有选择项的话,处理字的缩进
  227.     if $game_temp.choice_start == 0
  228.       x = 16
  229.     end
  230.     # 有等待显示的文字的情况下
  231.     if $game_temp.message_text != nil
  232.       text = $game_temp.message_text.clone

  233.       # 限制文字处理
  234.       begin
  235.         last_text = text.clone
  236.         text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
  237.       end until text == last_text
  238.       text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  239.         $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  240.       end
  241.       # 为了方便、将 "\\\\" 变换为 "\000"
  242.       text.gsub!(/\\\\/) { "\000" }
  243.       # "\\C" 变为 "\001" 、"\\G" 变为 "\002"
  244.       text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001" }
  245.       text.gsub!(/\\[Gg]/) { "\002" }
  246.       text.gsub!(/\\[Oo]\[([0-9]+)\]/) { "\003[#{$1}]" }
  247.       text.slice!(/\\[Aa]\[(\w+)\]/) { "" }
  248.       # c 获取 1 个字 (如果不能取得文字就循环)
  249.       while ((c = text.slice!(/./m)) != nil)
  250.         # \\ 的情况下
  251.         if c == "\000"
  252.           # 还原为本来的文字
  253.           c = "\\"
  254.         end
  255.         # \C[n] 或者 \G 的情况下
  256.         if c == "\001" or c == "\002"
  257.           # 下面的文字
  258.           next
  259.         end
  260.         # 另起一行文字的情况下
  261.         if c == "\n"
  262.           # y 累加 1
  263.           y += 1
  264.           # 取得纵横尺寸
  265.           h = y
  266.           w = x > w ? x : w
  267.           if y >= $game_temp.choice_start
  268.             w = x + 8 > w ? x + 8 : w
  269.           end
  270.           x = 0
  271.           # 移动到选择项的下一行
  272.           if y >= $game_temp.choice_start
  273.             x = 8
  274.           end
  275.           # 下面的文字
  276.           next
  277.         end
  278.         # x 为要描绘文字的宽度加法运算
  279.         x += self.contents.text_size(c).width
  280.       end
  281.     end
  282.     # 输入数值的情况
  283.     if $game_temp.num_input_variable_id > 0
  284.       digits_max = $game_temp.num_input_digits_max
  285.       h += 1
  286.       x = digits_max * self.contents.font.size + 16
  287.       w = x > w ? x : w
  288.     end

  289.     w += 40
  290.     h = h * (self.contents.font.size + 10) + 26

  291.     #cob
  292.     if @head_name != nil
  293.       w += FUKI::HEAD_WIDTH + 8
  294.       min_h = FUKI::HEAD_WIDTH + 8 + FUKI::FRAME_WIDTH * 2
  295.       h = min_h if h < min_h
  296.     end
  297.    
  298.     #cob
  299.     if $game_system.message_frame == 1
  300.       h += 16
  301.     end

  302.     self.width = w
  303.     self.height = h
  304.   end

  305.   #-----------------------------------------------------------
  306.   # ○ 描绘信息处理
  307.   #-----------------------------------------------------------
  308.   def draw_massage
  309.     # 有等待显示的文字的情况下
  310.     if $game_temp.message_text != nil
  311.       text = $game_temp.message_text

  312.       #cob
  313.       if @head_name != nil
  314.         start_x = FUKI::HEAD_WIDTH + 8
  315.       elsif @tail != nil
  316.         start_x = 4
  317.       else
  318.         #start_x = 4
  319.         start_x = @text_x + 4 - MARGIN_WIDTH
  320.       end

  321.       # 限制文字处理
  322.       begin
  323.         last_text = text.clone
  324.         text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
  325.       end until text == last_text
  326.       text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  327.         $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  328.       end
  329.       # 为了方便、将 "\\\\" 变换为 "\000"
  330.       text.gsub!(/\\\\/) { "\000" }
  331.       # "\\C" 变为 "\001"、"\\G" 变为 "\002"
  332.       text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
  333.       text.gsub!(/\\[Gg]/) { "\002" }
  334.       text.gsub!(/\\[Oo]\[([0-9]+)\]/) { "\003[#{$1}]" }
  335.       if text.slice!(/\\[Aa]\[(\w+)\]/)!=nil
  336.         @auto_close=$1.to_i*10
  337.       elsif false
  338.         if text.slice!(/\\[Aa]/)!=nil
  339.           @auto_close = FUKI::DEFAULT_AUTO_CLOSE_TIME
  340.         end
  341.       end
  342.       # c 获取 1 个字
  343.       if $mes_speed == 0 or @wait == 0
  344.         c = text.slice!(/./m)
  345.       else
  346.         c = text[/./m]
  347.       end        
  348.       if c
  349.         # 选择项的情况
  350.         if @dy >= $game_temp.choice_start
  351.           # 处理字的缩进
  352.           @dx = 8
  353.           # 描绘文字
  354.           self.contents.draw_text(start_x + @dx, 32 * @dy, 40, 32, c)
  355.           # x 为要描绘文字宽度的加法运算
  356.           @dx += self.contents.text_size(c).width
  357.           # 循环
  358.           while ((c = text.slice!(/./m)) != "\n")
  359.             # 描绘文字
  360.             self.contents.draw_text(start_x + @dx, 32 * @dy, 40, 32, c)
  361.             # x 为要描绘文字宽度的加法运算
  362.             @dx += self.contents.text_size(c).width
  363.           end
  364.           if c == "\n"
  365.             # 更新光标宽度
  366.             @cursor_width = [@cursor_width, @dx].max
  367.             # dy 累加 1
  368.             @dy += 1
  369.             @dx = 0
  370.           end
  371.           return
  372.         end
  373.         # \\ 的情况下
  374.         if c == "\000"
  375.           # 还原为本来的文字
  376.           c = "\\"
  377.         end

  378.         #\C[n] 的情况下
  379.         if c == "\001"
  380.           # 更改文字色
  381.           text.sub!(/\[([0-9]+)\]/, "")
  382.           color = $1.to_i
  383.           if color >= 0 and color <= 7
  384.             self.contents.font.color = text_color(color)
  385.           end
  386.           return
  387.         end

  388.         # \G 的情况下
  389.         if c == "\002"
  390.           # 生成金钱窗口
  391.           if @gold_window == nil
  392.             @gold_window = Window_Gold.new
  393.             @gold_window.x = 560 - @gold_window.width
  394.             if $game_temp.in_battle
  395.               @gold_window.y = 192
  396.             else
  397.               @gold_window.y = self.y >= 128 ? 32 : 384
  398.             end
  399.             @gold_window.opacity = self.opacity
  400.             @gold_window.back_opacity = self.back_opacity
  401.           end
  402.           return
  403.         end

  404.         if c == "\003"
  405.           text.sub!(/\[([0-9]+)\]/, "")
  406.           self.contents.font.color.alpha = [[0, $1.to_i].max, 255].min
  407.           return
  408.         end

  409.         # 另起一行文字的情况下
  410.         if c == "\n"
  411.           if $mes_speed == 0 or @wait == 0
  412.             #dy 累加 1
  413.             @dy += 1
  414.             @dx = 0
  415.           end
  416.           return
  417.         end
  418.         
  419.         if $mes_speed == 0 or @wait == 0
  420.           self.contents.font.color.alpha = 255
  421.         else
  422.           #self.contents.font.color.alpha = 255 * ($mes_speed - @wait) / $mes_speed
  423.           self.contents.font.color.alpha = 255 / $mes_speed
  424.         end         

  425.         # 描绘文字
  426.         self.contents.font.size = FUKI::MES_FONT_SIZE
  427.         font_size = self.contents.font.size
  428.         self.contents.draw_text(start_x+@dx, (font_size+10)*@dy, font_size, font_size, c)
  429.         # dx 为要描绘文字的宽度加法运算
  430.         @dx += self.contents.text_size(c).width if $mes_speed == 0 or @wait == 0
  431.       end
  432.     end
  433.   end

  434.   #-----------------------------------------------------------
  435.   # ○ 选择项和输入数值的情况下
  436.   #-----------------------------------------------------------
  437.   def draw_opt_text
  438.     # 选择项的情况下
  439.     if $game_temp.choice_max > 0
  440.       @item_max = $game_temp.choice_max
  441.       self.active = true
  442.       self.index = 0
  443.     end
  444.     # 输入数值的情况下
  445.     if $game_temp.num_input_variable_id > 0
  446.       digits_max = $game_temp.num_input_digits_max
  447.       number = $game_variables[$game_temp.num_input_variable_id]
  448.       @input_number_window = Window_InputNumber.new(digits_max)
  449.       @input_number_window.number = number
  450.       @input_number_window.x = self.x + 8
  451.       @input_number_window.y = self.y + $game_temp.num_input_start * 32
  452.     end
  453.   end

  454.   #-----------------------------------------------------------
  455.   # ○ 设置呼出对话框
  456.   #-----------------------------------------------------------
  457.   def set_fukidasi


  458.       # 不显示暂停标志
  459.       self.pause = false

  460.       update_window_size
  461.       update_window_pos
  462.       
  463.       self.opacity = 0

  464.       self.contents.dispose
  465.       self.contents = Bitmap.new(width - 32, height - 32)
  466.       self.back_opacity = FUKI::FUKI_OPACITY
  467.       self.contents.clear
  468.       self.contents.font.color = normal_color
  469.       self.contents.font.size = FUKI::MES_FONT_SIZE
  470.       
  471.       # 描绘尾部图标
  472.       if $game_system.message_frame == 0 and FUKI::TAIL_SHOW == true and
  473.           @message_position != 1
  474.         @tail = Sprite.new        
  475.         @tail.z = self.z + 1
  476.         @tail.opacity = 0
  477.         update_tail_pos
  478.         
  479.     #cob
  480.     if @think
  481.       skin = FUKI::THINK_SKIN_NAME != "" ? FUKI::THINK_SKIN_NAME : FUKI::VOICE_SKIN_NAME
  482.     else
  483.       skin = FUKI::SAY_SKIN_NAME != "" ? FUKI::SAY_SKIN_NAME : FUKI::VOICE_SKIN_NAME
  484.     end        
  485.         
  486.         case @message_position
  487.         when 0  # 上
  488.           if(@tail.x < self.x + self.width / 2)
  489.             @tail.bitmap = RPG::Cache.windowskin(skin + "-upper_right")
  490.           else
  491.             @tail.bitmap = RPG::Cache.windowskin(skin + "-upper_left")
  492.           end
  493.         when 2  # 下
  494.           if(@tail.x + 40 > self.x + self.width / 2)
  495.             @tail.bitmap = RPG::Cache.windowskin(skin + "-lower_left")
  496.           else
  497.             @tail.bitmap = RPG::Cache.windowskin(skin + "-lower_right")
  498.           end
  499.         end
  500.       end
  501.   end
  502.   #-----------------------------------------------------------
  503.   # ○ 新功能:根据输入文章计算呼出对话框的位置
  504.   #-----------------------------------------------------------
  505.   def update_character
  506.     @character = get_character_by_name
  507.   end
  508.   
  509.   BATTLER_NAME = {
  510.     ""=>"",
  511.   }
  512.    
  513.   def get_character_by_name
  514.     return nil if @kkme_name == nil
  515.    
  516.     if $game_temp.in_battle
  517.       return $game_party.actors[0] if @kkme_name == ""
  518.       return $game_party.actors[@kkme_name.to_i] if @kkme_name.to_i != 0
  519.       
  520.       name = BATTLER_NAME[@kkme_name]
  521.       name = @kkme_name unless name
  522.       for enemy in $game_troop.enemies
  523.         return enemy if enemy.name == name
  524.       end
  525.       
  526.       return nil
  527.     end
  528.    
  529.     if @kkme_name == ""
  530.       return $game_player unless $game_player.transparent
  531.       @kkme_name = "我"
  532.     else  
  533.       return $game_party.characters[@kkme_name.to_i - 1] if @kkme_name.to_i != 0
  534.     end

  535.     #@kkme_name = "我" if @kkme_name == "我"
  536.     for event in $game_map.events.values
  537.       return event if event.name == @kkme_name and event.character_name != ""
  538.     end
  539.       
  540.     for actor in $game_party.actors
  541.       return $game_player if actor.name == @kkme_name
  542.     end
  543.       
  544.     return nil
  545.   end
  546.   
  547.   def tail_offset_x
  548.     return 18 if @think
  549.     return 16
  550.   end
  551.   
  552.   def tail_offset_y
  553.     return 18 if @think
  554.     return 2
  555.   end

  556.   #-----------------------------------------------------------
  557.   # ○ 计算呼出对话框的位置
  558.   #-----------------------------------------------------------
  559.   def update_window_pos
  560.     # 记录文章显示位置
  561.     @message_position = $game_system.message_position
  562.     if @message_position == 1
  563.       self.x = (640 - self.width) / 2
  564.       self.y = (480 - self.height) / 2
  565.       return
  566.     end
  567.    
  568.     update_character

  569.     if @character == nil
  570.       # 角色不存在的情况下使用默认信息框
  571.       del_fukidasi
  572.       reset_window
  573.       return
  574.     end
  575.    
  576.     if $game_temp.in_battle
  577.       @message_position = 0
  578.     elsif $mes_center != nil
  579.       center_char = get_character($mes_center)
  580.       if center_char != nil
  581.         if @character.real_y > center_char.real_y
  582.           @message_position = 2
  583.         else
  584.           @message_position = 0
  585.         end
  586.       end
  587.     end

  588.     case @message_position
  589.     when 0  # 上
  590.       y = @character.screen_y - self.height - @character.sprite_height + FUKI::POP_SHIFT_TOP
  591.       y -= tail_offset_y
  592.       if FUKI::POS_FIX and y < 4
  593.         if $game_temp.in_battle
  594.           y = 4         
  595.         else         
  596.           @message_position = 2
  597.           y = @character.screen_y + FUKI::POP_SHIFT_UNDER
  598.           y += tail_offset_y
  599.         end
  600.       end
  601.     when 2  # 下
  602.       y = @character.screen_y + FUKI::POP_SHIFT_UNDER
  603.       y += tail_offset_y
  604.       if FUKI::POS_FIX and y + self.height > 480 - 4
  605.         @message_position = 0
  606.         y = @character.screen_y - self.height - @character.sprite_height + FUKI::POP_SHIFT_TOP
  607.         y -= tail_offset_y
  608.       end
  609.     end

  610.     x = @character.screen_x - self.width / 2
  611.     case @message_position
  612.     when 0  # 上
  613.       x += tail_offset_x
  614.     when 2  # 下
  615.       x -= tail_offset_x
  616.     end

  617.     if x + self.width > 640 - 4
  618.       x = 640 - 4 - self.width
  619.     elsif x < 4
  620.       x = 4
  621.     end
  622.    
  623.     if y + self.height > 480 - 4
  624.       y = 480 - 4 - self.height
  625.     elsif y < 4
  626.       y = 4
  627.     end

  628.     self.x = x
  629.     self.y = y
  630.   end

  631.   #-----------------------------------------------------------
  632.   # ○ 计算尾部图标的位置
  633.   #-----------------------------------------------------------
  634.   def update_tail_pos
  635.     x = @character.screen_x - tail_offset_x
  636.    
  637.     case @message_position
  638.     when 0  # 上
  639.       # 画面边缘的话则移动位置
  640.       if FUKI::CORNER_SHIFT
  641.         if x == 0
  642.           x = FUKI::SHIFT_PIXEL
  643.         elsif x == 640 - 32
  644.           x = 640 - 32 - FUKI::SHIFT_PIXEL
  645.         end
  646.       end
  647.       y = self.y + self.height - 16
  648.       y += 16 if @think
  649.     when 2  # 下
  650.       # 画面边缘的话则移动位置
  651.       if FUKI::CORNER_SHIFT
  652.         if x == 0
  653.           x = FUKI::SHIFT_PIXEL
  654.         elsif @tail.x == 640 - 32
  655.           x = 640 - 32 - FUKI::SHIFT_PIXEL
  656.         end
  657.       end
  658.       y = self.y - 16
  659.       y -= 16 if @think
  660.     end   
  661.    
  662.     @tail.x = x
  663.     @tail.y = y
  664.   end

  665.   #-----------------------------------------------------------
  666.   # ○ 计算名字窗口的位置
  667.   #-----------------------------------------------------------
  668.   def update_name_pos
  669.     @head.x = self.x + FUKI::FRAME_WIDTH + 4
  670.     @head.y = self.y + (self.height - FUKI::HEAD_WIDTH)/2
  671.   end

  672.   #-----------------------------------------------------------
  673.   # ○ 设置角色名字窗口
  674.   #-----------------------------------------------------------
  675.   def set_namewindow
  676.     @head = Sprite.new
  677.    
  678.     #判断名称是否有对应的图片"Graphics/heads/" +
  679.     if $game_temp.namebmp[@head_name] == nil then
  680.       @head.bitmap = RPG::Cache.icon(@head_name)
  681.     else
  682.       @head.bitmap = RPG::Cache.icon($game_temp.namebmp[@head_name])
  683.     end
  684.     @head.z = self.z + 1
  685.     @head.opacity = 0
  686.     update_name_pos
  687.   end

  688.   #-----------------------------------------------------------
  689.   # ○ 释放呼出对话框和角色名字窗口
  690.   #-----------------------------------------------------------
  691.   def del_fukidasi
  692.     if @tail != nil
  693.       @tail.dispose
  694.       @tail = nil
  695.     end
  696.     if @head != nil
  697.       @head.dispose
  698.       @head = nil
  699.     end
  700.     self.opacity = 0
  701.     self.x = MARGIN_WIDTH
  702.     self.width = 640 - MARGIN_WIDTH * 2
  703.     self.height = 160
  704.     self.contents.dispose
  705.     self.contents = Bitmap.new(width - 32, height - 32)
  706.     self.pause = true
  707.   end

  708.   #-----------------------------------------------------------
  709.   # ○ 取得角色
  710.   #     parameter : 参数
  711.   #-----------------------------------------------------------
  712.   def get_character(parameter)
  713.     # 参数分歧
  714.     case parameter
  715.     when -1  # 玩家
  716.       return $game_player
  717.     when 0   # 该事件
  718.       return nil unless $game_system.map_interpreter.running?
  719.       events = $game_map.events
  720.       return events == nil ? nil : events[$game_system.map_interpreter.event_id]
  721.     else     # 特定事件
  722.       if parameter > 0
  723.         events = $game_map.events
  724.         return events == nil ? nil : events[parameter]
  725.       end
  726.       events = $game_party.characters
  727.       return events == nil ? nil : events[-parameter - 2]
  728.     end
  729.   end

  730.   #-----------------------------------------------------------
  731.   # ● 设定窗口位置和不透明度
  732.   #-----------------------------------------------------------
  733.   def reset_window
  734.     update_window_size
  735.     @text_x = 320 - width / 2
  736.     self.width = 640 - MARGIN_WIDTH * 2
  737.     self.contents.dispose   
  738.     self.contents = Bitmap.new(width - 32, height - 32)
  739.     self.x = 320 - width / 2
  740.    
  741.     if false and $game_temp.in_battle
  742.       self.y = 16
  743.     else
  744.       case $game_system.message_position
  745.       when 0  # 上
  746.         self.y = 16
  747.       when 1  # 中
  748.         self.y = 240 - self.height / 2 #160
  749.       when 2  # 下
  750.         #self.y = 304
  751.         self.y = 480 - 16 - height
  752.       end
  753.     end
  754.     if $game_system.message_frame == 0
  755.       self.opacity = 255
  756.     else
  757.       self.opacity = 0
  758.     end
  759.     self.back_opacity = FUKI::MES_OPACITY
  760.     @think = false
  761.    
  762.   end

  763.   #-----------------------------------------------------------
  764.   # ● 刷新画面
  765.   #-----------------------------------------------------------
  766.   def update
  767.     super
  768.    
  769.     # 呼出模式下跟随事件移动
  770.     if @tail != nil
  771.       update_window_pos
  772.       update_name_pos if @head != nil
  773.       update_tail_pos
  774.     end

  775.     # 渐变的情况下
  776.     if @fade_in   
  777.       self.opacity += FUKI::FADE_IN_STEP if $game_system.message_frame == 0
  778.       self.contents_opacity += FUKI::FADE_IN_STEP
  779.       @head.opacity += FUKI::FADE_IN_STEP if @head != nil
  780.       @tail.opacity += FUKI::FADE_IN_STEP if @tail != nil
  781.       @input_number_window.contents_opacity += FUKI::FADE_IN_STEP if @input_number_window != nil
  782.       @fade_in = false if self.contents_opacity == 255
  783.       return
  784.     end

  785.     # 显示信息中的情况下
  786.     if @contents_drawing
  787.       refresh_drawtext
  788.       return
  789.     end

  790.     # 输入数值的情况下
  791.     if @input_number_window != nil
  792.       @input_number_window.update
  793.       # 确定
  794.       if Input.trigger?(Input::C)
  795.         $game_system.se_play($data_system.decision_se)
  796.         $game_variables[$game_temp.num_input_variable_id] =
  797.           @input_number_window.number
  798.         $game_map.need_refresh = true
  799.         # 释放输入数值窗口
  800.         @input_number_window.dispose
  801.         @input_number_window = nil
  802.         terminate_message
  803.       end
  804.       return
  805.     end

  806.     # 显示信息结束的情况下
  807.     if @contents_showing_end
  808.       if $game_system.menu_disabled
  809.         self.pause = false
  810.       # 不是显示选择项且不是呼出对话模式则显示暂停标志
  811.       elsif $game_temp.choice_max == 0 and @tail == nil
  812.         self.pause = true
  813.       else
  814.         self.pause = false
  815.       end
  816.       
  817.       #cob
  818.       if false and $game_temp.choice_max == 0 and @auto_close == -1
  819.         if Input.press?(Input::B) or
  820.             Input.press?(Input::UP) or
  821.             Input.press?(Input::DOWN) or
  822.             Input.press?(Input::LEFT) or
  823.             Input.press?(Input::RIGHT)
  824.           terminate_message
  825.           del_fukidasi
  826.           $game_temp.terminate_message = true
  827.         end
  828.       end
  829.       
  830.       # 取消
  831.       if Input.trigger?(Input::B)
  832.         if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0
  833.           #$game_system.se_play($data_system.cancel_se)
  834.           $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)
  835.           terminate_message
  836.         end
  837.       end
  838.       # 自动关闭
  839.       @auto_close > 0 ? @auto_close-=1 : @auto_close=-1
  840.       if @auto_close==0
  841.         # 文字还没有处理完的时候
  842.         # 选择项
  843.         if $game_temp.choice_max > 0
  844.           #$game_system.se_play($data_system.decision_se)
  845.           $game_temp.choice_proc.call(self.index)
  846.         end
  847.         terminate_message
  848.         del_fukidasi
  849.       end
  850.       # 确定
  851.       if Input.trigger?(Input::C) and @auto_close == -1
  852.         if $game_temp.choice_max > 0
  853.           #$game_system.se_play($data_system.decision_se)
  854.           $game_temp.choice_proc.call(self.index)
  855.         end
  856.         terminate_message
  857.         # 释放呼出窗口
  858.         del_fukidasi
  859.       end
  860.       return
  861.     end

  862.     # 在渐变以外的状态下有等待显示的信息与选择项的场合
  863.     if @fade_out == false and $game_temp.message_text != nil
  864.       @contents_showing = true
  865.       $game_temp.message_window_showing = true
  866.       reset_window
  867.       refresh_create
  868.       if @head != nil
  869.         @head.opacity = 0
  870.       end
  871.       if @tail != nil
  872.         @tail.opacity = 0
  873.       end
  874.       Graphics.frame_reset
  875.       self.visible = true
  876.       self.contents_opacity = 0
  877.       if @input_number_window != nil
  878.         @input_number_window.contents_opacity = 0
  879.       end
  880.       @fade_in = true
  881.       return
  882.     end

  883.     # 没有可以显示的信息、但是窗口为可见的情况下
  884.     if self.visible
  885.       @fade_out = true
  886.       
  887.       self.contents_opacity -= FUKI::FADE_OUT_STEP
  888.       @head.opacity -= FUKI::FADE_OUT_STEP if @head != nil
  889.       @tail.opacity -= FUKI::FADE_OUT_STEP if @tail != nil
  890.       @input_number_window.contents_opacity -= FUKI::FADE_OUT_STEP if @input_number_window != nil

  891.       if self.opacity == 0
  892.         self.visible = false
  893.         @fade_out = false
  894.         $game_temp.message_window_showing = false
  895.         del_fukidasi
  896.       end
  897.       return
  898.     end
  899.   end

  900.   #-----------------------------------------------------------
  901.   # ● 释放
  902.   #-----------------------------------------------------------
  903.   def dispose
  904.     terminate_message
  905.     $game_temp.message_window_showing = false
  906.     if @input_number_window != nil
  907.       @input_number_window.dispose
  908.     end
  909.     del_fukidasi   
  910.     super
  911.   end

  912.   #-----------------------------------------------------------
  913.   # ● 信息结束处理
  914.   #-----------------------------------------------------------
  915.   def terminate_message
  916.     @auto_close = -1
  917.     self.active = false
  918.     self.pause = false
  919.     self.index = -1
  920.     self.contents.clear
  921.     # 清除显示中标志
  922.     @contents_showing = false
  923.     @contents_showing_end = false
  924.     unless @kkme_name == "" or @kkme_name == nil
  925.       @kkme_name = ""
  926.     end
  927.     # 呼叫信息调用
  928.     if $game_temp.message_proc != nil
  929.       $game_temp.message_proc.call
  930.     end
  931.     # 清除文章、选择项、输入数值的相关变量
  932.     $game_temp.message_text = nil
  933.     $game_temp.message_proc = nil
  934.     $game_temp.choice_start = 99
  935.     $game_temp.choice_max = 0
  936.     $game_temp.choice_cancel_type = 0
  937.     $game_temp.choice_proc = nil
  938.     $game_temp.num_input_start = 99
  939.     $game_temp.num_input_variable_id = 0
  940.     $game_temp.num_input_digits_max = 0
  941.     # 释放金钱窗口
  942.     if @gold_window != nil
  943.       @gold_window.dispose
  944.       @gold_window = nil
  945.     end
  946.   end

  947.   #-----------------------------------------------------------
  948.   # ● 刷新光标矩形
  949.   #-----------------------------------------------------------
  950.   def update_cursor_rect
  951.     if @index >= 0
  952.       n = $game_temp.choice_start + @index
  953.       self.cursor_rect.set(@text_x, n * 32, [@cursor_width, 60].max, 32)
  954.     else
  955.       self.cursor_rect.empty
  956.     end
  957.   end
  958.   #-----------------------------------------------------------
  959.   # ● 取得普通文字色
  960.   #-----------------------------------------------------------
  961.   def normal_color
  962.     return FUKI::FUKI_COLOR #if FUKI::FUKI_COLOR != nil
  963.   end
  964. end


  965. #===============================================================
  966. # ■ Window_InputNumber
  967. #===============================================================

  968. class Window_InputNumber < Window_Base
  969.   #-----------------------------------------------------------
  970.   # ● 初始化对像
  971.   #     digits_max : 位数
  972.   #-----------------------------------------------------------
  973.   def initialize(digits_max)
  974.     @digits_max = digits_max
  975.     @number = 0
  976.     # 从数字的幅度计算(假定与 0~9 等幅)光标的幅度
  977.     dummy_bitmap = Bitmap.new(32, 32)
  978.     dummy_bitmap.font.size = FUKI::MES_FONT_SIZE
  979.     @cursor_width = dummy_bitmap.text_size("0").width + 8
  980.     dummy_bitmap.dispose
  981.     super(0, 0, @cursor_width * @digits_max + 32, 64)
  982.     self.contents = Bitmap.new(width - 32, height - 32)
  983.     self.contents.font.size = FUKI::MES_FONT_SIZE
  984.     self.z += 9999
  985.     self.opacity = 0
  986.     @index = 0
  987.     refresh
  988.     update_cursor_rect
  989.   end
  990. end

  991. #============================================================
  992. # Game_Map,把events变量公开
  993. #============================================================
  994. class Game_Map
  995.   attr_reader   :events
  996. end

  997. #============================================================
  998. # 便于返回姓名
  999. #============================================================
  1000. class Game_Event < Game_Character
  1001.   def name
  1002.     return @event.name
  1003.   end
  1004.   def name=(na)
  1005.     @event.name = na
  1006.   end
  1007. end


  1008. #cob
  1009. class Game_Character
  1010.   SPRITE_HEIGHTS = {
  1011.     "081-Angel03"=>220,
  1012.     "082-Angel04"=>220,
  1013.     "078-Devil04"=>300,
  1014.   }
  1015.   def sprite_height
  1016.     height = SPRITE_HEIGHTS[@character_name]
  1017.     return height / 4 if height
  1018.     bitmap = RPG::Cache.character(@character_name, @character_hue)
  1019.     return bitmap.height / 4
  1020.   end
  1021. end

  1022. class Game_Battler
  1023.   def sprite_height
  1024.     bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
  1025.     return bitmap.height
  1026.   end
  1027. end
复制代码


求VX版

Lv1.梦旅人

54酱是大笨蛋!

梦石
0
星屑
66
在线时间
1389 小时
注册时间
2011-2-23
帖子
5014
2
发表于 2012-6-17 18:04:00 | 只看该作者
VX的暂时没有...
叫大神帮你做也不现实...
LZ你用其他对话框吧...
去你爹的现充.去你爹的异性恋.
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
39
在线时间
115 小时
注册时间
2012-1-23
帖子
103
3
 楼主| 发表于 2012-6-21 17:25:32 | 只看该作者
晕~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

点评

LZ尽早结帖把=。=  发表于 2012-6-21 21:24
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
37 小时
注册时间
2012-6-15
帖子
26
4
发表于 2012-6-23 14:40:43 | 只看该作者
你找的是不是这个啊?


==============================================================================
# vx呼出对话框 by 沉影不器
#------------------------------------------------------------------------------
# 呼出对话框原作者: パラ犬(日)
#------------------------------------------------------------------------------
# 『素材准备』
#   ① 按vx默认头像素材的格式,但要求每个头像文件所有8格均为同一人的表
#      情并且所有表情朝向一致(默认是正面偏右), 以角色(对话者)名称来命
#      名每个头像文件,用于对话框中自动生成对话者名称.
#   ② vx窗体较xp更精致,头像不宜太大.
#      小头像不宜超过96*96; 半身像不宜超过140*140
#   ③ 呼出对话框箭头图标的命名规则为:
#      制作上下两个对话框箭头图标, 分别命名为:
#      您设定的对话框皮肤名称后加"_arrow_down"(对应下箭头)
#      或"_arrow_up"(对应上箭头), 并存放在system文件夹内.
#
# 『脚本使用』
#   ① 复制脚本插入到Main之前.
#   ② 请务必看完脚本的设定部分,并根据游戏素材的情况设定好各参数
#      脚本第 47-98 行为默认设定部分
#      脚本第 107-113 行为游戏中可更改的设定部分.
#   ③ 地图上跟角色进行对话的事件名称使用与头像素材一致的名称, 即对话
#      者的名称,以便脚本根据名称找到对应事件.
#   ④ 可在游戏中更改参数的说明:
#      ▼ 以第行的fuki_font_name举例
#         对话之前,在事件脚本中输入$game_temp.fuki_font_name = "宋体"
#         将把对话框使用的字体改为"宋体".
#      ▼ 以第行的face_type举例
#         对话之前,在事件脚本中输入$game_temp.face_type = 1
#         将把头像的水平显示位置改为"头像在右".
#      其它可改参数同上.
#
# 『脚本自动完成部分的补充说明』
#   ① 根据头像的文件名自动填写对话者名称,这将占用一行对话框的位置
#   ② 脚本根据事件名称,在屏幕范围内自动查找对话者,如果对话者在范围内
#      不存在,则使用普通对话框,自动调节对话框大小,自动水平居中显示,垂
#      直方向仍由对话事件本身决定.
#   ③ 默认头像素材为正面偏右,当您指定头像显示在右时,脚本将对头像素材
#      镜像处理,您的头像素材中须注意这点
#------------------------------------------------------------------------------
# 最后一句提示: 善用素材,配合默认设定的修改. 感谢您看完烦琐的说明.
#==============================================================================

#==============================================================================
# ■ 默认设定(部分设定允许在游戏中随时更改,见脚本第 107-113 行)
#==============================================================================
module FUKI
  #--------------------------------------------------------------------------
  # ◎ 坐标微调
  #--------------------------------------------------------------------------
  # 对话框
    MSG_Y_ADJ = 8               # 使用呼出对话框时,角色和对话框的纵向间距
  # 头像
    FACE_X_ADJ = 8              # 头像向对话框内横向缩进(避免遮盖对话框外框)
    FACE_Y_ADJ = -2             # 头像向对话框内纵向缩进(避免遮盖对话框外框)
  # 名称背景条
    NAME_BAR_X = 6              # 名称背景条相对于对话框的起始横坐标
  # 呼出对话框箭头
    ARR0W_UP_X_ADJ = 0          # 上箭头的横向调节
    ARR0W_UP_Y_ADJ = 6          # 上箭头的纵向调节
    ARR0W_DOWN_X_ADJ = 0        # 下箭头的横向调节
    ARR0W_DOWN_Y_ADJ = -6       # 下箭头的纵向调节
  #--------------------------------------------------------------------------
  # ◎ 窗体设定
  #--------------------------------------------------------------------------
    SKIN = "window"             # 设定对话框Skin
    OPACITY = 255               # 窗口透明度
  #--------------------------------------------------------------------------
  # ◎ 文字设定
  #    文字颜色说明: 使用Window_Base中text_color(n)的颜色代码
  #--------------------------------------------------------------------------
  # 字体
    FONT_NAME = "黑体"          # 对话框字体
    FONT_SIZE = 14              # 对话框文字字号
    FONT_SHADOW = true          # 对话框文字阴影
  # 文字颜色
    MSG_COLOR = 0               # 对话框文字颜色
    NAME_COLOR = 16             # 角色名称文字颜色
  #--------------------------------------------------------------------------
  # ◎ 头像设定
  #--------------------------------------------------------------------------
  # 头像始终在对话框内(默认使用半身像, 则为 false)
    IN_CONTENT = false
  # 头像垂直对齐方式(0: 顶端对齐; 1: 居中对齐; 2: 底端对齐)
    V_ALIGN = 2
  # 头像水平显示位置(0: 头像在左; 1: 头像在右)
    H_ALIGN = 1
  #--------------------------------------------------------------------------
  # ◎ 自动显示名称设定
  #--------------------------------------------------------------------------
    NAME_Y_ADJ = 6              # 显示名称时,对话者名称与对话内容之间的距离
    NAME_BAR_COLOR = 0         # 名称背景条颜色
    NAME_BAR_OPACITY = 72       # 名称背景条透明度
  #--------------------------------------------------------------------------
  # ◎ 附带功能设定
  #--------------------------------------------------------------------------
  # 超过指定时间,玩家无输入则自动关闭对话框(单位: 帧)
    AUTO_CLOSE_TIME = 60*60     # 默认为1分钟
  # 默认打字速度修正
    SPEED = 2
end

#==============================================================================
# ■ Game_Temp
#==============================================================================
class Game_Temp
  #--------------------------------------------------------------------------
  # ● 定义实例变量
  #--------------------------------------------------------------------------
  attr_accessor :fuki_font_name   # 呼出对话框字体
  attr_accessor :fuki_font_size   # 呼出对话框字号
  attr_accessor :fuki_msg_color   # 呼出对话框文字颜色
  attr_accessor :fuki_name_color  # 角色名称文字颜色
  attr_accessor :face_type        # 头像水平显示位置
  attr_accessor :auto_close       # 对话框自动关闭时间
  attr_accessor :speed            # 对话框打字速度修正
  #--------------------------------------------------------------------------
  # ● 初始化对象
  #--------------------------------------------------------------------------
  alias ini initialize
  def initialize
    ini
    @fuki_font_name = FUKI::FONT_NAME
    @fuki_font_size = FUKI::FONT_SIZE
    @fuki_msg_color = FUKI::MSG_COLOR
    @fuki_name_color = FUKI::NAME_COLOR
    @face_type = FUKI::H_ALIGN
    @auto_close = FUKI::AUTO_CLOSE_TIME
    @speed = FUKI::SPEED
  end
end

#==============================================================================
# ■ Game_Event
#==============================================================================
class Game_Event
  #--------------------------------------------------------------------------
  # ◎ 返回事件名称
  #--------------------------------------------------------------------------
  def name
    return @event.name
  end
end

#==============================================================================
# ■ Window_NumberInput
#==============================================================================
class Window_NumberInput < Window_Base
  #--------------------------------------------------------------------------
  # ◎ 刷新
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.name = $game_temp.fuki_font_name
    self.contents.font.size = $game_temp.fuki_font_size
    self.contents.font.shadow = FUKI::FONT_SHADOW
    self.contents.font.color = normal_color
    s = sprintf("%0*d", @digits_max, @number)
    for i in 0...@digits_max
      self.contents.draw_text\
      (24 + i * 16, 0, 16, FUKI::FONT_SIZE + 2, s[i,1], 1)
    end
  end
  #--------------------------------------------------------------------------
  # ◎ 更新光标
  #--------------------------------------------------------------------------
  def update_cursor
    self.cursor_rect.set(24 + @index * 16, 0, 16, FUKI::FONT_SIZE + 2)
  end
end

#==============================================================================
# ■ Window_Message
#==============================================================================
class Window_Message < Window_Selectable
  #--------------------------------------------------------------------------
  # ◎ 定义实例变量
  #--------------------------------------------------------------------------
  attr_accessor :user_cancel              # 暂时使用默认对话框
  attr_accessor :face_type                # 头像水平显示位置
  #--------------------------------------------------------------------------
  # ◎ 常量
  #--------------------------------------------------------------------------
  MAX_LINE = 5                            # 最大行数
  #--------------------------------------------------------------------------
  # ◎ 初始化对象
  #--------------------------------------------------------------------------
  def initialize
    super(0, 288, 544, 128)
    self.z = 200
    self.active = false
    self.index = -1
    self.openness = 0
    @opening = false                      # 窗口正在打开的标志
    @closing = false                      # 窗口正在关闭的标志
    @text = nil                           # 已经没有可显示的文章
    @contents_x = 0                       # 下一条文字描绘的 X 坐标
    @contents_y = 0                       # 下一条文字描绘的 Y 坐标
    @line_count = 0                       # 现在描绘的行数
    @wait_count = 0                       # 等待计数
    @background = 0                       # 背景类型
    @position = 2                         # 显示位置
    @show_fast = false                    # 快速显示标志
    @line_show_fast = false               # 以行为单位快速显示
    @pause_skip = false                   # 省略等待输入标志
    @update_pos = false                   # 对话框跟随开关关闭
    @show_name  = false                   # 名称显示开关关闭
    @fuki_pause = false                   # 为了方便代替window类的pause
    @user_cancel = false                  # 暂时使用默认对话框的标志
    # 生成对象
    create_gold_window
    create_number_input_window
    create_back_sprite
    create_face_sprite                    # 生成头像
    create_namebar_sprite                 # 生成名称背景条
    create_arrow_sprite                   # 生成对话框箭头
    # 透明度设定
    set_opacity(self)
    set_opacity(@arrow_sprite)
  end
  #--------------------------------------------------------------------------
  # ◎ 释放
  #--------------------------------------------------------------------------
  def dispose
    super
    dispose_gold_window
    dispose_number_input_window
    dispose_back_sprite
    dispose_face_sprite                   # 释放头像
    dispose_arrow_sprite                  # 释放对话框箭头
  end
  #--------------------------------------------------------------------------
  # ◎ 更新画面
  #--------------------------------------------------------------------------
  def update
    super
    update_gold_window
    update_number_input_window
    update_back_sprite
    update_show_fast
    if @update_pos
      reset_msg_pos                         # 重设对话框坐标
      reset_namebar_bitmap                  # 重绘名称背景条
    end
    # 除窗口关闭以外
    unless @opening or @closing
      # 文章内等待中
      if @wait_count > 0
        @wait_count -= 1
      # 等待文章翻页待机中
      elsif @fuki_pause
        input_pause
      # 正在输入选择项
      elsif self.active
        input_choice
      # 正在输入数值
      elsif @number_input_window.visible
        input_number
      # 还有剩余的文章
      elsif @text != nil
        update_message                      # 更新消息
      # 继续的情况
      elsif continue?
        start_message                       # 开始消息
        reset_msg_size                      # 重设对话框尺寸
        reset_contents                      # 重设位图容器
        reset_msg_pos                       # 重设对话框坐标
        reset_namebar_bitmap                # 重绘名称背景条
        $game_message.visible = true
        open                                # 打开窗口
        @face_sprite.visible = true
      # 不继续的情况
      else
        @face_sprite.visible = @closing     # 关闭头像显示
        @arrow_sprite.visible = @closing    # 关闭头像显示
        close                               # 关闭窗口
        $game_message.visible = @closing
      end
    end
    # 显示对话时,计算自动关闭时间
    if $game_message.visible
      if $game_temp.auto_close > 0
        $game_temp.auto_close -= 1
      else
        terminate_message
      end
    end
  end
  #--------------------------------------------------------------------------
  # ◎ 还原默认设定
  #--------------------------------------------------------------------------
  def default_setting
    @user_cancel = false                           # 暂时使用默认对话框的标志
    $game_temp.face_type = FUKI::H_ALIGN           # 头像水平显示位置
    $game_temp.speed = FUKI::SPEED                 # 对话打字速度修正
    $game_temp.auto_close = FUKI::AUTO_CLOSE_TIME  # 自动关闭时间
    @namebar_sprite.bitmap.clear
  end
  #--------------------------------------------------------------------------
  # ◎ 头像图像预留宽度
  #--------------------------------------------------------------------------
  def face_width
    name = $game_message.face_name
    return 0 if name == ""
    return Cache.face(name).width/4# + FUKI::FACE_X_ADJ
  end
  #--------------------------------------------------------------------------
  # ◎ 头像图像预留高度
  #--------------------------------------------------------------------------
  def face_height
    name = $game_message.face_name
    return 0 if name == ""
    return Cache.face(name).height/2# + FUKI::FACE_Y_ADJ
  end
  #--------------------------------------------------------------------------
  # ◎ 是否使用呼出对话框
  #--------------------------------------------------------------------------
  def use_fuki?
    # 考虑细分条件
    return false if @user_cancel                 # 暂时使用默认对话框的标志
    return false if get_character_pos == nil     # 找不到说话者坐标时
    return true
  end
  #--------------------------------------------------------------------------
  # ● 生成所持金窗口
  #--------------------------------------------------------------------------
  def create_gold_window
    @gold_window = Window_Gold.new(384, 0)
    @gold_window.openness = 0
  end
  #--------------------------------------------------------------------------
  # ● 生成数值输入窗口
  #--------------------------------------------------------------------------
  def create_number_input_window
    @number_input_window = Window_NumberInput.new
    @number_input_window.visible = false
  end
  #--------------------------------------------------------------------------
  # ● 生成背景活动块
  #--------------------------------------------------------------------------
  def create_back_sprite
    @back_sprite = Sprite.new
    @back_sprite.bitmap = Cache.system("MessageBack")
    @back_sprite.visible = (@background == 1)
    @back_sprite.z = 190
  end
  #--------------------------------------------------------------------------
  # ◎ 生成头像
  #--------------------------------------------------------------------------
  def create_face_sprite
    @face_sprite = Sprite.new
    @face_sprite.bitmap = Bitmap.new(1,1)
    @face_sprite.z = self.z + 2
    @face_sprite.visible = false
    @old_name = ""                        # 判断头像是否改变
    @old_index = 0                        # 判断头像是否改变
  end
  #--------------------------------------------------------------------------
  # ◎ 生成对话框箭头
  #--------------------------------------------------------------------------
  def create_arrow_sprite
    @arrow_sprite = Sprite.new
    @arrow_sprite.bitmap = Bitmap.new(1, 1)
    @arrow_sprite.z = self.z + 1
    @arrow_sprite.visible = false
   end
  #--------------------------------------------------------------------------
  # ◎ 生成名称背景条
  #--------------------------------------------------------------------------
  def create_namebar_sprite
    @namebar_sprite = Sprite.new
    @namebar_sprite.bitmap = Bitmap.new(Graphics.width, Graphics.height)
    @namebar_sprite.z = self.z + 1
   end
  #--------------------------------------------------------------------------
  # ◎ 释放名称背景条
  #--------------------------------------------------------------------------
  def dispose_namebar_sprite
    @namebar_sprite.dispose
  end
  #--------------------------------------------------------------------------
  # ◎ 释放对话框箭头
  #--------------------------------------------------------------------------
  def dispose_arrow_sprite
    @arrow_sprite.dispose
  end
  #--------------------------------------------------------------------------
  # ◎ 释放头像
  #--------------------------------------------------------------------------
  def dispose_face_sprite
    @face_sprite.dispose
  end
  #--------------------------------------------------------------------------
  # ● 释放所持金窗口
  #--------------------------------------------------------------------------
  def dispose_gold_window
    @gold_window.dispose
  end
  #--------------------------------------------------------------------------
  # ● 释放数值输入窗口
  #--------------------------------------------------------------------------
  def dispose_number_input_window
    @number_input_window.dispose
  end
  #--------------------------------------------------------------------------
  # ● 释放背景活动块
  #--------------------------------------------------------------------------
  def dispose_back_sprite
    @back_sprite.dispose
  end
  #--------------------------------------------------------------------------
  # ● 更新所持金窗口
  #--------------------------------------------------------------------------
  def update_gold_window
    @gold_window.update
  end
  #--------------------------------------------------------------------------
  # ● 更新数值输入窗口
  #--------------------------------------------------------------------------
  def update_number_input_window
    @number_input_window.update
  end
  #--------------------------------------------------------------------------
  # ● 更新背景活动块
  #--------------------------------------------------------------------------
  def update_back_sprite
    @back_sprite.visible = (@background == 1)
    @back_sprite.y = y - 16
    @back_sprite.opacity = openness
    @back_sprite.update
  end
  #--------------------------------------------------------------------------
  # ● 更新快速显示标志
  #--------------------------------------------------------------------------
  def update_show_fast
    if @fuki_pause or self.openness < 255
      @show_fast = false
    elsif Input.trigger?(Input::C) and @wait_count < 2
      @show_fast = true
    elsif not Input.press?(Input::C)
      @show_fast = false
    end
    if @show_fast and @wait_count > 0
      @wait_count -= 1
    end
  end
  #--------------------------------------------------------------------------
  # ● 判断下一消息继续显示
  #--------------------------------------------------------------------------
  def continue?
    return true if $game_message.num_input_variable_id > 0
    return false if $game_message.texts.empty?
    if self.openness > 0 and not $game_temp.in_battle
      return false if @background != $game_message.background
      return false if @position != $game_message.position
    end
    return true
  end
  #--------------------------------------------------------------------------
  # ◎ 开始显示消息
  #--------------------------------------------------------------------------
  def start_message
    @show_name = false                              # 重新初始化名称标志
    unless $game_message.face_name.empty?
      # 新增名称并设定文字颜色
      text = "\\C[#{$game_temp.fuki_name_color}]" +
             $game_message.face_name.to_s + ":" +
             "\\C[#{$game_temp.fuki_msg_color}]"
      $game_message.texts.unshift(text)
      @show_name = true                             # 设定名称标志
    end
    @text = ""
    for i in 0...$game_message.texts.size
      @text += "  " if i >= $game_message.choice_start
      @text += $game_message.texts[i].clone + "\x00"
    end
    @item_max = $game_message.choice_max
    convert_special_characters
    new_page
    @update_pos = true                              # 对话框跟随开关关闭
  end
  #--------------------------------------------------------------------------
  # ◎ 更换页面处理
  #--------------------------------------------------------------------------
  def new_page
    contents.clear
    if $game_message.face_name.empty?               # 清除上一次的头像
      @contents_x = 0
      @face_sprite.bitmap.dispose unless @face_sprite.bitmap.disposed?
    else                                            # 初始化头像重绘环境
      name = $game_message.face_name
      index = $game_message.face_index
      if @old_name != name or @old_index != index
        @old_name = name
        @old_index = index
      end
      draw_fuki_face(name, index)                   # 重绘头像
      @contents_x = face_width                      # 根据头像修正横坐标
    end
    @contents_y = 0
    @line_count = 0
    @show_fast = false
    @line_show_fast = false
    @pause_skip = false
    contents.font.color = text_color(0)             # 还原默认文字颜色
  end
  #--------------------------------------------------------------------------
  # ● 换行处理
  #--------------------------------------------------------------------------
  def new_line
    if $game_message.face_name.empty?
      @contents_x = 0
    else
      name = $game_message.face_name
      @contents_x = face_width
    end
    @contents_y += FUKI::FONT_SIZE + 2
    @line_count += 1
    @line_show_fast = false
  end
  #--------------------------------------------------------------------------
  # ● 特殊文字变换
  #--------------------------------------------------------------------------
  def convert_special_characters
    @text.gsub!(/\\V\[([0-9]+)\]/i) { $game_variables[$1.to_i] }
    @text.gsub!(/\\V\[([0-9]+)\]/i) { $game_variables[$1.to_i] }
    @text.gsub!(/\\N\[([0-9]+)\]/i) { $game_actors[$1.to_i].name }
    @text.gsub!(/\\C\[([0-9]+)\]/i) { "\x01[#{$1}]" }
    @text.gsub!(/\\G/)              { "\x02" }
    @text.gsub!(/\\\./)             { "\x03" }
    @text.gsub!(/\\\|/)             { "\x04" }
    @text.gsub!(/\\!/)              { "\x05" }
    @text.gsub!(/\\>/)              { "\x06" }
    @text.gsub!(/\\</)              { "\x07" }
    @text.gsub!(/\\\^/)             { "\x08" }
    @text.gsub!(/\\\\/)             { "\\" }
  end
  #--------------------------------------------------------------------------
  # ◎ 重绘名称背景条
  #--------------------------------------------------------------------------
  def reset_namebar_bitmap
    @namebar_sprite.bitmap.clear                # 重绘之前清理名称背景条
    return if $game_message.face_name.empty?    # 无名称时不描绘
    rect = Rect.new(0, 0, 0, 0)
    rect.x = self.x + FUKI::NAME_BAR_X
    rect.y = self.y + 16
    rect.width = self.width - FUKI::NAME_BAR_X * 2
    rect.height = FUKI::FONT_SIZE + 2
    color1 = text_color(FUKI::NAME_BAR_COLOR)
    color2 = text_color(FUKI::NAME_BAR_COLOR)
    color1.alpha = FUKI::NAME_BAR_OPACITY
    color2.alpha = 0
    # 渐变条
    @namebar_sprite.bitmap.gradient_fill_rect(rect, color1, color2)
  end
  #--------------------------------------------------------------------------
  # ◎ 设置窗口背景与位置
  #--------------------------------------------------------------------------
  def reset_window
    self.pause = true
    @background = $game_message.background
    @position = $game_message.position
    if @background == 0   # 普通窗口
      set_opacity(self)   # 透明度设定
    else                  # 背景变暗、透明
      self.opacity = 0
    end
    # 窗口水平居中
    self.x = (544 - self.width) / 2
    case @position
    when 0  # 上
      if FUKI::IN_CONTENT
        self.y = 8
      else
        if FUKI::V_ALIGN == 2
          self.y = [face_height, self.height].max - self.height + 8
        else
          self.y = 8
        end
      end
      @gold_window.y = 360
    when 1  # 中
      self.y = (Graphics.height - self.height) / 2
      @gold_window.y = 0
    when 2  # 下
      if FUKI::V_ALIGN == 0 and face_height > 0
        self.y = \
        Graphics.height - [face_height, self.height].max - self.height*2 - 8
      else
        self.y = Graphics.height - self.height - 8
      end
      @gold_window.y = 0
    end
  end
  #--------------------------------------------------------------------------
  # ◎ 预提取文本
  #--------------------------------------------------------------------------
  def get_message
    text = []
    for i in 0...$game_message.texts.size
      text[i] = ""
      text[i] += "  " if i >= $game_message.choice_start
      text[i] += $game_message.texts[i].clone
      text[i].gsub!(/\\V\[([0-9]+)\]/i) { $game_variables[$1.to_i] }
      text[i].gsub!(/\\V\[([0-9]+)\]/i) { $game_variables[$1.to_i] }
      text[i].gsub!(/\\N\[([0-9]+)\]/i) { $game_actors[$1.to_i].name }
      text[i].gsub!(/\\C\[([0-9]+)\]/i) { "" }
      text[i].gsub!(/\\G/)              { "" }
      text[i].gsub!(/\\\./)             { "" }
      text[i].gsub!(/\\\|/)             { "" }
      text[i].gsub!(/\\!/)              { "" }
      text[i].gsub!(/\\>/)              { "" }
      text[i].gsub!(/\\</)              { "" }
      text[i].gsub!(/\\\^/)             { "" }
      text[i].gsub!(/\\\\/)             { "\\" }
    end
    return text
  end
  #--------------------------------------------------------------------------
  # ◎ 获取窗口尺寸
  #--------------------------------------------------------------------------
  def get_window_size
    contents.font.name = $game_temp.fuki_font_name
    contents.font.size = $game_temp.fuki_font_size
    w = h = 0 # 初始化长宽
    text_con = get_message
    for text in text_con
      x = @contents_x
      loop do
        c = text.slice!(/./m)             # 获取下一个文字
        case c
        when nil                          # 没有可以显示的文字
          break
        else                              # 普通文字
          c_width = contents.text_size(c).width
          x += c_width
        end
      end
      w = [x, w].max
      if $game_message.face_name.empty?
        h = $game_message.texts.size * (FUKI::FONT_SIZE + 2) + 32
      else
        if FUKI::IN_CONTENT
          h_min = face_height + FUKI::FACE_Y_ADJ
          h = [h_min, text_con.size*(FUKI::FONT_SIZE + 2) + 32].max
        else
          h = [48, text_con.size*(FUKI::FONT_SIZE + 2) + 32].max
        end
      end
    end
    # 调整名称显示的高度差
    h += FUKI::NAME_Y_ADJ if @show_name
    # 输入数值的情况
    if $game_message.num_input_variable_id > 0
      w = [w, 24 + $game_message.num_input_digits_max * 16 + face_width].max
      # 预留数值窗口高度
      h += FUKI::FONT_SIZE + 2
      # 避开空对话内容的情况
      h = [h, @number_input_window.height].max
    end
    return w-16, h
  end
  #--------------------------------------------------------------------------
  # ◎ 重设位图容器
  #--------------------------------------------------------------------------
  def reset_contents
    self.contents.dispose
    self.contents = Bitmap.new(self.width - 32, self.height - 32)
  end
  #--------------------------------------------------------------------------
  # ◎ 重设对话框尺寸
  #--------------------------------------------------------------------------
  def reset_msg_size
    size = get_window_size
    self.width = size[0] + 48
    self.height = size[1]
  end
  #--------------------------------------------------------------------------
  # ◎ 重设对话框坐标
  #--------------------------------------------------------------------------
  def reset_msg_pos
    self.pause = false if use_fuki?                  # 关闭暂停标志
    # 调整对话框坐标
    pos = get_character_pos
    case pos
    when nil                                         # 当前屏幕无对话角色时
      @arrow_sprite.visible = false
      reset_window
      set_face(0)
    else
      # X 坐标
      if pos[0] < 0
        self.x = 0
      elsif pos[0] > Graphics.width - self.width
        self.x = Graphics.width - self.width
      else
        self.x = pos[0]
      end
      # Y 坐标 ◎
      compare = FUKI::IN_CONTENT ? self.height : face_height
      if pos[1] < compare
        self.y = pos[1] + self.height + FUKI::MSG_Y_ADJ
        # 调整对话框箭头
        set_arrow(0, pos)
      else
        self.y = pos[1] - pos[2] - FUKI::MSG_Y_ADJ
        # 调整对话框箭头
        set_arrow(1, pos)
      end
    end
    # 调整头像
    set_face(1)
    # 调整数据输入窗体坐标
    set_input_window(x, y, $game_temp.face_type)
  end
  #--------------------------------------------------------------------------
  # ◎ 调整数值输入
  #     align  : 对齐方式 (1:左 ;0:右)
  #              和头像相反方向
  #--------------------------------------------------------------------------
  def set_input_window(x, y, align)
    return unless @number_input_window.active
    case align
    when 1
      @number_input_window.x = x
      @number_input_window.y = y + @contents_y
    when 0
      @number_input_window.x = x + face_width
      @number_input_window.y = y + @contents_y
    end
    @number_input_window.visible = true
  end
  #--------------------------------------------------------------------------
  # ◎ 调整对话框箭头#######
  #     type : 上下标志 (0: 箭头在上; 1: 箭头在下)
  #     pos    : 坐标数组 (get_character_pos)
  #--------------------------------------------------------------------------
  def set_arrow(type, pos)
    return if pos == nil
    if type == 0
      arrow_name = FUKI::SKIN + "_arrow_up.png"
      @arrow_sprite.bitmap = Cache.system(arrow_name)
      @arrow_sprite.x = pos[0] + (self.width / 2) + FUKI::ARR0W_UP_X_ADJ
      @arrow_sprite.y = self.y - @arrow_sprite.height + FUKI::ARR0W_UP_Y_ADJ
    else
      arrow_name = FUKI::SKIN + "_arrow_down.png"
      @arrow_sprite.bitmap = Cache.system(arrow_name)
      @arrow_sprite.x = pos[0] + (self.width / 2) + FUKI::ARR0W_DOWN_X_ADJ
      @arrow_sprite.y = self.y + self.height + FUKI::ARR0W_DOWN_Y_ADJ
    end
    @arrow_sprite.visible = true
  end
  #--------------------------------------------------------------------------
  # ◎ 调整头像
  #     type  : 头像位置标志 (0:普通对话框 ;1:呼出对话框)
  #--------------------------------------------------------------------------
  def set_face(type)
    case type
    when 0                                    # 普通对话框
      if $game_temp.face_type == 0
        @face_sprite.x = 16
        @face_sprite.mirror = false
      else
        @face_sprite.x = self.width - face_width
        @face_sprite.mirror = true
      end
      @face_sprite.y = self.y + 16
    when 1                                    # 呼出对话框
      # 调整横坐标
      case $game_temp.face_type
      when 0
        @face_sprite.x = self.x + FUKI::FACE_X_ADJ
        @face_sprite.mirror = false
      when 1
        @face_sprite.x = self.x + self.width - face_width - FUKI::FACE_X_ADJ
        @face_sprite.mirror = true
      end
      # 调整纵坐标
      case FUKI::V_ALIGN
      when 0
        @face_sprite.y = self.y
      when 1
        @face_sprite.y = self.y + (self.height - face_height)/2
      when 2
        @face_sprite.y = self.y + self.height - face_height
      end
      @face_sprite.y += FUKI::FACE_Y_ADJ
      # 头像在对话框内的情况
      @face_sprite.y = self.y + FUKI::FACE_Y_ADJ if FUKI::IN_CONTENT
    end
    # 打开头像显示
    @face_sprite.visible = true
  end
  #--------------------------------------------------------------------------
  # ◎ 设定透明名
  #     target : 对象
  #--------------------------------------------------------------------------
  def set_opacity(target)
    target.opacity = FUKI::OPACITY
  end
  #--------------------------------------------------------------------------
  # ◎ 事件是否在屏幕范围内
  #     event : 事件
  #--------------------------------------------------------------------------
  def within_screen_range?(event)
    # 考虑到某些长得比较高的事件
    height = Cache.character(event.character_name).height
    y_plus = event.character_name.include?('!$') ? height/4 : height/8
    range_x = (0..Graphics.width).include?(event.screen_x)
    range_y = (0..Graphics.height + y_plus).include?(event.screen_y)
    return range_x && range_y
  end
  #--------------------------------------------------------------------------
  # ◎ 获取角色坐标
  #--------------------------------------------------------------------------
  def get_character_pos
    # 使用呼出对话框时
    unless $game_message.face_name.empty? # 待改为@texts判断
      # 事件时
      for event in $game_map.events.values
        next unless within_screen_range?(event)
        if event.name == $game_message.face_name
          x = event.screen_x - (self.width / 2)
          y = event.screen_y - self.height
          height = Cache.character(event.character_name).height
          y_plus = event.character_name.include?('!$') ? height/4 : height/8
          return x, y, y_plus
        end
      end
      # 玩家时
      for member in $game_party.members
        if member.name == $game_message.face_name
          x = $game_player.screen_x - (self.width / 2)
          y = $game_player.screen_y - self.height
          height = Cache.character(member.character_name).height
          y_plus = member.character_name.include?('!$') ? height/4 : height/8
          return x, y, y_plus
        end
      end
    end
    # 无坐标时
    return nil
  end
  #--------------------------------------------------------------------------
  # ◎ 描绘脸谱
  #     face_name  : 脸谱图像文件名
  #     face_index : 脸谱图像索引
  #--------------------------------------------------------------------------
  def draw_fuki_face(face_name, face_index)
    bitmap = Cache.face(face_name)
    width = bitmap.width / 4
    height = bitmap.height / 2
    rect = Rect.new(0, 0, 0, 0)
    rect.x = face_index % 4 * width
    rect.y = face_index / 4 * height
    rect.width = width
    rect.height = height
    @face_sprite.bitmap = Bitmap.new(width, height)
    @face_sprite.bitmap.blt(0, 0, bitmap, rect)
    bitmap.dispose
  end
  #--------------------------------------------------------------------------
  # ● 消息结束
  #--------------------------------------------------------------------------
  def terminate_message
    self.active = false
    @fuki_pause = false
    self.index = -1
    @gold_window.close
    @number_input_window.active = false
    @number_input_window.visible = false
    $game_message.main_proc.call if $game_message.main_proc != nil
    $game_message.clear
    @face_sprite.visible = false
    @update_pos = false                 # 对话框跟随开关关闭
    default_setting                 # 还原默认设定
  end
  #--------------------------------------------------------------------------
  # ◎ 更新消息
  #--------------------------------------------------------------------------
  def update_message
    # 字体设定
    contents.font.name = $game_temp.fuki_font_name
    contents.font.size = $game_temp.fuki_font_size
    contents.font.shadow = FUKI::FONT_SHADOW
    loop do
      c = @text.slice!(/./m)            # 获取下一条文字
      case c
      when nil                          # 没有可以显示的文字
        finish_message                  # 更新结束
        break
      when "\x00"                       # 换行
        # 调整名称显示的高度
        if @show_name
          @show_name = false
          @contents_y += FUKI::NAME_Y_ADJ
        end
        new_line
        if @line_count >= MAX_LINE      # 行数为最大时
          unless @text.empty?           # 如果还有增加则继续
            @fuki_pause = true           # 等待输入
            break
          end
        end
      when "\x01"                       # \C[n]  (更改文字色)
        @text.sub!(/\[([0-9]+)\]/, "")
        contents.font.color = text_color($1.to_i)
        next
      when "\x02"                       # \G  (显示所持金)
        @gold_window.refresh
        @gold_window.open
      when "\x03"                       # \.  (等待 1/4 秒)
        @wait_count = 15
        break
      when "\x04"                       # \|  (等待 1 秒)
        @wait_count = 60
        break
      when "\x05"                       # \!  (等待输入)
        @fuki_pause = true
        break
      when "\x06"                       # \>  (瞬间显示 ON)
        @line_show_fast = true
      when "\x07"                       # \<  (瞬间显示 OFF)
        @line_show_fast = false
      when "\x08"                       # \^  (不等待输入)
        @pause_skip = true
      else                              # 普通文字
        @wait_count = $game_temp.speed  # 对话框打字速度修正
        # 判断头像对文字的影响
        case $game_temp.face_type
        when 0
          contents.draw_text\
          (@contents_x, @contents_y, 40, FUKI::FONT_SIZE + 2, c)
        when 1
          contents.draw_text\
          (@contents_x - face_width, @contents_y, 40, FUKI::FONT_SIZE + 2, c)
        end
        c_width = contents.text_size(c).width
        @contents_x += c_width
      end
      break unless @show_fast or @line_show_fast
    end
  end
  #--------------------------------------------------------------------------
  # ● 消息更新结束
  #--------------------------------------------------------------------------
  def finish_message
    if $game_message.choice_max > 0
      start_choice
    elsif $game_message.num_input_variable_id > 0
      start_number_input
    elsif @pause_skip
      terminate_message
    else
      @fuki_pause = true
    end
    @wait_count = 10
    @text = nil
  end
  #--------------------------------------------------------------------------
  # ● 开始选择项
  #--------------------------------------------------------------------------
  def start_choice
    self.active = true
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # ◎ 开始输入数值
  #--------------------------------------------------------------------------
  def start_number_input
    digits_max = $game_message.num_input_digits_max
    number = $game_variables[$game_message.num_input_variable_id]
    @number_input_window.digits_max = digits_max
    @number_input_window.number = number
    @number_input_window.y = y + @contents_y
    @number_input_window.active = true
    @number_input_window.update
  end
  #--------------------------------------------------------------------------
  # ◎ 更新光标
  #--------------------------------------------------------------------------
  def update_cursor
    if @index >= 0
      # 获取光标的横坐标
      if $game_message.face_name.empty? or FUKI::H_ALIGN == 1
        x = 0
      else
        x = face_width
      end
      # 获取光标的纵坐标
      y = ($game_message.choice_start + @index) * (FUKI::FONT_SIZE + 2)
      # 修正名称行
      unless $game_message.face_name.empty?
        y += FUKI::NAME_Y_ADJ + FUKI::FONT_SIZE + 2
      end
      width = contents.width - face_width
      self.cursor_rect.set(x, y, width, FUKI::FONT_SIZE + 2)
    else
      self.cursor_rect.empty
    end
  end
  #--------------------------------------------------------------------------
  # ● 文章显示输入处理
  #--------------------------------------------------------------------------
  def input_pause
    if Input.trigger?(Input::B) or Input.trigger?(Input::C)
      @fuki_pause = false
      if @text != nil and not @text.empty?
        new_page if @line_count >= MAX_LINE
      else
        terminate_message
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 选择项输入处理
  #--------------------------------------------------------------------------
  def input_choice
    if Input.trigger?(Input::B)
      if $game_message.choice_cancel_type > 0
        Sound.play_cancel
        $game_message.choice_proc.call($game_message.choice_cancel_type - 1)
        terminate_message
      end
    elsif Input.trigger?(Input::C)
      Sound.play_decision
      $game_message.choice_proc.call(self.index)
      terminate_message
    end
  end
  #--------------------------------------------------------------------------
  # ● 数值输入处理
  #--------------------------------------------------------------------------
  def input_number
    if Input.trigger?(Input::C)
      Sound.play_decision
      $game_variables[$game_message.num_input_variable_id] =
        @number_input_window.number
      $game_map.need_refresh = true
      terminate_message
    end
  end
end
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
37 小时
注册时间
2012-6-15
帖子
26
5
发表于 2012-6-23 21:08:41 | 只看该作者
楼主要的是不是这个

点评

连贴  发表于 2012-6-23 22:58
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
14 小时
注册时间
2012-12-21
帖子
6
6
发表于 2012-12-31 04:54:26 | 只看该作者
.................

点评

卧槽突然发现这还是个坟!  发表于 2012-12-31 10:14
这算纯灌水  发表于 2012-12-31 10:13

评分

参与人数 1星屑 -40 收起 理由
咕噜 -40 挖坟+纯水

查看全部评分

回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-6-26 09:41

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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