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

Project1

 找回密码
 注册会员
搜索
查看: 16409|回复: 17

[原创发布] 【维护】Fuki对话框优化版 v6 【更新 PATCH 1 @ 2011-11-26】

[复制链接]

Lv2.观梦者

(?????)

梦石
0
星屑
695
在线时间
1327 小时
注册时间
2011-7-18
帖子
3184

贵宾

发表于 2011-11-23 00:12:12 | 显示全部楼层 |阅读模式

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

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

x
本帖最后由 各种压力的猫君 于 2011-11-26 23:51 编辑

Shy07 说
猫君既然你都把名字注上去了,索性另开一帖负责维护吧=W=
于是本帖就诞生了。
本帖接受BUG反馈,不负责回答“这怎么用啊我不会用”这种伸手问题。
由于不是咱自己写的脚本维护起来需要时间,勿催更新……

原帖:http://rpg.blue/thread-210221-1-1.html

更多截图、功能介绍以及窗口皮肤规格说明请见原帖。

1.jpg

1号补丁(2011-11-26)
  1. #==============================================================================
  2. #    Fuki对话框优化版 v6 PATCH 1 @ 2011-11-26
  3. #------------------------------------------------------------------------------
  4. #    修正:当事件不为自动执行时无法用 $mes_id = 0 指定目标为当前事件。
  5. #==============================================================================

  6. #==============================================================================
  7. # ■ Window_Message
  8. #==============================================================================

  9. class Window_Message < Window_Selectable
  10.   #--------------------------------------------------------------------------
  11.   # ○ 取得角色
  12.   #     parameter : 参数
  13.   #--------------------------------------------------------------------------
  14.   def get_character(parameter)
  15.     # 参数分歧
  16.     case parameter
  17.     when nil
  18.       return events == nil
  19.     when -1  # 玩家
  20.       return $game_player
  21.     when 0   # 该事件
  22.       # 清空事件id
  23.       @event_id = nil
  24.       # 读取地图事件
  25.       events = $game_map.events
  26.       # 循环 (地图事件)
  27.       for event in events.values
  28.         # 如果找到了启动中的事件
  29.         if event.starting or event.lock?
  30.           @event_id = event.id
  31.         end
  32.       end
  33.       return events == nil ? nil : events[@event_id]
  34.     else     # 特定事件
  35.       events = $game_map.events
  36.       return events == nil ? nil : events[parameter]
  37.     end
  38.   end
  39. end

  40. #==============================================================================
复制代码
以上为补丁放置区,主版本号尚未更新之时所作修正均以补丁形式发布。
补丁的放置位置按补丁编号顺序置于Fuki优化版脚本之下。

v6 更新内容:
①修正本事件为对象的错误,现在可以直接用 $mes_id = 0 代表本事件。
②完善注释、设定模块化,版本号定为v6。
③选择项和数值输入的矩形框依然调用数据库中设定的窗口皮肤。

已知BUG:
①默认字号不为20会导致一系列问题。将在下一版本(v7)修正。

脚本:
  1. #==============================================================================
  2. #    Fuki对话框优化版 v6
  3. #    原版作者:by パラ犬(日)
  4. #    汉化修正:by 66RPG.com
  5. #------------------------------------------------------------------------------
  6. #    2006年01月 汉化修改 by bbschat
  7. #    2007年02月 脚本更新 by KKME
  8. #    2007年07月 脚本更新 by 绫晓露雪萌
  9. #    2010年05月 脚本优化 by Linki Shy
  10. #    2011年10月 阴影修正 by 各种压力的猫君
  11. #    2011年11月 脚本增强 by 各种压力的猫君
  12. #==============================================================================
  13. #
  14. # 【脚本功能】
  15. #
  16. #   1. 此脚本主要是解决了在1.03版XP上的方块问题,以及增加了一些功能
  17. #
  18. #   2. 人名美化使用方法与以前一样
  19. #
  20. #   3. 默认人物头像在左边显示
  21. #      如果需要右边显示,在输入的名称之后加"@r"即可
  22. #      例: "阿尔西斯@r:"(注意必须小写)
  23. #
  24. #   4. 在对话中更改字体的方法:
  25. #       \f[X]:更改字号为X
  26. #
  27. #   5. 在对话中显示(技能 物品 武器 防具 人物)图标和名称的方法:
  28. #       \s[X]: 显示第X号技能图标和名称
  29. #       \i[X]: 显示第X号物品图标和名称
  30. #       \w[X]: 显示第X号武器图标和名称
  31. #       \a[X]: 显示第X号防具图标和名称
  32. #       \r[X]: 显示第X号人物图标和名称
  33. #
  34. #   6. 在对话中更改文字不透明度的方法:
  35. #       \o[X]: 把文字不透明度更改为X (取值范围为0~255)
  36. #   
  37. #   7. 在对话中关闭或开启拟声音效的方法:
  38. #       \q:默认开启时,执行一次关闭,再执行一次则开启
  39. #
  40. #   8. 如果需要自定义字体颜色,
  41. #       可以打开"Graphics/Windowskins"目录下的"Window.png"文件查看
  42. #       使用方法与VX类似
  43. #
  44. #   9. 追加了不为瞬间显示时确定键快速显示的功能
  45. #
  46. #  10. $mes_id = 0          代表本事件
  47. #      $mes_id = -1         代表主角
  48. #      $mes_id = 其他数值   代表事件编号
  49. #      $mes_id = nil        代表不使用fuki形式
  50. #
  51. #
  52. # 【素材要求】
  53. #
  54. #   1. 要求所有半身像朝向一致(默认是正面偏右)
  55. #
  56. #==============================================================================

  57. #==============================================================================
  58. # ■ Fuki_v6_Setup
  59. #------------------------------------------------------------------------------
  60. #    Fuki对话框优化版 v6 参数设置
  61. #==============================================================================

  62. module Fuki_v6_Setup
  63.    
  64.   #--------------------------------------------------------------------------
  65.   # ● 外观
  66.   #--------------------------------------------------------------------------
  67.   
  68.     # 窗口透明度
  69.     FUKI_OPACITY = 255         # 呼出对话框
  70.     MES_OPACITY  = 160         # 默认信息窗口
  71.    
  72.     # 角色高度尺寸
  73.     CHARACTOR_HEIGHT = 50
  74.    
  75.     # 呼出对话框的相对位置(纵坐标)
  76.     POP_SHIFT_TOP = 0          # 表示位置为上的时候
  77.     POP_SHIFT_UNDER = -4       # 表示位置为下的时候
  78.    
  79.     # 信息的表示速度(数字越小速度越快,0为瞬间表示)
  80.     # 游戏中可以随时用数字代入 $MES_SPEED 来改变消息表示速度。
  81.     MES_SPEED = 1
  82.    
  83.     # 名称修饰符(一对)(此处参考 沉影不器 的VX版对话框加强)
  84.     NAME_SYMBOL = "【】"
  85.    
  86.     # 名称颜色
  87.     NAME_COLOR = 7
  88.   
  89.   #--------------------------------------------------------------------------
  90.   # ● 功能( true / false )
  91.   #--------------------------------------------------------------------------
  92.    
  93.     # 是否显示尾巴
  94.     TAIL_SHOW = true
  95.    
  96.     # 是否播放打字音效
  97.     $play_voice = true
  98.    
  99.     # $MES_SPEED不为0时,是否可以用确定键快速显示对话
  100.     ENABLE_SKIP = true

  101.     # 窗口表示时是否根据画面大小自动改变窗口出现的位置
  102.     POS_FIX = true
  103.    
  104.   #--------------------------------------------------------------------------
  105.   # ● 字体
  106.   #--------------------------------------------------------------------------
  107.   
  108.     # 预设字体组
  109.     FONT_ARRAY = ["黑体", "宋体", "仿宋"]
  110.    
  111.     # 默认字号【已知BUG,当默认字号不为20时会导致各种奇怪问题……暂未修正】
  112.     MES_FONT_SIZE = 20
  113.    
  114.     # 默认字体颜色
  115.     FUKI_COLOR = Color.new(0, 0, 0, 255)
  116.   
  117.   #--------------------------------------------------------------------------
  118.   # ● 目录
  119.   #--------------------------------------------------------------------------
  120.   
  121.     # 呼出对话框用Skin名称(自动在 Graphics\Windowskins 内搜索)
  122.     FUKI_SKIN_NAME = "Window"
  123.    
  124.     # 设定头像图片保存目录
  125.     FACE_PIC_DIR = "Graphics/Faces/"

  126.   #--------------------------------------------------------------------------
  127.   # ● 头像对应表
  128.   #--------------------------------------------------------------------------
  129.   #    如果不想使用角色名字直接作为头像文件名
  130.   #    可在这里重新设定角色名字与文件名的对应关系
  131.   #
  132.   #  (这功能怎么用我自己也没搞明白……大家无视吧 by 各种压力的猫君)
  133.   #--------------------------------------------------------------------------
  134.   
  135.     NAME_TABLE = {"玩家"=>"维斯特"}
  136.    
  137. end
  138. #==============================================================================
  139.   
  140. "┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓"
  141. "┃        自定义内容到此结束,以下内容切勿随意修改        ┃"
  142. "┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛"

  143. #==============================================================================
  144. # ● 初始化全局变量并定义chat方法
  145. #==============================================================================
  146. $mes_id   = nil
  147. $mes_name = ""
  148. def chat(id = nil,name = "")
  149.   $mes_id = id
  150.   $mes_name = name
  151. end

  152. #==============================================================================
  153. # ■ Game_Temp
  154. #==============================================================================

  155. class Game_Temp
  156.   #--------------------------------------------------------------------------
  157.   # ● 定义实例变量
  158.   #--------------------------------------------------------------------------
  159.   attr_accessor:namebmp      # 记录角色名字和头像文件名对应关系
  160.   #--------------------------------------------------------------------------
  161.   # ● 初始化对像
  162.   #--------------------------------------------------------------------------
  163.   alias initialize_fuki initialize
  164.   def initialize
  165.     initialize_fuki
  166.     @namebmp = Fuki_v6_Setup::NAME_TABLE
  167.   end
  168. end

  169. #==============================================================================
  170. # ■ Window_InputNumber
  171. #==============================================================================

  172. class Window_InputNumber < Window_Base
  173.   #--------------------------------------------------------------------------
  174.   # ● 初始化对像
  175.   #     digits_max : 位数
  176.   #--------------------------------------------------------------------------
  177.   def initialize(digits_max)
  178.     @digits_max = digits_max
  179.     @number = 0
  180.     # 从数字的幅度计算(假定与 0~9 等幅)光标的幅度
  181.     dummy_bitmap = Bitmap.new(Fuki_v6_Setup::MES_FONT_SIZE, Fuki_v6_Setup::MES_FONT_SIZE)
  182.     @cursor_width = dummy_bitmap.text_size("0").width + 8
  183.     dummy_bitmap.dispose
  184.     super(0, 0, @cursor_width * @digits_max + 32, 64)
  185.     self.contents = Bitmap.new(width - 32, height - 32)
  186.     self.contents.font.size = Fuki_v6_Setup::MES_FONT_SIZE
  187.     self.contents.font.color = Fuki_v6_Setup::FUKI_COLOR
  188.     self.z += 9999
  189.     self.opacity = 0
  190.     @index = 0
  191.     refresh
  192.     update_cursor_rect
  193.   end
  194.   #--------------------------------------------------------------------------
  195.   # ● 更新光标矩形
  196.   #--------------------------------------------------------------------------
  197.   def update_cursor_rect
  198.     self.cursor_rect.set(@index * @cursor_width-4, 0, @cursor_width, Fuki_v6_Setup::MES_FONT_SIZE + 4)
  199.   end
  200.   #--------------------------------------------------------------------------
  201.   # ● 刷新
  202.   #--------------------------------------------------------------------------
  203.   def refresh
  204.     self.contents.clear
  205.     s = sprintf("%0*d", @digits_max, @number)
  206.     for i in 0...@digits_max
  207.       self.contents.draw_text(i * @cursor_width, 0, 24, Fuki_v6_Setup::MES_FONT_SIZE + 4, s[i,1])
  208.     end
  209.   end
  210. end

  211. #==============================================================================
  212. # ■ Window_Message
  213. #==============================================================================

  214. class Window_Message < Window_Selectable
  215.   
  216.   #--------------------------------------------------------------------------
  217.   # ● 初始化状态
  218.   #--------------------------------------------------------------------------
  219.   def initialize
  220.     super(80, 304, 480, 160)
  221.     self.contents = Bitmap.new(width - 32, height - 32)
  222.     self.contents.font.color = text_color(0)
  223.     self.visible = false
  224.     self.z = 9998
  225.     @fade_in = false
  226.     @fade_out = false
  227.     @contents_showing = false
  228.     @cursor_width = 0
  229.     self.active = false
  230.     self.index = -1
  231.     @w = 0
  232.     @h = 0
  233.     @wait = 0
  234.     @dx = 0
  235.     @dy = 0
  236.     $MES_SPEED = Fuki_v6_Setup::MES_SPEED
  237.     #------------------------
  238.     # ★ 特殊时期中断标志
  239.     #------------------------
  240.     @no_term_stop = false
  241.     @save_x = 0
  242.     @save_y = 0
  243.     @old_text_info = []
  244.     @show_right = false
  245.     @show_name  = false
  246.     @face_width = 0
  247.   end
  248.   #--------------------------------------------------------------------------
  249.   # ○ 决定窗口尺寸并生成窗口
  250.   #--------------------------------------------------------------------------
  251.   def refresh_create
  252.     unless @no_term_stop
  253.       @pic_skin.dispose if @pic_skin != nil
  254.       if $game_temp.message_text.include?(":")
  255.         if $game_temp.message_text.include?("@r")
  256.           @show_right = true
  257.           $game_temp.message_text.sub!(/\@r/, "")
  258.         end
  259.         @show_name = true
  260.         # 添加名称修饰符
  261.         unless Fuki_v6_Setup::NAME_SYMBOL.empty?
  262.           $game_temp.message_text = '\c[' + Fuki_v6_Setup::NAME_COLOR.to_s + ']' + Fuki_v6_Setup::NAME_SYMBOL[0,Fuki_v6_Setup::NAME_SYMBOL.size/2] + $game_temp.message_text
  263.           $game_temp.message_text.sub!(/\:/, Fuki_v6_Setup::NAME_SYMBOL[Fuki_v6_Setup::NAME_SYMBOL.size/2,Fuki_v6_Setup::NAME_SYMBOL.size/2] + '\c[0]')
  264.         end
  265.       end
  266.       self.contents.clear
  267.       self.contents.font.color = normal_color
  268.       # 取得窗口尺寸
  269.       get_windowsize
  270.       w = @w + 40
  271.       h = @h * (self.contents.font.size + 4) + 30
  272.       h = 64 if h < 64
  273.       # 生成呼出窗口
  274.       set_fukidasi(self.x, self.y, w, h)
  275.       draw_msg_face
  276.       create_backbmp
  277.     end
  278.     # 初始化信息表示使用的变量
  279.     @dx = @save_x
  280.     @dx += @face_width unless @show_right
  281.     @dy = @save_y
  282.     @cursor_width = 0
  283.     @contents_drawing = true
  284.     # 瞬间表示的情况下
  285.     if $MES_SPEED == 0
  286.       # 循环信息描绘处理
  287.       while $game_temp.message_text != ""
  288.         draw_massage
  289.       end
  290.       draw_opt_text
  291.       @contents_showing_end = true
  292.       @contents_drawing = false
  293.     else
  294.       # 一个一个描绘文字
  295.       refresh_drawtext
  296.     end
  297.   end
  298.   #--------------------------------------------------------------------------
  299.   # ○ 一个一个描绘文字
  300.   #--------------------------------------------------------------------------
  301.   def refresh_drawtext
  302.     # 当按下确定键的时候直接显示剩余的全部文字
  303.     if Input.trigger?(Input::C) and Fuki_v6_Setup::ENABLE_SKIP
  304.       # 循环信息描绘处理
  305.       while $game_temp.message_text != ""
  306.         draw_massage
  307.       end
  308.       draw_opt_text
  309.       @contents_showing_end = true
  310.       @contents_drawing = false
  311.     elsif $game_temp.message_text != ""
  312.       if @wait > 0
  313.         @wait -= 1
  314.       elsif @wait == 0
  315.         # 描绘处理
  316.         draw_massage
  317.         @wait = $MES_SPEED
  318.       end
  319.     else
  320.       draw_opt_text
  321.       @contents_showing_end = true
  322.       @contents_drawing = false
  323.     end
  324.   end
  325.   #--------------------------------------------------------------------------
  326.   # ○ 取得窗口尺寸
  327.   #--------------------------------------------------------------------------
  328.   def get_windowsize
  329.     get_face_width($mes_name)
  330.     x = y = 0
  331.     @h = @w = 0
  332.     @cursor_width = 0
  333.     # 有选择项的话,处理字的缩进
  334.     if $game_temp.choice_start == 0
  335.       x = 16
  336.     end
  337.     # 有等待显示的文字的情况下
  338.     if $game_temp.message_text != nil
  339.     text = $game_temp.message_text.clone
  340.       # 限制文字处理
  341.       begin
  342.         last_text = text.clone
  343.         text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
  344.       end until text == last_text
  345.       text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  346.         $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  347.       end
  348.       text.gsub!(/\\\\/)                 { "\x00" }
  349.       text.gsub!(/\\[Cc]\[([0-9]+)\]/)   { "\x01" }
  350.       text.gsub!(/\\[Gg]/)               { "\x02" }
  351.       text.gsub!(/\\[Ss]\[([0-9]+)\]/)   { "\x03" + $data_skills[$1.to_i].name }
  352.       text.gsub!(/\\[Ii]\[([0-9]+)\]/)   { "\x04" + $data_items[$1.to_i].name }
  353.       text.gsub!(/\\[Ww]\[([0-9]+)\]/)   { "\x05" + $data_weapons[$1.to_i].name }
  354.       text.gsub!(/\\[Aa]\[([0-9]+)\]/)   { "\x06" + $data_armors[$1.to_i].name }
  355.       text.gsub!(/\\[Rr]\[([0-9]+)\]/)   { "\x10" + $game_actors[$1.to_i].name }
  356.       # c 获取 1 个字 (如果不能取得文字就循环)
  357.       while ((c = text.slice!(/./m)) != nil)
  358.         if c == "\x00"
  359.           c = "\\"
  360.         end
  361.         if c == "\x01" or c == "\x02"
  362.           next
  363.         end
  364.         if c == "\x03" or c == "\x04" or c == "\x05" or c == "\x06" or c == "\x010"
  365.           c = "   "
  366.         end
  367.         if c == "\n"
  368.           # y 累加 1
  369.           y += 1
  370.           # 取得纵横尺寸
  371.           @h = y
  372.           @w = x > @w ? x : @w
  373.           if y >= $game_temp.choice_start
  374.             @w = x + Fuki_v6_Setup::MES_FONT_SIZE > @w ? x + Fuki_v6_Setup::MES_FONT_SIZE : @w
  375.           end
  376.           x = 0
  377.           x = Fuki_v6_Setup::MES_FONT_SIZE if y >= $game_temp.choice_start
  378.           # 下面的文字
  379.           next
  380.         end
  381.         # x 为要描绘文字的宽度加法运算
  382.         x += self.contents.text_size(c).width
  383.       end
  384.     end
  385.     # 输入数值的情况
  386.     if $game_temp.num_input_variable_id > 0
  387.       digits_max = $game_temp.num_input_digits_max
  388.       number = $game_variables[$game_temp.num_input_variable_id]
  389.       @h += 1
  390.       x = digits_max * self.contents.font.size + 16
  391.       @w = x > @w ? x : @w
  392.     end
  393.     @w += @face_width
  394.     @w = 128 if @w < 128
  395.   end
  396.   #--------------------------------------------------------------------------
  397.   # ○ 描绘信息处理
  398.   #--------------------------------------------------------------------------
  399.   def draw_massage
  400.     # 有等待显示的文字的情况下
  401.     if $game_temp.message_text != nil or @old_text_info != nil
  402.       text = $game_temp.message_text
  403.       # 限制文字处理
  404.       begin
  405.         last_text = text.clone
  406.         text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
  407.       end until text == last_text
  408.       text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  409.         $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  410.       end
  411.       text.gsub!(/\\\\/)                 { "\x00" }
  412.       text.gsub!(/\\[Cc]\[([0-9]+)\]/)   { "\x01[#{$1}]" }
  413.       text.gsub!(/\\[Gg]/)               { "\x02" }
  414.       text.gsub!(/\\[Ss]\[([0-9]+)\]/)   { "\x03[#{$1}]" }
  415.       text.gsub!(/\\[Ii]\[([0-9]+)\]/)   { "\x04[#{$1}]" }
  416.       text.gsub!(/\\[Ww]\[([0-9]+)\]/)   { "\x05[#{$1}]" }
  417.       text.gsub!(/\\[Aa]\[([0-9]+)\]/)   { "\x06[#{$1}]" }
  418.       text.gsub!(/\\[Oo]\[([0-9]+)\]/)   { "\x07[#{$1}]" }
  419.       text.gsub!(/\\[Qq]/)               { "\x08" }
  420.       text.gsub!(/\\[Ff]\[([0-9]+)\]/)   { "\x09[#{$1}]" }
  421.       text.gsub!(/\\[Rr]\[([0-9]+)\]/)   { "\x10[#{$1}]" }
  422.       # c 获取 1 个字
  423.       c = text.slice!(/./m)
  424.       # 默认对话框采用默认颜色
  425.       self.contents.font.color = normal_color if $mes_id == nil
  426.       # 选择项的情况
  427.       if @dy >= $game_temp.choice_start
  428.         # 处理字的缩进
  429.         @dx = Fuki_v6_Setup::MES_FONT_SIZE
  430.         @dx += @face_width unless @show_right
  431.         @dx += Fuki_v6_Setup::MES_FONT_SIZE if @show_name
  432.         # 描绘文字
  433.         self.contents.draw_text(@dx, 24 * @dy, 24, 24, c)
  434.         # x 为要描绘文字宽度的加法运算
  435.         @dx += self.contents.text_size(c).width
  436.         # 循环
  437.         while ((c = text.slice!(/./m)) != "\n")
  438.           # 描绘文字
  439.           self.contents.draw_text(@dx, 24 * @dy, 24, 24, c)
  440.           # x 为要描绘文字宽度的加法运算
  441.           @dx += self.contents.text_size(c).width
  442.         end
  443.         if c == "\n"
  444.           # 更新光标宽度
  445.           @cursor_width = [@cursor_width, @dx - @face_width].max
  446.           # dy 累加 1
  447.           @dy += 1
  448.         end
  449.         return
  450.       end
  451.       case c
  452.       when "\x00"
  453.         c = "\\"            
  454.       when "\x01"                  
  455.         text.sub!(/\[([0-9]+)\]/, "")
  456.         color = $1.to_i
  457.         self.contents.font.color = text_color(color)
  458.       when "\x02"
  459.         @contents_showing_end = true
  460.         @contents_drawing = false
  461.         terminate_messageX
  462.         @save_x = @dx
  463.         @save_y = @dy
  464.       when "\x03"
  465.         text.sub!(/\[([0-9]+)\]/, "")
  466.         last_character
  467.         draw_icon($data_skills[$1.to_i], 4 + @dx, 24 * @dy)
  468.         @dx += self.contents.text_size("   ").width
  469.       when "\x04"
  470.         text.sub!(/\[([0-9]+)\]/, "")
  471.         last_character
  472.         draw_icon($data_items[$1.to_i], 4 + @dx, 24 * @dy)
  473.         @dx += self.contents.text_size("   ").width
  474.       when "\x05"
  475.         text.sub!(/\[([0-9]+)\]/, "")
  476.         last_character
  477.         draw_icon($data_weapons[$1.to_i], 4 + @dx, 24 * @dy)
  478.         @dx += self.contents.text_size("   ").width
  479.       when "\x06"
  480.         text.sub!(/\[([0-9]+)\]/, "")
  481.         last_character
  482.         draw_icon($data_armors[$1.to_i], 4 + @dx, 24 * @dy)
  483.         @dx += self.contents.text_size("   ").width
  484.       when "\x07"
  485.         text.sub!(/\[([0-9]+)\]/, "")
  486.         self.contents.font.color.alpha = $1.to_i
  487.       when "\x08"
  488.         text.sub!(/\[([0-9]+)\]/, "")
  489.         $play_voice = !$play_voice
  490.       when "\x09"
  491.         text.sub!(/\[([0-9]+)\]/, "")
  492.         self.contents.font.name = Fuki_v6_Setup::FONT_ARRAY[$1.to_i]
  493.       when "\x10"
  494.         text.sub!(/\[([0-9]+)\]/, "")
  495.         last_character
  496.         draw_actor_graphic($game_actors[$1.to_i], 4 + @dx, 24 * @dy)
  497.         @dx += self.contents.text_size("   ").width
  498.       when "\n"
  499.         @dy += 1
  500.         @dx = 0
  501.         @dx += @face_width unless @show_right
  502.         @dx += Fuki_v6_Setup::MES_FONT_SIZE if @show_name
  503.         last_character
  504.       else
  505.         last_character
  506.         size_zy = 6  # 设定文字动态增大幅度
  507.         if c != nil
  508.           self.contents.font.size = Fuki_v6_Setup::MES_FONT_SIZE
  509.           font_size = self.contents.font.size += size_zy
  510.           @old_text_info.push(@dx , @dy , font_size, self.contents.font.color.clone, c)
  511.           self.contents.draw_text(4 + @dx, (font_size + 4 - size_zy) * @dy - size_zy / 2, font_size, font_size, c)
  512.           self.contents.font.size -= size_zy
  513.           Audio.se_play("Audio/SE/Voice", 90, 100) if $play_voice and c != " "
  514.           @dx += self.contents.text_size(c).width
  515.         end
  516.       end
  517.     end
  518.   end
  519.   #--------------------------------------------------------------------------
  520.   # ○ 完成上一个字符的描绘
  521.   #--------------------------------------------------------------------------
  522.   def last_character
  523.     size_zy = 6  # 设定文字动态增大幅度
  524.     unless @old_text_info == []
  525.       self.contents.fill_rect (4 + @old_text_info[0], (@old_text_info[2]+ 4 - size_zy) * @old_text_info[1] - size_zy / 2, @old_text_info[2], @old_text_info[2], Color.new(0,0,0,0))
  526.       color = self.contents.font.color.clone
  527.       self.contents.font.color = @old_text_info[3].clone
  528.       self.contents.font.size = @old_text_info[2] -= size_zy
  529.       self.contents.draw_text(4 + @old_text_info[0], (@old_text_info[2] + 4) * @old_text_info[1], @old_text_info[2], @old_text_info[2], @old_text_info[4])
  530.       self.contents.font.color = color
  531.       @old_text_info = []
  532.     end
  533.   end
  534.   #--------------------------------------------------------------------------
  535.   # ○ 选择项和输入数值的情况下
  536.   #--------------------------------------------------------------------------
  537.   def draw_opt_text
  538.     # 选择项的情况下
  539.     if $game_temp.choice_max > 0
  540.       @item_max = $game_temp.choice_max
  541.       self.active = true
  542.       self.index = 0
  543.     end
  544.     # 输入数值的情况下
  545.     if $game_temp.num_input_variable_id > 0
  546.       digits_max = $game_temp.num_input_digits_max
  547.       number = $game_variables[$game_temp.num_input_variable_id]
  548.       @input_number_window = Window_InputNumber.new(digits_max)
  549.       @input_number_window.number = number
  550.       @input_number_window.x = self.x + @face_width + Fuki_v6_Setup::MES_FONT_SIZE + 8
  551.       @input_number_window.y = self.y + $game_temp.num_input_start * (Fuki_v6_Setup::MES_FONT_SIZE + 2)
  552.     end
  553.   end
  554.   #--------------------------------------------------------------------------
  555.   # ○ 生成背景图片
  556.   #--------------------------------------------------------------------------
  557.   def create_backbmp
  558.     @pic_skin.dispose if @pic_skin != nil
  559.     @pic_skin = Sprite.new
  560.     @pic_skin.opacity = 0 unless @no_term_stop
  561.     @pic_skin.bitmap = Bitmap.new(self.width + 32, self.height + 32)
  562.     @pic_skin.x = self.x + 2
  563.     @pic_skin.y = self.y + 2
  564.     @pic_skin.z = self.z
  565.     bitmap = RPG::Cache.windowskin(Fuki_v6_Setup::FUKI_SKIN_NAME)
  566.     rect = Rect.new(0, 0, 32, 32)
  567.     @pic_skin.bitmap.blt(0, 0, bitmap, rect)
  568.     rect = Rect.new(96, 0, 32, 32)
  569.     @pic_skin.bitmap.blt(self.width-32, 0, bitmap, rect)
  570.     rect = Rect.new(0, 96, 32, 32)
  571.     @pic_skin.bitmap.blt(0, self.height-32, bitmap, rect)
  572.     rect = Rect.new(96, 96, 32, 32)
  573.     @pic_skin.bitmap.blt(self.width-32, self.height-32, bitmap, rect)
  574.     rect = Rect.new(0, 32, 32, 32)
  575.     @pic_skin.bitmap.stretch_blt(Rect.new(0, 32, 32, self.height - 64), bitmap, rect)
  576.     rect = Rect.new(96, 32, 32, 32)
  577.     @pic_skin.bitmap.stretch_blt(Rect.new(self.width-32,32,32,self.height-64), bitmap, rect)
  578.     rect = Rect.new(32, 0, 32, 32)
  579.     @pic_skin.bitmap.stretch_blt(Rect.new(32,0,self.width-64,self.height-32), bitmap, rect)
  580.     # 如果尾巴在底端的话,更改底边描绘方式以修正阴影
  581.     if @message_position == 0 and @tale != nil
  582.       # 乱七八糟的三个计算变量
  583.       above_tale_x = @tale.x - self.x + 14
  584.       above_tale_width1 = @tale.x - self.x - 16 - 2
  585.       above_tale_width2 = self.width - above_tale_width1 - 32 - 64
  586.       # 中部(尾巴上方)
  587.       rect = Rect.new(32, 96, 32, 16)
  588.       @pic_skin.bitmap.stretch_blt(Rect.new(above_tale_x , self.height-32, 32, 24), bitmap, rect)
  589.       # 左半部
  590.       rect = Rect.new(32, 96, 32, 32)
  591.       @pic_skin.bitmap.stretch_blt(Rect.new(32, self.height-32, above_tale_width1, 32), bitmap, rect)
  592.       # 右半部
  593.       @pic_skin.bitmap.stretch_blt(Rect.new(32+above_tale_x, self.height-32, above_tale_width2, 32), bitmap, rect)
  594.       bitmap.dispose
  595.     else # 除此之外的情况保留原来的底边描绘方式
  596.       rect = Rect.new(32, 96, 32, 32)
  597.       @pic_skin.bitmap.stretch_blt(Rect.new(32,self.height-32,self.width-64,32), bitmap, rect)
  598.       bitmap.dispose
  599.     end
  600.   end
  601.   #--------------------------------------------------------------------------
  602.   # ○ 设置呼出对话框
  603.   #--------------------------------------------------------------------------
  604.   def set_fukidasi(x, y, width, height)
  605.     begin
  606.       self.pause = false # 不显示暂停标志
  607.       pos = get_fuki_pos(width, height) # 取得对话框位置
  608.       x = pos[0]
  609.       y = pos[1]
  610.       self.windowskin = RPG::Cache.windowskin($game_system.windowskin_name)
  611.       self.x = x
  612.       self.y = y
  613.       self.height = height
  614.       self.width = width
  615.       unless @no_term_stop
  616.         self.contents.dispose
  617.         self.contents = Bitmap.new(width - 32, height - 32)
  618.         self.back_opacity = Fuki_v6_Setup::FUKI_OPACITY
  619.         self.contents.clear
  620.         self.contents.font.color = Color.new(0, 0, 0, 255)
  621.         self.contents.font.size = Fuki_v6_Setup::MES_FONT_SIZE
  622.       end
  623.       if $game_system.message_frame == 0
  624.         tale_pos = get_tale_pos
  625.         @tale = Sprite.new
  626.         @tale.bitmap = Bitmap.new(64, 32)
  627.         if Fuki_v6_Setup::TAIL_SHOW
  628.           case @message_position
  629.           when 0  # 上
  630.             bitmap = RPG::Cache.windowskin(Fuki_v6_Setup::FUKI_SKIN_NAME)
  631.             rect = Rect.new(32, 32, 64, 32)
  632.             @tale.bitmap.blt(0, 0, bitmap, rect)
  633.             bitmap.dispose
  634.             @tale.x = tale_pos[0]
  635.             @tale.x += 8 if @tale.x < 64
  636.             if @tale.x > 640 - 64
  637.               @tale.mirror = true
  638.               @tale.x -= 64
  639.             end
  640.             @tale.y = tale_pos[1]
  641.             @tale.z = self.z + 1
  642.           when 1  # 中
  643.             @tale.dispose
  644.             @tale = nil
  645.           when 2  # 下
  646.             bitmap = RPG::Cache.windowskin(Fuki_v6_Setup::FUKI_SKIN_NAME)
  647.             rect = Rect.new(32, 64, 64, 32)
  648.             @tale.bitmap.blt(0, 0, bitmap, rect)
  649.             bitmap.dispose
  650.             @tale.x = tale_pos[0]
  651.             @tale.x += 8 if @tale.x < 64
  652.             if @tale.x > 640 - 64
  653.               @tale.mirror = true
  654.               @tale.x -= 64
  655.             end
  656.             @tale.y = tale_pos[1]
  657.             @tale.z = self.z# + 1
  658.           end
  659.         end
  660.       end
  661.     rescue
  662.       del_fukidasi
  663.       reset_window(width, height)
  664.     end
  665.   end
  666.   #--------------------------------------------------------------------------
  667.   # ○ 计算呼出对话框的位置
  668.   #--------------------------------------------------------------------------
  669.   def get_fuki_pos(width, height)
  670.     # 取得角色
  671.     @character = get_character($mes_id)
  672.     if @character == nil
  673.       # 角色不存在的情况下使用默认信息框
  674.       
  675.       del_fukidasi
  676.       reset_window(width, height)
  677.       return
  678.     end
  679.     # 处理坐标
  680.     x = (@character.real_x - $game_map.display_x + 64) * 32 / 128 - (width / 2)
  681.     # 为尽量显示在画面内而移动横坐标
  682.     if x + width > 640
  683.       x = 640 - width
  684.     elsif x < 0
  685.       x = 0
  686.     end
  687.     # 决定窗口位置
  688.     case $game_system.message_position
  689.     when 0  # 上
  690.       y = (@character.real_y - $game_map.display_y + 64) * 32 / 128 - height - Fuki_v6_Setup::CHARACTOR_HEIGHT + Fuki_v6_Setup::POP_SHIFT_TOP
  691.     when 1  # 中
  692.       x = (640 - width) / 2
  693.       y = (480 - height) / 2
  694.     when 2  # 下
  695.       y =  (@character.real_y - $game_map.display_y + 64) * 32 / 128 + 32 + Fuki_v6_Setup::POP_SHIFT_UNDER
  696.     end
  697.     # 纪录文章显示位置
  698.     @message_position = $game_system.message_position
  699.     if Fuki_v6_Setup::POS_FIX
  700.       case @message_position
  701.       when 0  # 上
  702.         if y <= 0
  703.           @message_position = 2
  704.           y =  (@character.real_y - $game_map.display_y + 64) * 32 / 128 + 32 + Fuki_v6_Setup::POP_SHIFT_UNDER
  705.         end
  706.       when 2  # 下
  707.         if y + height >= 480
  708.           @message_position = 0
  709.           y = (@character.real_y - $game_map.display_y + 64) * 32 / 128 - height - Fuki_v6_Setup::CHARACTOR_HEIGHT + Fuki_v6_Setup::POP_SHIFT_TOP
  710.         end
  711.       end
  712.     end
  713.     return [x, y]
  714.   end
  715.   #--------------------------------------------------------------------------
  716.   # ○ 计算尾部图标的位置
  717.   #--------------------------------------------------------------------------
  718.   def get_tale_pos
  719.     case @message_position
  720.     when 0  # 上
  721.       # 处理坐标
  722.       x = ( @character.real_x - $game_map.display_x + 64 ) * 32 / 128 - 8
  723.       y = self.y + self.height - 6
  724.     when 1  # 中
  725.       x = nil
  726.       y = nil
  727.     when 2  # 下
  728.       # 处理坐标
  729.       x = ( @character.real_x - $game_map.display_x + 64 ) * 32 / 128 - 8
  730.       y = self.y - 18
  731.     end
  732.     return [x, y]
  733.   end
  734.   #--------------------------------------------------------------------------
  735.   # ○ 设置角色半身像窗口
  736.   #--------------------------------------------------------------------------
  737.   def draw_msg_face
  738.     @face_sprite.dispose if @face_sprite != nil
  739.     # $mes_name为空时不显示
  740.     if $mes_name == nil or $mes_name == ""
  741.       return
  742.     else
  743.       # 设定变量
  744.       mes_name = $mes_name
  745.       if $game_temp.namebmp[mes_name] == nil
  746.         sFile = Fuki_v6_Setup::FACE_PIC_DIR + mes_name
  747.       else
  748.         sFile = Fuki_v6_Setup::FACE_PIC_DIR + $game_temp.namebmp[mes_name]
  749.       end
  750.       bitmap = Bitmap.new(sFile)
  751.       @pic_width = bitmap.width
  752.       @pic_height = bitmap.height
  753.       @face_sprite = Sprite.new
  754.       @face_sprite.x = self.x + 26
  755.       @face_sprite.x = self.x + self.width - @pic_width - 26 if @show_right
  756.       @face_sprite.y = self.y + self.height - @pic_height - 6
  757.       @face_sprite.bitmap = bitmap
  758.       @face_sprite.z = self.z + 3
  759.       @face_sprite.mirror = @show_right
  760.       @face_sprite.opacity = 0
  761.     end
  762.   end
  763.   #--------------------------------------------------------------------------
  764.   # ○ 释放呼出对话框
  765.   #--------------------------------------------------------------------------
  766.   def del_fukidasi
  767.     self.opacity = 0
  768.     self.x = 80
  769.     self.width = 480
  770.     self.height = 160
  771.     self.contents.dispose
  772.     self.contents = Bitmap.new(width - 32, height - 32)
  773.     self.pause = true
  774.     if @tale != nil
  775.       @tale.dispose
  776.       @tale = nil
  777.     end
  778.   end
  779.   #--------------------------------------------------------------------------
  780.   # ○ 取得角色
  781.   #     parameter : 参数
  782.   #--------------------------------------------------------------------------
  783.   def get_character(parameter)
  784.     # 参数分歧
  785.     case parameter
  786.     when nil
  787.       return events == nil
  788.     when -1  # 玩家
  789.       return $game_player
  790.     when 0   # 该事件
  791.       events = $game_map.events
  792.       # 循环 (地图事件)
  793.       for event in $game_map.events.values
  794.         # 如果找到了启动中的事件
  795.         if event.starting
  796.           @event_id = event.id
  797.         end
  798.       end
  799.       return events == nil ? nil : events[@event_id]
  800.     else     # 特定事件
  801.       events = $game_map.events
  802.       return events == nil ? nil : events[parameter]
  803.     end
  804.   end
  805.   #--------------------------------------------------------------------------
  806.   # ● 设定窗口位置和不透明度
  807.   #--------------------------------------------------------------------------
  808.   def reset_window(width = nil, height = nil)
  809.     if $game_temp.in_battle
  810.       self.y = 16
  811.     else
  812.       case $game_system.message_position
  813.       when 0  # 上
  814.         self.y = 16
  815.       when 1  # 中
  816.         if height != nil and width != nil
  817.           self.y = (480 - height) / 2 - 32
  818.           self.x = (640 - width) / 2
  819.           self.width = width
  820.           self.height = height
  821.           self.contents.dispose
  822.           self.contents = Bitmap.new(width - 32, height - 32)
  823.         else
  824.           self.y = 160
  825.         end
  826.       when 2  # 下
  827.         self.y = 304
  828.       end
  829.     end
  830.     self.opacity = 0
  831.     self.back_opacity = Fuki_v6_Setup::MES_OPACITY
  832.   end
  833.   #--------------------------------------------------------------------------
  834.   # ● 刷新画面
  835.   #--------------------------------------------------------------------------
  836.   def update
  837.     if $tale_need_dispose
  838.       del_fukidasi
  839.       $tale_need_dispose = false
  840.     end
  841.     super
  842.     update_fuki                 # 呼出模式下跟随事件移动
  843.     if @fade_in                 # 渐变的情况下
  844.       self.contents_opacity += 24
  845.       @pic_skin.opacity += 20
  846.       if @tale != nil
  847.         @face_sprite.opacity += 24 if @face_sprite != nil and !@face_sprite.disposed?
  848.         @tale.opacity += 20
  849.       end
  850.       @input_number_window.contents_opacity += 24 if @input_number_window != nil
  851.       @fade_in = false if self.contents_opacity == 255
  852.       return
  853.     end
  854.     if @contents_drawing        # 显示信息中的情况下
  855.       refresh_drawtext
  856.       return
  857.     end
  858.     update_input_number_window  # 输入数值的情况下
  859.     if @contents_showing_end    # 显示信息结束的情况下
  860.       if $game_temp.choice_max == 0 and @tale == nil
  861.         self.pause = true
  862.       else
  863.         self.pause = false
  864.       end
  865.       update_choose
  866.       return
  867.     end
  868.     if @fade_out == false and $game_temp.message_text != nil # 在渐变以外的状态下
  869.       @contents_showing = true
  870.       $game_temp.message_window_showing = true
  871.       reset_window
  872.       refresh_create
  873.       if @no_term_stop
  874.         self.visible = true        
  875.       else
  876.         @tale.opacity = 0 if @tale != nil
  877.         Graphics.frame_reset
  878.         self.visible = true
  879.         self.contents_opacity = 0
  880.         @input_number_window.contents_opacity = 0 if @input_number_window != nil
  881.         @fade_in = true
  882.       end
  883.       return
  884.     end
  885.     unless @no_term_stop # 没有可以显示的信息、但是窗口为可见的情况下
  886.       if self.visible
  887.         @fade_out = true
  888.         self.opacity -= 48
  889.         @face_sprite.opacity -= 48 if @face_sprite != nil and !@face_sprite.disposed?
  890.         @pic_skin.opacity -= 48 if @pic_skin != nil and !@pic_skin.disposed?
  891.         @tale.opacity -= 48 if @tale != nil and [email protected]?
  892.         if (@face_sprite == nil) or @face_sprite.disposed? or (@face_sprite.opacity == 0)
  893.           self.visible = false
  894.           @face_sprite.dispose if @face_sprite != nil
  895.           @pic_skin.dispose
  896.           @fade_out = false
  897.           $game_temp.message_window_showing = false
  898.         end
  899.         return
  900.       end
  901.     else
  902.       $game_temp.message_window_showing = false   
  903.     end
  904.   end
  905.   #--------------------------------------------------------------------------
  906.   # ● 释放
  907.   #--------------------------------------------------------------------------
  908.   def dispose
  909.     terminate_message
  910.     $game_temp.message_window_showing = false
  911.     @input_number_window.dispose if @input_number_window != nil
  912.     super
  913.   end
  914.   #--------------------------------------------------------------------------
  915.   # ● 信息结束处理
  916.   #--------------------------------------------------------------------------
  917.   def terminate_message
  918.     self.active = false
  919.     self.pause = false
  920.     self.index = -1
  921.     self.contents.clear
  922.     # 清除显示中标志
  923.     @contents_showing = false
  924.     @contents_showing_end = false
  925.     $mes_name = ""
  926.     # 呼叫信息调用
  927.     $game_temp.message_proc.call if $game_temp.message_proc != nil
  928.     # 清除文章、选择项、输入数值的相关变量
  929.     $game_temp.message_text = nil
  930.     $game_temp.message_proc = nil
  931.     $game_temp.choice_start = 99
  932.     $game_temp.choice_max = 0
  933.     $game_temp.choice_cancel_type = 0
  934.     $game_temp.choice_proc = nil
  935.     $game_temp.num_input_start = 99
  936.     $game_temp.num_input_variable_id = 0
  937.     $game_temp.num_input_digits_max = 0
  938.     # 释放金钱窗口
  939.     if @gold_window != nil
  940.       @gold_window.dispose
  941.       @gold_window = nil
  942.     end
  943.     @no_term_stop = false
  944.     @save_x = 0
  945.     @save_y = 0
  946.     @show_right = false
  947.     @show_name  = false
  948.     @face_width = 0
  949.     $tale_need_dispose = true if @tale != nil
  950.   end
  951.   #--------------------------------------------------------------------------
  952.   # ● ★信息结束处理★
  953.   #--------------------------------------------------------------------------
  954.   def terminate_messageX
  955.     self.active = false
  956.     self.pause = false
  957.     self.index = -1
  958.     # 清除显示中标志
  959.     @contents_showing = false
  960.     @contents_showing_end = false
  961.     # 呼叫信息调用
  962.     $game_temp.message_proc.call if $game_temp.message_proc != nil
  963.     # 清除文章、选择项、输入数值的相关变量
  964.     $game_temp.message_text = nil
  965.     $game_temp.message_proc = nil
  966.     @no_term_stop = true
  967.     @show_right = false
  968.     @show_name  = false
  969.     @face_width = 0
  970.   end
  971.   #--------------------------------------------------------------------------
  972.   # ● 刷新光标矩形
  973.   #--------------------------------------------------------------------------
  974.   def update_cursor_rect
  975.     if @index >= 0
  976.       n = $game_temp.choice_start + @index
  977.       self.cursor_rect.set(Fuki_v6_Setup::MES_FONT_SIZE / 2, n * (Fuki_v6_Setup::MES_FONT_SIZE + 4), @cursor_width, Fuki_v6_Setup::MES_FONT_SIZE + 4)
  978.       self.cursor_rect.x += @face_width unless @show_right
  979.       self.cursor_rect.x += Fuki_v6_Setup::MES_FONT_SIZE / 2 if @show_name
  980.     else
  981.       self.cursor_rect.empty
  982.     end
  983.   end
  984.   #--------------------------------------------------------------------------
  985.   # ● 获取文字颜色色
  986.   #     n : 文字颜色编号 (0~31)
  987.   #--------------------------------------------------------------------------
  988.   def text_color(n)
  989.     return normal_color if n > 31
  990.     x = (n % 8) * 16
  991.     y = 128 + (n / 8) * 16
  992.     return RPG::Cache.windowskin(Fuki_v6_Setup::FUKI_SKIN_NAME).get_pixel(x, y)
  993.   end
  994.   #--------------------------------------------------------------------------
  995.   # ● 取得普通文字色
  996.   #--------------------------------------------------------------------------
  997.   def normal_color
  998.     nil_color = Color.new(0,0,0,255)
  999.     return Fuki_v6_Setup::FUKI_COLOR if Fuki_v6_Setup::FUKI_COLOR != nil_color
  1000.     return nil_color
  1001.   end
  1002.   #--------------------------------------------------------------------------
  1003.   # ● 获取头像宽度
  1004.   #--------------------------------------------------------------------------
  1005.   def get_face_width(face_name)
  1006.     return if $mes_name == ""
  1007.     filename = Fuki_v6_Setup::FACE_PIC_DIR + face_name
  1008.     bitmap = Bitmap.new(filename)
  1009.     @face_width = bitmap.width + Fuki_v6_Setup::MES_FONT_SIZE
  1010.     bitmap.dispose
  1011.   end
  1012.   #--------------------------------------------------------------------------
  1013.   # ● 描绘物品
  1014.   #     item : 物品
  1015.   #--------------------------------------------------------------------------
  1016.   def draw_icon(item, x, y)
  1017.     return if item == nil
  1018.     bitmap = RPG::Cache.icon(item.icon_name)
  1019.     self.contents.blt(x + 4, y, bitmap, Rect.new(0, 0, 24, 24))
  1020.     color = self.contents.font.color.clone
  1021.     self.contents.font.color = text_color(1)
  1022.     self.contents.draw_text(x + 28, y, self.contents.text_size(item.name).width + 5, 24, item.name)
  1023.     self.contents.font.color = color
  1024.     @dx += self.contents.text_size(item.name).width
  1025.   end
  1026.   #--------------------------------------------------------------------------
  1027.   # ● 图形的描绘
  1028.   #     actor : 角色
  1029.   #     x     : 描画目标 X 坐标
  1030.   #     y     : 描画目标 Y 坐标
  1031.   #--------------------------------------------------------------------------
  1032.   def draw_actor_graphic(actor, x, y)
  1033.     bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
  1034.     cw = bitmap.width / 4
  1035.     ch = bitmap.height / 4
  1036.     src_rect = Rect.new(0, 0, cw, ch)
  1037.     self.contents.blt(x, y - 4, bitmap, src_rect)
  1038.     color = self.contents.font.color.clone
  1039.     self.contents.font.color = text_color(1)
  1040.     self.contents.draw_text(x + 32, y, self.contents.text_size(actor.name).width + 5, 24, actor.name)
  1041.     self.contents.font.color = color
  1042.     @dx += self.contents.text_size(actor.name).width
  1043.   end
  1044.   #--------------------------------------------------------------------------
  1045.   # ● 刷新呼出对话框
  1046.   #--------------------------------------------------------------------------
  1047.   def update_fuki
  1048.     if @tale != nil
  1049.       pos = get_fuki_pos(self.width, self.height)
  1050.       self.x = pos[0]
  1051.       self.y = pos[1]
  1052.       tale_pos = get_tale_pos
  1053.       @tale.mirror = false
  1054.       @tale.x = tale_pos[0]
  1055.       @tale.x += 8 if @tale.x < 64
  1056.       if @tale.x > 640 - 64
  1057.         @tale.mirror = true
  1058.         @tale.x -= 64
  1059.       end
  1060.       @tale.y = tale_pos[1]
  1061.       @pic_skin.x = self.x + 2
  1062.       @pic_skin.y = self.y + 2
  1063.       if @face_sprite != nil and !@face_sprite.disposed?
  1064.         @face_sprite.x = self.x + 26
  1065.         @face_sprite.x = self.x + self.width - @pic_width - 26 if @show_right
  1066.         @face_sprite.y = self.y + self.height - @pic_height - 6
  1067.       end
  1068.     end
  1069.   end
  1070.   #--------------------------------------------------------------------------
  1071.   # ● 刷新数字输入框
  1072.   #--------------------------------------------------------------------------
  1073.   def update_input_number_window
  1074.     if @input_number_window != nil
  1075.       @input_number_window.update
  1076.       # 确定
  1077.       if Input.trigger?(Input::C)
  1078.         $game_system.se_play($data_system.decision_se)
  1079.         $game_variables[$game_temp.num_input_variable_id] = @input_number_window.number
  1080.         # 释放输入数值窗口
  1081.         @input_number_window.dispose
  1082.         @input_number_window = nil
  1083.         $game_map.need_refresh = true
  1084.         terminate_message
  1085.       end
  1086.       return
  1087.     end
  1088.   end
  1089.   #--------------------------------------------------------------------------
  1090.   # ● 刷新选择输入
  1091.   #--------------------------------------------------------------------------
  1092.   def update_choose
  1093.     if Input.trigger?(Input::B)
  1094.       if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0
  1095.         $game_system.se_play($data_system.cancel_se)
  1096.         $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)
  1097.         terminate_message
  1098.       end
  1099.     end
  1100.     if Input.trigger?(Input::C)
  1101.       if $game_temp.choice_max > 0
  1102.         $game_system.se_play($data_system.decision_se)
  1103.         $game_temp.choice_proc.call(self.index)
  1104.       end
  1105.       terminate_message
  1106.     end
  1107.   end
  1108. end
复制代码
配套的Window.png(放入Graphics\Windowskins)


范例:
Fuki对话框优化版 v6.zip (270.79 KB, 下载次数: 7420)

评分

参与人数 3星屑 +1114 梦石 +2 收起 理由
yanzheng868 + 14
eve592370698 + 900 尽我所能给分吧
Shy07 + 200 + 2 给糖

查看全部评分

Lv1.梦旅人

梦石
0
星屑
50
在线时间
556 小时
注册时间
2010-11-18
帖子
774
发表于 2011-11-24 13:22:43 | 显示全部楼层
出问题啦 不是自动执行的时候 头像就不显示啦!!!

评分

参与人数 1星屑 +122 收起 理由
各种压力的猫君 + 122 感谢反馈,已修正。

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
34 小时
注册时间
2011-11-12
帖子
12
发表于 2011-11-26 12:44:43 | 显示全部楼层
本帖最后由 pwh2132 于 2011-11-26 12:49 编辑

这个脚本改变框体透明度的设置好像没用啊 ,还有没法用去框体的效果。。。。
还有不解的$mes_id = nil  写在文章的上面好像没用啊。。。。
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
650
在线时间
217 小时
注册时间
2011-1-26
帖子
690
发表于 2011-11-26 13:45:54 | 显示全部楼层
为什么下了Windous文件还是没窗口
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
432
在线时间
4175 小时
注册时间
2010-6-26
帖子
6474
发表于 2011-12-18 21:33:36 | 显示全部楼层
本帖最后由 eve592370698 于 2011-12-18 22:20 编辑
pwh2132 发表于 2011-11-26 12:44
这个脚本改变框体透明度的设置好像没用啊 ,还有没法用去框体的效果。。。。
还有不解的$mes_id = nil  写 ...


如果显示文章选项为“窗口显示”“不显示”
就悲剧了,目前修补进度65%。需要把附件那个图片保存到\Graphics\Windowskins文件夹下面并命名为"VX-暗"

下面请看代码
  1. #==============================================================================
  2. #    Fuki对话框优化版 v6
  3. #    原版作者:by パラ犬(日)
  4. #    汉化修正:by 66RPG.com
  5. #------------------------------------------------------------------------------
  6. #    2006年01月 汉化修改 by bbschat
  7. #    2007年02月 脚本更新 by KKME
  8. #    2007年07月 脚本更新 by 绫晓露雪萌
  9. #    2010年05月 脚本优化 by Linki Shy
  10. #    2011年10月 阴影修正 by 各种压力的猫君
  11. #    2011年11月 脚本增强 by 各种压力的猫君
  12. #==============================================================================
  13. #
  14. # 【脚本功能】
  15. #
  16. #   1. 此脚本主要是解决了在1.03版XP上的方块问题,以及增加了一些功能
  17. #
  18. #   2. 人名美化使用方法与以前一样
  19. #
  20. #   3. 默认人物头像在左边显示
  21. #      如果需要右边显示,在输入的名称之后加"@r"即可
  22. #      例: "阿尔西斯@r:"(注意必须小写)
  23. #
  24. #   4. 在对话中更改字体的方法:
  25. #       \f[X]:更改字号为X
  26. #
  27. #   5. 在对话中显示(技能 物品 武器 防具 人物)图标和名称的方法:
  28. #       \s[X]: 显示第X号技能图标和名称
  29. #       \i[X]: 显示第X号物品图标和名称
  30. #       \w[X]: 显示第X号武器图标和名称
  31. #       \a[X]: 显示第X号防具图标和名称
  32. #       \r[X]: 显示第X号人物图标和名称
  33. #
  34. #   6. 在对话中更改文字不透明度的方法:
  35. #       \o[X]: 把文字不透明度更改为X (取值范围为0~255)
  36. #   
  37. #   7. 在对话中关闭或开启拟声音效的方法:
  38. #       \q:默认开启时,执行一次关闭,再执行一次则开启
  39. #
  40. #   8. 如果需要自定义字体颜色,
  41. #       可以打开"Graphics/Windowskins"目录下的"Window.png"文件查看
  42. #       使用方法与VX类似
  43. #
  44. #   9. 追加了不为瞬间显示时确定键快速显示的功能
  45. #
  46. #  10. $mes_id = 0          代表本事件
  47. #      $mes_id = -1         代表主角
  48. #      $mes_id = 其他数值   代表事件编号
  49. #      $mes_id = nil        代表不使用fuki形式
  50. #
  51. #
  52. # 【素材要求】
  53. #
  54. #   1. 要求所有半身像朝向一致(默认是正面偏右)
  55. #
  56. #==============================================================================

  57. #==============================================================================
  58. # ■ Fuki_v6_Setup
  59. #------------------------------------------------------------------------------
  60. #    Fuki对话框优化版 v6 参数设置
  61. #==============================================================================

  62. module Fuki_v6_Setup
  63.    
  64.   #--------------------------------------------------------------------------
  65.   # ● 外观
  66.   #--------------------------------------------------------------------------
  67.   
  68.     # 窗口透明度
  69.     FUKI_OPACITY = 255         # 呼出对话框
  70.     MES_OPACITY  = 160         # 默认信息窗口
  71.    
  72.     # 角色高度尺寸
  73.     CHARACTOR_HEIGHT = 50
  74.    
  75.     # 呼出对话框的相对位置(纵坐标)
  76.     POP_SHIFT_TOP = 0          # 表示位置为上的时候
  77.     POP_SHIFT_UNDER = -4       # 表示位置为下的时候
  78.    
  79.     # 信息的表示速度(数字越小速度越快,0为瞬间表示)
  80.     # 游戏中可以随时用数字代入 $MES_SPEED 来改变消息表示速度。
  81.     MES_SPEED = 1
  82.    
  83.     # 名称修饰符(一对)(此处参考 沉影不器 的VX版对话框加强)
  84.     NAME_SYMBOL = "【】"
  85.    
  86.     # 名称颜色
  87.     NAME_COLOR = 7
  88.   
  89.   #--------------------------------------------------------------------------
  90.   # ● 功能( true / false )
  91.   #--------------------------------------------------------------------------
  92.    
  93.     # 是否显示尾巴
  94.     TAIL_SHOW = true
  95.    
  96.     # 是否播放打字音效
  97.     $play_voice = true
  98.    
  99.     # $MES_SPEED不为0时,是否可以用确定键快速显示对话
  100.     ENABLE_SKIP = true

  101.     # 窗口表示时是否根据画面大小自动改变窗口出现的位置
  102.     POS_FIX = true
  103.    
  104.   #--------------------------------------------------------------------------
  105.   # ● 字体
  106.   #--------------------------------------------------------------------------
  107.   
  108.     # 预设字体组
  109.     FONT_ARRAY = ["黑体", "宋体", "仿宋"]
  110.    
  111.     # 默认字号【已知BUG,当默认字号不为20时会导致各种奇怪问题……暂未修正】
  112.     MES_FONT_SIZE = 20
  113.    
  114.     # 默认文字动态增大幅度
  115.     SIZE_ZY = 6
  116.    
  117.     # 默认字体颜色
  118.     FUKI_COLOR = Color.new(0, 0, 0, 255)
  119.     SHADOW_COLOR = Color.new(255, 255, 255, 255)
  120.   
  121.   #--------------------------------------------------------------------------
  122.   # ● 目录
  123.   #--------------------------------------------------------------------------
  124.   
  125.     # 呼出对话框用Skin名称(自动在 Graphics\Windowskins 内搜索)
  126.     FUKI_SKIN_NAME = "Window"
  127.    
  128.     # 设定头像图片保存目录
  129.     FACE_PIC_DIR = "Graphics/Faces/"

  130.   #--------------------------------------------------------------------------
  131.   # ● 头像对应表
  132.   #--------------------------------------------------------------------------
  133.   #    如果不想使用角色名字直接作为头像文件名
  134.   #    可在这里重新设定角色名字与文件名的对应关系
  135.   #
  136.   #  (这功能怎么用我自己也没搞明白……大家无视吧 by 各种压力的猫君)
  137.   #--------------------------------------------------------------------------
  138.   
  139.     NAME_TABLE = {"玩家"=>"维斯特"}
  140.    
  141. end
  142. #==============================================================================
  143.   
  144. "┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓"
  145. "┃        自定义内容到此结束,以下内容切勿随意修改        ┃"
  146. "┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛"

  147. #==============================================================================
  148. # ● 初始化全局变量并定义chat方法
  149. #==============================================================================
  150. $mes_id   = nil
  151. $mes_name = ""
  152. def chat(id = nil,name = "")
  153.   $mes_id = id
  154.   $mes_name = name
  155. end

  156. #==============================================================================
  157. # ■ Game_Temp
  158. #==============================================================================

  159. class Game_Temp
  160.   #--------------------------------------------------------------------------
  161.   # ● 定义实例变量
  162.   #--------------------------------------------------------------------------
  163.   attr_accessor:namebmp      # 记录角色名字和头像文件名对应关系
  164.   #--------------------------------------------------------------------------
  165.   # ● 初始化对像
  166.   #--------------------------------------------------------------------------
  167.   alias initialize_fuki initialize
  168.   def initialize
  169.     initialize_fuki
  170.     @namebmp = Fuki_v6_Setup::NAME_TABLE
  171.   end
  172. end

  173. #==============================================================================
  174. # ■ Window_InputNumber
  175. #==============================================================================

  176. class Window_InputNumber < Window_Base
  177.   #--------------------------------------------------------------------------
  178.   # ● 初始化对像
  179.   #     digits_max : 位数
  180.   #--------------------------------------------------------------------------
  181.   def initialize(digits_max)
  182.     @digits_max = digits_max
  183.     @number = 0
  184.     # 从数字的幅度计算(假定与 0~9 等幅)光标的幅度
  185.     dummy_bitmap = Bitmap.new(Fuki_v6_Setup::MES_FONT_SIZE, Fuki_v6_Setup::MES_FONT_SIZE)
  186.     @cursor_width = dummy_bitmap.text_size("0").width + 8
  187.     dummy_bitmap.dispose
  188.     super(0, 0, @cursor_width * @digits_max + 32, 64)
  189.     self.contents = Bitmap.new(width - 32, height - 32)
  190.     self.contents.font.size = Fuki_v6_Setup::MES_FONT_SIZE
  191.     self.contents.font.color = Fuki_v6_Setup::FUKI_COLOR
  192.     self.z += 9999
  193.     self.opacity = 0
  194.     @index = 0
  195.     refresh
  196.     update_cursor_rect
  197.   end
  198.   #--------------------------------------------------------------------------
  199.   # ● 更新光标矩形
  200.   #--------------------------------------------------------------------------
  201.   def update_cursor_rect
  202.     self.cursor_rect.set(@index * @cursor_width-4, 0, @cursor_width, Fuki_v6_Setup::MES_FONT_SIZE + 4)
  203.   end
  204.   #--------------------------------------------------------------------------
  205.   # ● 刷新
  206.   #--------------------------------------------------------------------------
  207.   def refresh
  208.     self.contents.clear
  209.     s = sprintf("%0*d", @digits_max, @number)
  210.     for i in 0...@digits_max
  211.       self.contents.draw_text(i * @cursor_width, 0, 24, Fuki_v6_Setup::MES_FONT_SIZE + 4, s[i,1])
  212.     end
  213.   end
  214. end

  215. #==============================================================================
  216. # ■ Window_Message
  217. #==============================================================================

  218. class Window_Message < Window_Selectable
  219.   
  220.   #--------------------------------------------------------------------------
  221.   # ● 初始化状态
  222.   #--------------------------------------------------------------------------
  223.   def initialize
  224.     super(80, 304, 480, 160)
  225.     self.contents = Bitmap.new(width - 32, height - 32)
  226.     self.contents.font.size = Fuki_v6_Setup::MES_FONT_SIZE
  227.     self.contents.font.color = text_color(0)
  228.     self.visible = false
  229.     self.z = 9998
  230.     @fade_in = false
  231.     @fade_out = false
  232.     @contents_showing = false
  233.     @cursor_width = 0
  234.     self.active = false
  235.     self.index = -1
  236.     @w = 0
  237.     @h = 0
  238.     @wait = 0
  239.     @dx = 0
  240.     @dy = 0
  241.     $MES_SPEED = Fuki_v6_Setup::MES_SPEED
  242.     #------------------------
  243.     # ★ 特殊时期中断标志
  244.     #------------------------
  245.     @no_term_stop = false
  246.     @save_x = 0
  247.     @save_y = 0
  248.     @old_text_info = []
  249.     @show_right = false
  250.     @show_name  = false
  251.     @face_width = 0
  252.   end
  253.   #--------------------------------------------------------------------------
  254.   # ○ 决定窗口尺寸并生成窗口
  255.   #--------------------------------------------------------------------------
  256.   def refresh_create
  257.     unless @no_term_stop
  258.       @pic_skin.dispose if @pic_skin != nil
  259.       if $game_temp.message_text.include?(":")
  260.         if $game_temp.message_text.include?("@r")
  261.           @show_right = true
  262.           $game_temp.message_text.sub!(/\@r/, "")
  263.         end
  264.         @show_name = true
  265.         # 添加名称修饰符
  266.         unless Fuki_v6_Setup::NAME_SYMBOL.empty?
  267.           $game_temp.message_text = '\c[' + Fuki_v6_Setup::NAME_COLOR.to_s + ']' + Fuki_v6_Setup::NAME_SYMBOL[0,Fuki_v6_Setup::NAME_SYMBOL.size/2] + $game_temp.message_text
  268.           $game_temp.message_text.sub!(/\:/, Fuki_v6_Setup::NAME_SYMBOL[Fuki_v6_Setup::NAME_SYMBOL.size/2,Fuki_v6_Setup::NAME_SYMBOL.size/2] + '\c[0]')
  269.         end
  270.       end
  271.       self.contents.clear
  272.       self.contents.font.color = normal_color
  273.       # 取得窗口尺寸
  274.       get_windowsize
  275.       w = @w + 40
  276.       h = (@h ) * (self.contents.font.size + 4 ) + 29
  277.       h = 64 if h < 64
  278.       set_fukidasi(self.x, self.y, w, h)
  279.       # 生成呼出窗口
  280.       draw_msg_face
  281.       create_backbmp
  282.     end
  283.     # 初始化信息表示使用的变量
  284.     @dx = @save_x
  285.     @dx += @face_width unless @show_right
  286.     @dy = @save_y
  287.     @cursor_width = 0
  288.     @contents_drawing = true
  289.     # 瞬间表示的情况下
  290.     if $MES_SPEED == 0
  291.       # 循环信息描绘处理
  292.       while $game_temp.message_text != ""
  293.         draw_massage
  294.       end
  295.       draw_opt_text
  296.       @contents_showing_end = true
  297.       @contents_drawing = false
  298.     else
  299.       # 一个一个描绘文字
  300.       refresh_drawtext
  301.     end
  302.   end
  303.   #--------------------------------------------------------------------------
  304.   # ○ 一个一个描绘文字
  305.   #--------------------------------------------------------------------------
  306.   def refresh_drawtext
  307.     # 当按下确定键的时候直接显示剩余的全部文字
  308.     if Input.trigger?(Input::C) and Fuki_v6_Setup::ENABLE_SKIP
  309.       # 循环信息描绘处理
  310.       while $game_temp.message_text != ""
  311.         draw_massage
  312.       end
  313.       draw_opt_text
  314.       @contents_showing_end = true
  315.       @contents_drawing = false
  316.     elsif $game_temp.message_text != ""
  317.       if @wait > 0
  318.         @wait -= 1
  319.       elsif @wait == 0
  320.         # 描绘处理
  321.         draw_massage
  322.         @wait = $MES_SPEED
  323.       end
  324.     else
  325.       draw_opt_text
  326.       @contents_showing_end = true
  327.       @contents_drawing = false
  328.     end
  329.   end
  330.   #--------------------------------------------------------------------------
  331.   # ○ 取得窗口尺寸
  332.   #--------------------------------------------------------------------------
  333.   def get_windowsize
  334.     get_face_width($mes_name)
  335.     x = y = 0
  336.     @h = @w = 0
  337.     @cursor_width = 0
  338.     # 有选择项的话,处理字的缩进
  339.     if $game_temp.choice_start == 0
  340.       x = 16
  341.     end
  342.     # 有等待显示的文字的情况下
  343.     if $game_temp.message_text != nil
  344.     text = $game_temp.message_text.clone
  345.       # 限制文字处理
  346.       begin
  347.         last_text = text.clone
  348.         text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
  349.       end until text == last_text
  350.       text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  351.         $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  352.       end
  353.       text.gsub!(/\\\\/)                 { "\x00" }
  354.       text.gsub!(/\\[Cc]\[([0-9]+)\]/)   { "\x01" }
  355.       text.gsub!(/\\[Gg]/)               { "\x02" }
  356.       text.gsub!(/\\[Ss]\[([0-9]+)\]/)   { "\x03" + $data_skills[$1.to_i].name }
  357.       text.gsub!(/\\[Ii]\[([0-9]+)\]/)   { "\x04" + $data_items[$1.to_i].name }
  358.       text.gsub!(/\\[Ww]\[([0-9]+)\]/)   { "\x05" + $data_weapons[$1.to_i].name }
  359.       text.gsub!(/\\[Aa]\[([0-9]+)\]/)   { "\x06" + $data_armors[$1.to_i].name }
  360.       text.gsub!(/\\[Rr]\[([0-9]+)\]/)   { "\x10" + $game_actors[$1.to_i].name }
  361.       # c 获取 1 个字 (如果不能取得文字就循环)
  362.       while ((c = text.slice!(/./m)) != nil)
  363.         if c == "\x00"
  364.           c = "\\"
  365.         end
  366.         if c == "\x01" or c == "\x02"
  367.           next
  368.         end
  369.         if c == "\x03" or c == "\x04" or c == "\x05" or c == "\x06" or c == "\x010"
  370.           c = "   "
  371.         end
  372.         if c == "\n"
  373.           # y 累加 1
  374.           y += 1
  375.           # 取得纵横尺寸
  376.           @h = y
  377.           @w = x > @w ? x : @w
  378.           if y >= $game_temp.choice_start
  379.             @w = x + Fuki_v6_Setup::MES_FONT_SIZE > @w ? x + Fuki_v6_Setup::MES_FONT_SIZE : @w
  380.           end
  381.           x = 0
  382.           x = Fuki_v6_Setup::MES_FONT_SIZE if y >= $game_temp.choice_start
  383.           # 下面的文字
  384.           next
  385.         end
  386.         # x 为要描绘文字的宽度加法运算
  387.         x += self.contents.text_size(c).width
  388.       end
  389.     end
  390.     # 输入数值的情况
  391.     if $game_temp.num_input_variable_id > 0
  392.       digits_max = $game_temp.num_input_digits_max
  393.       number = $game_variables[$game_temp.num_input_variable_id]
  394.       @h += 1
  395.       x = digits_max * self.contents.font.size + 16
  396.       @w = x > @w ? x : @w
  397.     end
  398.     @w += @face_width
  399.     @w = 128 if @w < 128
  400.   end
  401.   #--------------------------------------------------------------------------
  402.   # ○ 描绘信息处理
  403.   #--------------------------------------------------------------------------
  404.   def draw_massage
  405.     # 有等待显示的文字的情况下
  406.     if $game_temp.message_text != nil or @old_text_info != nil
  407.       text = $game_temp.message_text
  408.       # 限制文字处理
  409.       begin
  410.         last_text = text.clone
  411.         text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
  412.       end until text == last_text
  413.       text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  414.         $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  415.       end
  416.       text.gsub!(/\\\\/)                 { "\x00" }
  417.       text.gsub!(/\\[Cc]\[([0-9]+)\]/)   { "\x01[#{$1}]" }
  418.       text.gsub!(/\\[Gg]/)               { "\x02" }
  419.       text.gsub!(/\\[Ss]\[([0-9]+)\]/)   { "\x03[#{$1}]" }
  420.       text.gsub!(/\\[Ii]\[([0-9]+)\]/)   { "\x04[#{$1}]" }
  421.       text.gsub!(/\\[Ww]\[([0-9]+)\]/)   { "\x05[#{$1}]" }
  422.       text.gsub!(/\\[Aa]\[([0-9]+)\]/)   { "\x06[#{$1}]" }
  423.       text.gsub!(/\\[Oo]\[([0-9]+)\]/)   { "\x07[#{$1}]" }
  424.       text.gsub!(/\\[Qq]/)               { "\x08" }
  425.       text.gsub!(/\\[Ff]\[([0-9]+)\]/)   { "\x09[#{$1}]" }
  426.       text.gsub!(/\\[Rr]\[([0-9]+)\]/)   { "\x10[#{$1}]" }
  427.       # c 获取 1 个字
  428.       c = text.slice!(/./m)
  429.       # 默认对话框采用默认颜色
  430.       self.contents.font.color = normal_color if $mes_id == nil
  431.       # 选择项的情况
  432.       if @dy >= $game_temp.choice_start
  433.         # 处理字的缩进
  434.         @dx = Fuki_v6_Setup::MES_FONT_SIZE
  435.         @dx += @face_width unless @show_right
  436.         @dx += Fuki_v6_Setup::MES_FONT_SIZE if @show_name
  437.         # 描绘文字
  438.         self.contents.draw_text(@dx, 24 * @dy, 24, 24, c)
  439.         # x 为要描绘文字宽度的加法运算
  440.         @dx += self.contents.text_size(c).width
  441.         # 循环
  442.         while ((c = text.slice!(/./m)) != "\n")
  443.           # 描绘文字
  444.           self.contents.draw_text(@dx, 24 * @dy, 24, 24, c)
  445.           # x 为要描绘文字宽度的加法运算
  446.           @dx += self.contents.text_size(c).width
  447.         end
  448.         if c == "\n"
  449.           # 更新光标宽度
  450.           @cursor_width = [@cursor_width, @dx - @face_width].max
  451.           # dy 累加 1
  452.           @dy += 1
  453.         end
  454.         return
  455.       end
  456.       case c
  457.       when "\x00"
  458.         c = "\\"            
  459.       when "\x01"                  
  460.         text.sub!(/\[([0-9]+)\]/, "")
  461.         color = $1.to_i
  462.         self.contents.font.color = text_color(color)
  463.       when "\x02"
  464.         @contents_showing_end = true
  465.         @contents_drawing = false
  466.         terminate_messageX
  467.         @save_x = @dx
  468.         @save_y = @dy
  469.       when "\x03"
  470.         text.sub!(/\[([0-9]+)\]/, "")
  471.         last_character
  472.         draw_icon($data_skills[$1.to_i], 4 + @dx, 24 * @dy)
  473.         @dx += self.contents.text_size("   ").width
  474.       when "\x04"
  475.         text.sub!(/\[([0-9]+)\]/, "")
  476.         last_character
  477.         draw_icon($data_items[$1.to_i], 4 + @dx, 24 * @dy)
  478.         @dx += self.contents.text_size("   ").width
  479.       when "\x05"
  480.         text.sub!(/\[([0-9]+)\]/, "")
  481.         last_character
  482.         draw_icon($data_weapons[$1.to_i], 4 + @dx, 24 * @dy)
  483.         @dx += self.contents.text_size("   ").width
  484.       when "\x06"
  485.         text.sub!(/\[([0-9]+)\]/, "")
  486.         last_character
  487.         draw_icon($data_armors[$1.to_i], 4 + @dx, 24 * @dy)
  488.         @dx += self.contents.text_size("   ").width
  489.       when "\x07"
  490.         text.sub!(/\[([0-9]+)\]/, "")
  491.         self.contents.font.color.alpha = $1.to_i
  492.       when "\x08"
  493.         text.sub!(/\[([0-9]+)\]/, "")
  494.         $play_voice = !$play_voice
  495.       when "\x09"
  496.         text.sub!(/\[([0-9]+)\]/, "")
  497.         self.contents.font.name = Fuki_v6_Setup::FONT_ARRAY[$1.to_i]
  498.       when "\x10"
  499.         text.sub!(/\[([0-9]+)\]/, "")
  500.         last_character
  501.         draw_actor_graphic($game_actors[$1.to_i], 4 + @dx, 24 * @dy)
  502.         @dx += self.contents.text_size("   ").width
  503.       when "\n"
  504.         @dy += 1
  505.         @dx = 0
  506.         @dx += @face_width unless @show_right
  507.         @dx += Fuki_v6_Setup::MES_FONT_SIZE if @show_name
  508.         last_character
  509.       else
  510.         last_character
  511.         if c != nil
  512.           self.contents.font.size = Fuki_v6_Setup::MES_FONT_SIZE
  513.           font_size = self.contents.font.size += Fuki_v6_Setup::SIZE_ZY
  514.           @old_text_info.push(@dx , @dy , font_size, self.contents.font.color.clone, c)
  515.           #字体如果自己来设定需要改变算法
  516.           line_y = (font_size + 4 - Fuki_v6_Setup::SIZE_ZY) * @dy  - Fuki_v6_Setup::SIZE_ZY / 2
  517.           self.contents.draw_text(4 + @dx, line_y , font_size, font_size, c)
  518.           self.contents.font.size -= Fuki_v6_Setup::SIZE_ZY
  519.           Audio.se_play("Audio/SE/Voice", 90, 100) if $play_voice and c != " "
  520.           @dx += self.contents.text_size(c).width
  521.         end
  522.       end
  523.     end
  524.   end
  525.   #--------------------------------------------------------------------------
  526.   # ○ 完成上一个字符的描绘,说白了就是给出一个文字影效果
  527.   #--------------------------------------------------------------------------
  528.   def last_character
  529.     unless @old_text_info == []
  530.       self.contents.fill_rect (4 + @old_text_info[0], (@old_text_info[2]+ 4 - Fuki_v6_Setup::SIZE_ZY) * @old_text_info[1] - Fuki_v6_Setup::SIZE_ZY / 2, @old_text_info[2], @old_text_info[2], Color.new(0,0,0,0))
  531.       color = self.contents.font.color.clone
  532.       self.contents.font.color = @old_text_info[3].clone
  533.       self.contents.font.size = @old_text_info[2] -= Fuki_v6_Setup::SIZE_ZY
  534.       self.contents.draw_text(4 + @old_text_info[0], (@old_text_info[2] + 4) * @old_text_info[1], @old_text_info[2], @old_text_info[2], @old_text_info[4])
  535.       self.contents.font.color = color
  536.       @old_text_info = []
  537.     end
  538.   end
  539.   #--------------------------------------------------------------------------
  540.   # ○ 选择项和输入数值的情况下
  541.   #--------------------------------------------------------------------------
  542.   def draw_opt_text
  543.     # 选择项的情况下
  544.     if $game_temp.choice_max > 0
  545.       @item_max = $game_temp.choice_max
  546.       self.active = true
  547.       self.index = 0
  548.     end
  549.     # 输入数值的情况下
  550.     if $game_temp.num_input_variable_id > 0
  551.       digits_max = $game_temp.num_input_digits_max
  552.       number = $game_variables[$game_temp.num_input_variable_id]
  553.       @input_number_window = Window_InputNumber.new(digits_max)
  554.       @input_number_window.number = number
  555.       @input_number_window.x = self.x + @face_width + Fuki_v6_Setup::MES_FONT_SIZE + 8
  556.       @input_number_window.y = self.y + $game_temp.num_input_start * (Fuki_v6_Setup::MES_FONT_SIZE + 2)
  557.     end
  558.   end
  559.   #--------------------------------------------------------------------------
  560.   # ○ 生成背景图片
  561.   #--------------------------------------------------------------------------
  562.   def create_backbmp
  563.     @pic_skin.dispose if @pic_skin != nil
  564.     @pic_skin = Sprite.new
  565.     unless @no_term_stop
  566.       @pic_skin.opacity = 0  
  567.     end
  568.     @pic_skin.bitmap = Bitmap.new(self.width + 32, self.height + 32)
  569.     @pic_skin.x = self.x + 2
  570.     @pic_skin.y = self.y + 2
  571.     @pic_skin.z = self.z
  572.     bitmap = RPG::Cache.windowskin(Fuki_v6_Setup::FUKI_SKIN_NAME)
  573.     rect = Rect.new(0, 0, 32, 32)
  574.     @pic_skin.bitmap.blt(0, 0, bitmap, rect)
  575.     rect = Rect.new(96, 0, 32, 32)
  576.     @pic_skin.bitmap.blt(self.width-32, 0, bitmap, rect)
  577.     rect = Rect.new(0, 96, 32, 32)
  578.     @pic_skin.bitmap.blt(0, self.height-32, bitmap, rect)
  579.     rect = Rect.new(96, 96, 32, 32)
  580.     @pic_skin.bitmap.blt(self.width-32, self.height-32, bitmap, rect)
  581.     rect = Rect.new(0, 32, 32, 32)
  582.     @pic_skin.bitmap.stretch_blt(Rect.new(0, 32, 32, self.height - 64), bitmap, rect)
  583.     rect = Rect.new(96, 32, 32, 32)
  584.     @pic_skin.bitmap.stretch_blt(Rect.new(self.width-32,32,32,self.height-64), bitmap, rect)
  585.     rect = Rect.new(32, 0, 32, 32)
  586.     @pic_skin.bitmap.stretch_blt(Rect.new(32,0,self.width-64,self.height-32), bitmap, rect)
  587.     # 如果尾巴在底端的话,更改底边描绘方式以修正阴影
  588.     if @message_position == 0 and @tale != nil
  589.       # 乱七八糟的三个计算变量
  590.       above_tale_x = @tale.x - self.x + 14
  591.       above_tale_width1 = @tale.x - self.x - 16 - 2
  592.       above_tale_width2 = self.width - above_tale_width1 - 32 - 64
  593.       # 中部(尾巴上方)
  594.       rect = Rect.new(32, 96, 32, 16)
  595.       @pic_skin.bitmap.stretch_blt(Rect.new(above_tale_x , self.height-32, 32, 24), bitmap, rect)
  596.       # 左半部
  597.       rect = Rect.new(32, 96, 32, 32)
  598.       @pic_skin.bitmap.stretch_blt(Rect.new(32, self.height-32, above_tale_width1, 32), bitmap, rect)
  599.       # 右半部
  600.       @pic_skin.bitmap.stretch_blt(Rect.new(32+above_tale_x, self.height-32, above_tale_width2, 32), bitmap, rect)
  601.       bitmap.dispose
  602.     else # 除此之外的情况保留原来的底边描绘方式
  603.       rect = Rect.new(32, 96, 32, 32)
  604.       @pic_skin.bitmap.stretch_blt(Rect.new(32,self.height-32,self.width-64,32), bitmap, rect)
  605.       bitmap.dispose
  606.     end
  607.   end
  608.   #--------------------------------------------------------------------------
  609.   # ○ 设置呼出对话框
  610.   #--------------------------------------------------------------------------
  611.   def set_fukidasi(x, y, width, height)
  612.     begin
  613.       self.pause = false # 不显示暂停标志
  614.       pos = get_fuki_pos(width, height) # 取得对话框位置
  615.       x = pos[0]
  616.       y = pos[1]
  617.       self.windowskin = RPG::Cache.windowskin("VX-暗")
  618.       self.x = x
  619.       self.y = y
  620.       self.height = height
  621.       self.width = width
  622.       unless @no_term_stop
  623.         self.contents.dispose
  624.         self.contents = Bitmap.new(width - 32, height - 32)
  625.         self.back_opacity = Fuki_v6_Setup::FUKI_OPACITY
  626.         self.contents.clear
  627.         self.contents.font.color = normal_color
  628.         self.contents.font.size = Fuki_v6_Setup::MES_FONT_SIZE
  629.       end
  630.       if $game_system.message_frame == 0
  631.         tale_pos = get_tale_pos
  632.         @tale = Sprite.new
  633.         @tale.bitmap = Bitmap.new(64, 32)
  634.         if Fuki_v6_Setup::TAIL_SHOW
  635.           case @message_position
  636.           when 0  # 上
  637.             bitmap = RPG::Cache.windowskin(Fuki_v6_Setup::FUKI_SKIN_NAME)
  638.             rect = Rect.new(32, 32, 64, 32)
  639.             @tale.bitmap.blt(0, 0, bitmap, rect)
  640.             bitmap.dispose
  641.             @tale.x = tale_pos[0]
  642.             @tale.x += 8 if @tale.x < 64
  643.             if @tale.x > 640 - 64
  644.               @tale.mirror = true
  645.               @tale.x -= 64
  646.             end
  647.             @tale.y = tale_pos[1]
  648.             @tale.z = self.z + 1
  649.           when 1  # 中
  650.             @tale.dispose
  651.             @tale = nil
  652.           when 2  # 下
  653.             bitmap = RPG::Cache.windowskin(Fuki_v6_Setup::FUKI_SKIN_NAME)
  654.             rect = Rect.new(32, 64, 64, 32)
  655.             @tale.bitmap.blt(0, 0, bitmap, rect)
  656.             bitmap.dispose
  657.             @tale.x = tale_pos[0]
  658.             @tale.x += 8 if @tale.x < 64
  659.             if @tale.x > 640 - 64
  660.               @tale.mirror = true
  661.               @tale.x -= 64
  662.             end
  663.             @tale.y = tale_pos[1]
  664.             @tale.z = self.z# + 1
  665.           end
  666.         end
  667.       end
  668.     rescue
  669.       del_fukidasi
  670.       reset_window(width, height)
  671.     end
  672.   end
  673.   #--------------------------------------------------------------------------
  674.   # ○ 计算呼出对话框的位置
  675.   #--------------------------------------------------------------------------
  676.   def get_fuki_pos(width, height)
  677.     # 取得角色
  678.     @character = get_character($mes_id)
  679.     if @character == nil
  680.       # 角色不存在的情况下使用默认信息框
  681.       
  682.       del_fukidasi
  683.       reset_window(width, height)
  684.       return
  685.     end
  686.     # 处理坐标
  687.     x = (@character.real_x - $game_map.display_x + 64) * 32 / 128 - (width / 2)
  688.     # 为尽量显示在画面内而移动横坐标
  689.     if x + width > 640
  690.       x = 640 - width
  691.     elsif x < 0
  692.       x = 0
  693.     end
  694.     # 决定窗口位置
  695.     case $game_system.message_position
  696.     when 0  # 上
  697.       y = (@character.real_y - $game_map.display_y + 64) * 32 / 128 - height - Fuki_v6_Setup::CHARACTOR_HEIGHT + Fuki_v6_Setup::POP_SHIFT_TOP
  698.     when 1  # 中
  699.       x = (640 - width) / 2
  700.       y = (480 - height) / 2
  701.     when 2  # 下
  702.       y =  (@character.real_y - $game_map.display_y + 64) * 32 / 128 + 32 + Fuki_v6_Setup::POP_SHIFT_UNDER
  703.     end
  704.     # 纪录文章显示位置
  705.     @message_position = $game_system.message_position
  706.     if Fuki_v6_Setup::POS_FIX
  707.       case @message_position
  708.       when 0  # 上
  709.         if y <= 0
  710.           @message_position = 2
  711.           y =  (@character.real_y - $game_map.display_y + 64) * 32 / 128 + 32 + Fuki_v6_Setup::POP_SHIFT_UNDER
  712.         end
  713.       when 2  # 下
  714.         if y + height >= 480
  715.           @message_position = 0
  716.           y = (@character.real_y - $game_map.display_y + 64) * 32 / 128 - height - Fuki_v6_Setup::CHARACTOR_HEIGHT + Fuki_v6_Setup::POP_SHIFT_TOP
  717.         end
  718.       end
  719.     end
  720.     return [x, y]
  721.   end
  722.   #--------------------------------------------------------------------------
  723.   # ○ 计算尾部图标的位置
  724.   #--------------------------------------------------------------------------
  725.   def get_tale_pos
  726.     case @message_position
  727.     when 0  # 上
  728.       # 处理坐标
  729.       x = ( @character.real_x - $game_map.display_x + 64 ) * 32 / 128 - 8
  730.       y = self.y + self.height - 6
  731.     when 1  # 中
  732.       x = nil
  733.       y = nil
  734.     when 2  # 下
  735.       # 处理坐标
  736.       x = ( @character.real_x - $game_map.display_x + 64 ) * 32 / 128 - 8
  737.       y = self.y - 18
  738.     end
  739.     return [x, y]
  740.   end
  741.   #--------------------------------------------------------------------------
  742.   # ○ 设置角色半身像窗口
  743.   #--------------------------------------------------------------------------
  744.   def draw_msg_face
  745.     @face_sprite.dispose if @face_sprite != nil
  746.     # $mes_name为空时不显示
  747.     if $mes_name == nil or $mes_name == ""
  748.       return
  749.     else
  750.       # 设定变量
  751.       mes_name = $mes_name
  752.       if $game_temp.namebmp[mes_name] == nil
  753.         sFile = Fuki_v6_Setup::FACE_PIC_DIR + mes_name
  754.       else
  755.         sFile = Fuki_v6_Setup::FACE_PIC_DIR + $game_temp.namebmp[mes_name]
  756.       end
  757.       bitmap = Bitmap.new(sFile)
  758.       @pic_width = bitmap.width
  759.       @pic_height = bitmap.height
  760.       @face_sprite = Sprite.new
  761.       @face_sprite.x = self.x + 26
  762.       @face_sprite.x = self.x + self.width - @pic_width - 26 if @show_right
  763.       @face_sprite.y = self.y + self.height - @pic_height - 6
  764.       @face_sprite.bitmap = bitmap
  765.       @face_sprite.z = self.z + 3
  766.       @face_sprite.mirror = @show_right
  767.       @face_sprite.opacity = 0
  768.     end
  769.   end
  770.   #--------------------------------------------------------------------------
  771.   # ○ 释放呼出对话框
  772.   #--------------------------------------------------------------------------
  773.   def del_fukidasi
  774.     self.opacity = 250 #测试标记。
  775.     self.x = 80
  776.     self.width = 480
  777.     self.height = 160
  778.     self.contents.dispose
  779.     self.contents = Bitmap.new(width - 32, height - 32)
  780.     self.pause = true
  781.     if @tale != nil
  782.       @tale.dispose
  783.       @tale = nil
  784.     end
  785.   end
  786.   #--------------------------------------------------------------------------
  787.   # ○ 取得角色
  788.   #     parameter : 参数
  789.   #--------------------------------------------------------------------------
  790.   def get_character(parameter)
  791.     # 参数分歧
  792.     case parameter
  793.     when nil
  794.       return events == nil
  795.     when -1  # 玩家
  796.       return $game_player
  797.     when 0   # 该事件
  798.       events = $game_map.events
  799.       # 循环 (地图事件)
  800.       for event in $game_map.events.values
  801.         # 如果找到了启动中的事件
  802.         if event.starting
  803.           @event_id = event.id
  804.         end
  805.       end
  806.       return events == nil ? nil : events[@event_id]
  807.     else     # 特定事件
  808.       events = $game_map.events
  809.       return events == nil ? nil : events[parameter]
  810.     end
  811.   end
  812.   #--------------------------------------------------------------------------
  813.   # ● 设定窗口位置和不透明度
  814.   #--------------------------------------------------------------------------
  815.   def reset_window(width = nil, height = nil)
  816.     if $game_temp.in_battle
  817.       self.y = 16
  818.     else
  819.       case $game_system.message_position
  820.       when 0  # 上
  821.         self.y = 16
  822.       when 1  # 中
  823.         if height != nil and width != nil
  824.           self.y = (480 - height) / 2 - 32
  825.           self.x = (640 - width) / 2
  826.           self.width = width
  827.           self.height = height
  828.           self.contents.dispose
  829.           self.contents = Bitmap.new(width - 32, height - 32)
  830.         else
  831.           self.y = 160
  832.         end
  833.       when 2  # 下
  834.         self.y = 304
  835.       end
  836.     end
  837.     self.opacity = 0
  838.     self.opacity = 255 if $game_system.message_frame == 1
  839.     self.back_opacity = Fuki_v6_Setup::MES_OPACITY
  840.   end
  841.   #--------------------------------------------------------------------------
  842.   # ● 刷新画面
  843.   #--------------------------------------------------------------------------
  844.   def update
  845.     if $tale_need_dispose
  846.       del_fukidasi
  847.       $tale_need_dispose = false
  848.     end
  849.     super
  850.     update_fuki                 # 呼出模式下跟随事件移动
  851.     if @fade_in                 # 渐变的情况下
  852.       self.contents_opacity += 24
  853.       unless $game_system.message_frame == 1
  854.         @pic_skin.opacity += 20
  855.       else
  856.         @pic_skin.opacity = 0
  857.       end
  858.       if @tale != nil
  859.         @face_sprite.opacity += 24 if @face_sprite != nil and !@face_sprite.disposed?
  860.         @tale.opacity += 20
  861.       end
  862.       @input_number_window.contents_opacity += 24 if @input_number_window != nil
  863.       @fade_in = false if self.contents_opacity == 255
  864.       return
  865.     end
  866.     if @contents_drawing        # 显示信息中的情况下
  867.       refresh_drawtext
  868.       return
  869.     end
  870.     update_input_number_window  # 输入数值的情况下
  871.     if @contents_showing_end    # 显示信息结束的情况下
  872.       if $game_temp.choice_max == 0 and @tale == nil
  873.         self.pause = true
  874.       else
  875.         self.pause = false
  876.       end
  877.       update_choose
  878.       return
  879.     end
  880.     if @fade_out == false and $game_temp.message_text != nil # 在渐变以外的状态下
  881.       @contents_showing = true
  882.       $game_temp.message_window_showing = true
  883.       reset_window
  884.       refresh_create
  885.       if @no_term_stop
  886.         self.visible = true        
  887.       else
  888.         @tale.opacity = 0 if @tale != nil
  889.         Graphics.frame_reset
  890.         self.visible = true
  891.         self.contents_opacity = 0
  892.         @input_number_window.contents_opacity = 0 if @input_number_window != nil
  893.         @fade_in = true
  894.       end
  895.       return
  896.     end
  897.    
  898.     unless @no_term_stop # 没有可以显示的信息、但是窗口为可见的情况下
  899.       if self.visible
  900.         @fade_out = true
  901.         self.opacity -= 48
  902.         @face_sprite.opacity -= 48 if @face_sprite != nil and !@face_sprite.disposed?
  903.         @pic_skin.opacity -= 48 if @pic_skin != nil and !@pic_skin.disposed?
  904.         @tale.opacity -= 48 if @tale != nil and [email protected]?
  905.         if (@face_sprite == nil) or @face_sprite.disposed? or (@face_sprite.opacity == 0)
  906.           self.visible = false
  907.           @face_sprite.dispose if @face_sprite != nil
  908.           @pic_skin.dispose
  909.           @fade_out = false
  910.           $game_temp.message_window_showing = false
  911.         end
  912.         return
  913.       end
  914.     else
  915.       $game_temp.message_window_showing = false   
  916.     end
  917.   end
  918.   #--------------------------------------------------------------------------
  919.   # ● 释放
  920.   #--------------------------------------------------------------------------
  921.   def dispose
  922.     terminate_message
  923.     $game_temp.message_window_showing = false
  924.     @input_number_window.dispose if @input_number_window != nil
  925.     super
  926.   end
  927.   #--------------------------------------------------------------------------
  928.   # ● 信息结束处理
  929.   #--------------------------------------------------------------------------
  930.   def terminate_message
  931.     self.active = false
  932.     self.pause = false
  933.     self.index = -1
  934.     self.contents.clear
  935.     # 清除显示中标志
  936.     @contents_showing = false
  937.     @contents_showing_end = false
  938.     $mes_name = ""
  939.     # 呼叫信息调用
  940.     $game_temp.message_proc.call if $game_temp.message_proc != nil
  941.     # 清除文章、选择项、输入数值的相关变量
  942.     $game_temp.message_text = nil
  943.     $game_temp.message_proc = nil
  944.     $game_temp.choice_start = 99
  945.     $game_temp.choice_max = 0
  946.     $game_temp.choice_cancel_type = 0
  947.     $game_temp.choice_proc = nil
  948.     $game_temp.num_input_start = 99
  949.     $game_temp.num_input_variable_id = 0
  950.     $game_temp.num_input_digits_max = 0
  951.     # 释放金钱窗口
  952.     if @gold_window != nil
  953.       @gold_window.dispose
  954.       @gold_window = nil
  955.     end
  956.     @no_term_stop = false
  957.     @save_x = 0
  958.     @save_y = 0
  959.     @show_right = false
  960.     @show_name  = false
  961.     @face_width = 0
  962.     $tale_need_dispose = true if @tale != nil
  963.   end
  964.   #--------------------------------------------------------------------------
  965.   # ● ★信息结束处理★
  966.   #--------------------------------------------------------------------------
  967.   def terminate_messageX
  968.     self.active = false
  969.     self.pause = false
  970.     self.index = -1
  971.     # 清除显示中标志
  972.     @contents_showing = false
  973.     @contents_showing_end = false
  974.     # 呼叫信息调用
  975.     $game_temp.message_proc.call if $game_temp.message_proc != nil
  976.     # 清除文章、选择项、输入数值的相关变量
  977.     $game_temp.message_text = nil
  978.     $game_temp.message_proc = nil
  979.     @no_term_stop = true
  980.     @show_right = false
  981.     @show_name  = false
  982.     @face_width = 0
  983.   end
  984.   #--------------------------------------------------------------------------
  985.   # ● 刷新光标矩形
  986.   #--------------------------------------------------------------------------
  987.   def update_cursor_rect
  988.     if @index >= 0
  989.       n = $game_temp.choice_start + @index
  990.       self.cursor_rect.set(Fuki_v6_Setup::MES_FONT_SIZE / 2, n * (Fuki_v6_Setup::MES_FONT_SIZE + 4), @cursor_width, Fuki_v6_Setup::MES_FONT_SIZE + 4)
  991.       self.cursor_rect.x += @face_width unless @show_right
  992.       self.cursor_rect.x += Fuki_v6_Setup::MES_FONT_SIZE / 2 if @show_name
  993.     else
  994.       self.cursor_rect.empty
  995.     end
  996.   end
  997.   #--------------------------------------------------------------------------
  998.   # ● 获取文字颜色色
  999.   #     n : 文字颜色编号 (0~31)
  1000.   #--------------------------------------------------------------------------
  1001.   def text_color(n)
  1002.     return normal_color if n > 31
  1003.     x = (n % 8) * 16
  1004.     y = 128 + (n / 8) * 16
  1005.     return RPG::Cache.windowskin(Fuki_v6_Setup::FUKI_SKIN_NAME).get_pixel(x, y)
  1006.   end
  1007.   #--------------------------------------------------------------------------
  1008.   # ● 取得普通文字色
  1009.   #--------------------------------------------------------------------------
  1010.   def normal_color
  1011.     unless $game_system.message_frame == 1
  1012.       return Fuki_v6_Setup::FUKI_COLOR
  1013.     else
  1014.       return Fuki_v6_Setup::SHADOW_COLOR
  1015.     end
  1016.   end
  1017.   #--------------------------------------------------------------------------
  1018.   # ● 获取头像宽度
  1019.   #--------------------------------------------------------------------------
  1020.   def get_face_width(face_name)
  1021.     return if $mes_name == ""
  1022.     filename = Fuki_v6_Setup::FACE_PIC_DIR + face_name
  1023.     bitmap = Bitmap.new(filename)
  1024.     @face_width = bitmap.width + Fuki_v6_Setup::MES_FONT_SIZE
  1025.     bitmap.dispose
  1026.   end
  1027.   #--------------------------------------------------------------------------
  1028.   # ● 描绘物品
  1029.   #     item : 物品
  1030.   #--------------------------------------------------------------------------
  1031.   def draw_icon(item, x, y)
  1032.     return if item == nil
  1033.     bitmap = RPG::Cache.icon(item.icon_name)
  1034.     self.contents.blt(x + 4, y, bitmap, Rect.new(0, 0, 24, 24))
  1035.     color = self.contents.font.color.clone
  1036.     self.contents.font.color = text_color(1)
  1037.     self.contents.draw_text(x + 28, y, self.contents.text_size(item.name).width + 5, 24, item.name)
  1038.     self.contents.font.color = color
  1039.     @dx += self.contents.text_size(item.name).width
  1040.   end
  1041.   #--------------------------------------------------------------------------
  1042.   # ● 图形的描绘
  1043.   #     actor : 角色
  1044.   #     x     : 描画目标 X 坐标
  1045.   #     y     : 描画目标 Y 坐标
  1046.   #--------------------------------------------------------------------------
  1047.   def draw_actor_graphic(actor, x, y)
  1048.     bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
  1049.     cw = bitmap.width / 4
  1050.     ch = bitmap.height / 4
  1051.     src_rect = Rect.new(0, 0, cw, ch)
  1052.     self.contents.blt(x, y - 4, bitmap, src_rect)
  1053.     color = self.contents.font.color.clone
  1054.     self.contents.font.color = text_color(1)
  1055.     self.contents.draw_text(x + 32, y, self.contents.text_size(actor.name).width + 5, 24, actor.name)
  1056.     self.contents.font.color = color
  1057.     @dx += self.contents.text_size(actor.name).width
  1058.   end
  1059.   #--------------------------------------------------------------------------
  1060.   # ● 刷新呼出对话框
  1061.   #--------------------------------------------------------------------------
  1062.   def update_fuki
  1063.     if @tale != nil
  1064.       pos = get_fuki_pos(self.width, self.height)
  1065.       self.x = pos[0]
  1066.       self.y = pos[1]
  1067.       tale_pos = get_tale_pos
  1068.       @tale.mirror = false
  1069.       @tale.x = tale_pos[0]
  1070.       @tale.x += 8 if @tale.x < 64
  1071.       if @tale.x > 640 - 64
  1072.         @tale.mirror = true
  1073.         @tale.x -= 64
  1074.       end
  1075.       @tale.y = tale_pos[1]
  1076.       @pic_skin.x = self.x + 2
  1077.       @pic_skin.y = self.y + 2
  1078.       if @face_sprite != nil and !@face_sprite.disposed?
  1079.         @face_sprite.x = self.x + 26
  1080.         @face_sprite.x = self.x + self.width - @pic_width - 26 if @show_right
  1081.         @face_sprite.y = self.y + self.height - @pic_height - 6
  1082.       end
  1083.     end
  1084.   end
  1085.   #--------------------------------------------------------------------------
  1086.   # ● 刷新数字输入框
  1087.   #--------------------------------------------------------------------------
  1088.   def update_input_number_window
  1089.     if @input_number_window != nil
  1090.       @input_number_window.update
  1091.       # 确定
  1092.       if Input.trigger?(Input::C)
  1093.         $game_system.se_play($data_system.decision_se)
  1094.         $game_variables[$game_temp.num_input_variable_id] = @input_number_window.number
  1095.         # 释放输入数值窗口
  1096.         @input_number_window.dispose
  1097.         @input_number_window = nil
  1098.         $game_map.need_refresh = true
  1099.         terminate_message
  1100.       end
  1101.       return
  1102.     end
  1103.   end
  1104.   #--------------------------------------------------------------------------
  1105.   # ● 刷新选择输入
  1106.   #--------------------------------------------------------------------------
  1107.   def update_choose
  1108.     if Input.trigger?(Input::B)
  1109.       if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0
  1110.         $game_system.se_play($data_system.cancel_se)
  1111.         $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)
  1112.         terminate_message
  1113.       end
  1114.     end
  1115.     if Input.trigger?(Input::C)
  1116.       if $game_temp.choice_max > 0
  1117.         $game_system.se_play($data_system.decision_se)
  1118.         $game_temp.choice_proc.call(self.index)
  1119.       end
  1120.       terminate_message
  1121.     end
  1122.   end
  1123. end
复制代码
pwh2132 发表于 2011-11-26 12:44
这个脚本改变框体透明度的设置好像没用啊 ,还有没法用去框体的效果。。。。
还有不解的$mes_id = nil  写 ...


看来我的那个FUKI还是有点潜力。决定还是用猫君的这个FUKI做蓝本来做个双核FUKI对话框吧,省了再有人想弄多选择插件了。
  1. #--------------------------------------------------------------------------
  2.   # ● 头像对应表
  3.   #--------------------------------------------------------------------------
  4.   #    如果不想使用角色名字直接作为头像文件名
  5.   #    可在这里重新设定角色名字与文件名的对应关系
  6.   #
  7.   #  (这功能怎么用我自己也没搞明白……大家无视吧 by 各种压力的猫君)
  8.   #--------------------------------------------------------------------------
  9.   
  10.     NAME_TABLE = {"玩家"=>"维斯特"}
复制代码
我来解释一下:这里说白了就是给中文名弄个英文或者数字的代号,因为脚本中
  1. FileTest.exist?(相对路径\文件名)
复制代码
,其中的文件名作为文本变量在脚本中,非英文或者数字式不能被直接识别的,类似于脚本中\\被识别为\那样,有微小的差别。





Shy07 发表于 2011-11-23 09:05
这脚本终于有人领养了,不容易啊


看来对我的86版对话框构成挑战了。不知道柳大人的增强对话框是不是压力更大呢。
VX-暗.png
潜水,专心忙活三次元工作了……
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
353 小时
注册时间
2011-8-25
帖子
234
发表于 2011-12-18 22:55:27 | 显示全部楼层
不知能否移植到VX里???VX可缺这玩意儿了呢。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
228 小时
注册时间
2008-9-15
帖子
22
发表于 2012-3-3 15:41:26 | 显示全部楼层
- -+
修改FUKI_COLOR 没变化?
回复 支持 反对

使用道具 举报

Lv3.寻梦者 (版主)

梦石
0
星屑
1847
在线时间
2677 小时
注册时间
2010-6-26
帖子
3197

开拓者整合系统大赛RMVX达人剧作品鉴家

发表于 2012-3-3 16:33:05 | 显示全部楼层
原来喵君也是火纹党,而且还是 爱丽丝粉 = =?我的希达呢……

点评

╮(╯_╰)╭ 只是原来的图片我没改而已……火纹是啥我不知道的  发表于 2012-3-3 17:12

评分

参与人数 1星屑 -10 收起 理由
Kimu -10 歪楼

查看全部评分


      情人怨遥夜,竟夕起相思
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
432
在线时间
4175 小时
注册时间
2010-6-26
帖子
6474
发表于 2012-3-4 22:15:32 | 显示全部楼层
狂神草薙 发表于 2011-12-18 22:55
不知能否移植到VX里???VX可缺这玩意儿了呢。

旧的VX没移植,新的VA请看我的求助帖。
潜水,专心忙活三次元工作了……
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
183 小时
注册时间
2012-1-16
帖子
140
发表于 2012-4-1 22:10:56 | 显示全部楼层
我修改了事件名字
于是当使用
$mes_id = 0
的时候就不显示在本事件上了
想买一艘船         0/1
想住在一个凉爽的的国度         0/1
想获得永生         N/A
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-3-28 18:05

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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