查看: 2181|回复: 5

[已经解决] 关于FUKI脚本的各种BUG,求救或求脚本。

[复制链接]
梦石
0
星屑
50
在线时间
36 小时
注册时间
2015-5-22
回帖
20
发表于 2015-6-28 13:38:52 | 显示全部楼层 |阅读模式

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

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

×
FUKI脚本103版本的,真的在本站不好找啊,好不容易找到个,可惜不知道为什么总是有BUG。
例如一开始的时候,在选项分歧是可以显示选项光标的,如图:
QQ图片20150628132413.png

然后,游戏开始之后,再出现选项分歧的时候就这鬼样了,如图:
QQ图片20150628132631.png

另外,还会出现字符超出边框的情况,虽然可以用空格号和回车键空行来解决,但这始终不是一个好办法啊。
之前调用了\f[X]改变字体大小来尝试解决超出边框问题,结果更诡异的是,直接只有边框,不显示文字了,如果在脚本里就设置好文字大小(默认20号,脚本上写不能改,否则会出奇葩BUG)结果真的出了奇葩的BUG。

求哪位大大帮我看下,或者有什么办法能解决这两个对我而言棘手的问题。
不显示光标,和字超边框问题。

以下为脚本,未曾改动过。
  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 !@tale.disposed?
  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
复制代码
梦石
0
星屑
3905
在线时间
1972 小时
注册时间
2013-1-3
回帖
9146
发表于 2015-6-28 20:49:38 | 显示全部楼层
超边框的问题还是自己换行吧,我相信大多数都是通过换行实现的
测试中并未发现选框问题,可以发工程看看吗
《宿愿·寻剑篇》正式版已经发布!快去看看!点击进入论坛发布贴
回复

使用道具 举报

梦石
0
星屑
50
在线时间
36 小时
注册时间
2015-5-22
回帖
20
 楼主| 发表于 2015-6-29 02:48:09 | 显示全部楼层
http://pan.baidu.com/s/1c0IvxL2
工程有点大,8MB。上传不了6R。
我把它放在百度盘里了,那么就拜托大大了。
回复

使用道具 举报

梦石
0
星屑
76
在线时间
1379 小时
注册时间
2012-7-5
回帖
1643

开拓者

发表于 2015-6-29 15:37:11 | 显示全部楼层
另一个版本的FUKI
代码
  1. #
  2. #    呼出对话框 ver. 1.31 By パラ犬(日)
  3. #  来自 [url]http://rpg.para.s3p.net/[/url]
  4. #
  5. #  汉化修改 66RPG bbschat(2006.1.5)
  6. #    来自 [url]http://www.66RPG.com/[/url]
  7. #
  8. #    ●准备工作-窗口Skin
  9. #
  10. #    首先,确认自己使用的对话框窗口Skin,(数据库-系统-窗口外观图形)
  11. #    然后根据该窗口Skin制作对话框尾部使用的两个箭头图形
  12. #    尾部箭头图形命名方式:“窗口skin名-top”,“窗口skin名-under”
  13. #    将该图形文件存放在“Graphics/Windowskins”文件夹下。
  14. #
  15. #    本演示游戏内置2套窗口和箭头图形,
  16. #    一套是游戏默认的“001-Blue01”,一套是定制的“fk”
  17. #    玩家可以根据自己的需要参照样本定制自己的呼出对话框窗口Skin。
  18. #
  19. #    ●呼出对话框使用方法
  20. #
  21. #    在事件命令行使用[脚本]将事件ID代入[$mes_id]
  22. #    该事件就可以使用呼出对话框了。
  23. #   (举例:$mes_id=4)
  24. #
  25. #    ID 代入 -1 表示玩家,代入 0 表示事件自身。
  26. #    代入 nil 或者 "" 则返回成通常的信息窗口。
  27. #    对话框的表示位置可以通过事件的“更改文章选项”来设定(上、中、下)。
  28. #    表示位置为“中央”的话,不管事件位置在哪里,对话框都将显示在画面中央。
  29. #
  30. #    ●角色名字窗口的使用文字的方法
  31. #
  32. #    在事件命令行使用[脚本]将文字列代入[$mes_name]
  33. #    对话框就会显示角色名字窗口
  34. #   (举例:$mes_name="阿尔西斯")
  35. #    代入 nil 或者 "" 则不显示角色名字窗口。
  36. #
  37. #    以上两个机能是独立的,所以可以单独使用
  38. #
  39. #   $mes_id=(ID) + $mes_name="名字"  :呼出对话框显示 + 角色名字窗口
  40. #   $mes_id=(ID) + $mes_name=""      :呼出对话框显示(没有角色名字)
  41. #   $mes_id=nil  + $mes_name="名字"  :默认信息窗口 + 角色名字窗口
  42. #   $mes_id=nil  + $mes_name=""      :默认信息窗口(没有角色名字)
  43. #
  44. #    ●角色名字窗口使用角色图片的方法(汉化特别追加功能,原脚本只能使用文字)
  45. #   
  46. #    如果能在对应文件夹中找到文件名和角色名字相同的图片,   
  47. #    则角色名字窗口显示角色头像图片,角色图片最好能包括角色的名字。
  48. #    默认头像图片保存目录为“Graphics/Heads/”,玩家可自行修改。
  49. #
  50. #    如果不想使用角色名字直接作为头像文件名。
  51. #    可以使用下面在 Game_Temp 类里增加的namebmp属性。
  52. #    重新设定角色名字与文件名的对应关系。
  53. #
  54. #    ●信息表示速度的变更方法
  55. #
  56. #    在事件命令行使用[脚本]将数值代入[$mes_speed]
  57. #    速度为 0 即瞬间显示全部信息,数字越大,信息表示速度越慢。
  58. #   (举例:$mes_speed=1)
  59. #
  60. #    ●文字自动消失设置 by JesseKiss
  61. #
  62. #    \A[n]   其中n为等待的帧数,n帧后文字自动消失
  63. #
  64. #    \A      简化输入,默认60帧后文字自动消失,DEFAULT_AUTO_CLOSE_TIME = 60
  65. #
  66. #    ●苹果梨对话加强脚本删除换行号
  67. #
  68. #    在行尾使用\/即可不再自动换行。
  69. #==============================================================================

  70. module FUKI

  71.   # 头像图片保存目录的设定
  72.   HEAD_PIC_DIR = "Graphics/Heads/"

  73.   # 是否显示尾部图标
  74.   TAIL_SHOW = true
  75.   
  76.   # Skin的设定
  77.   # 使用数据库默认窗口Skin情况下这里使用[""]
  78.   FUKI_SKIN_NAME = "001-Blue15"   # 呼出对话框用Skin
  79.   NAME_SKIN_NAME = "001-Blue15"   # 角色名字窗口用Skin
  80.   
  81.   # 字体大小
  82.   MES_FONT_SIZE = 20    # 呼出对话框
  83.   NAME_FONT_SIZE = 14   # 角色名字窗口
  84.   
  85.   # 字体颜色
  86.   #(设定为 Color.new(0, 0, 0, 0) 表示使用普通文字色)
  87.   FUKI_COLOR = Color.new(255, 255, 255, 255)  # 呼出对话框
  88.   NAME_COLOR = Color.new(255, 255, 255, 255)  # 角色名字窗口
  89.   
  90.   # 窗口透明度
  91.   # 如修改窗口透明度请同时修改尾部箭头图形内部的透明度
  92.   FUKI_OPACITY = 255    # 呼出对话框
  93.   MES_OPACITY = 255     # 默认信息窗口
  94.   NAME_OPACITY = 255    # 角色名字窗口
  95.   
  96.   # 角色名字窗口的相对位置
  97.   NAME_SHIFT_X = 0      # 横坐标
  98.   NAME_SHIFT_Y = 16     # 纵坐标
  99.   
  100.   # 窗口表示时是否根据画面大小自动检查窗口出现的位置,
  101.   # 自动改变位置( true / false )
  102.   # 设置成 true 可能出现箭头图标颠倒的问题 <- bbschat
  103.   POS_FIX = false

  104.   # 在画面最边缘表示时的稍微挪动
  105.   # 使用圆形Skin的角和方框的角重合的情况下为 true
  106.   CORNER_SHIFT = false
  107.   SHIFT_PIXEL = 4   # true 时挪动的象素
  108.   
  109.   # 角色高度尺寸
  110.   CHARACTOR_HEIGHT = 48
  111.   # 呼出对话框的相对位置(纵坐标)
  112.   POP_SHIFT_TOP = 0         # 表示位置为上的时候
  113.   POP_SHIFT_UNDER = 0       # 表示位置为下的时候
  114.   
  115.   # 信息的表示速度(数字越小速度越快,0为瞬间表示)
  116.   # 游戏中 可随时用数字代入 $mes_speed 来改变消息表示速度。
  117.   MES_SPEED = 1
  118.   # 默认的文字自动消失时间为60帧
  119.   DEFAULT_AUTO_CLOSE_TIME = 60
  120. end

  121. #==============================================================================
  122. # 方便用户同时设置2个常用参数而使用的函数
  123. #==============================================================================
  124. def chat(id = 0,name = "")
  125.   $mes_id = id
  126.   $mes_name = name
  127. end

  128. #==============================================================================
  129. # □ Game_Temp
  130. #==============================================================================

  131. class Game_Temp
  132.   attr_accessor  :namebmp              #保存头像图片的Hash表
  133.   alias initialize_fuki initialize
  134.   def initialize
  135.     initialize_fuki
  136.     # 如果不想使用角色名字直接作为头像文件名
  137.     # 可在这里重新设定角色名字与文件名的对应关系
  138. @namebmp ={}
  139.   end
  140. end

  141. #==============================================================================
  142. # □ Window_FukiMessage
  143. #==============================================================================

  144. class Window_FukiMessage < Window_Selectable

  145.   #--------------------------------------------------------------------------
  146.   # ● 初始化状态
  147.   #--------------------------------------------------------------------------
  148.   def initialize
  149.     super(80, 304, 480, 160)
  150.     self.contents = Bitmap.new(width - 32, height - 32)
  151.     self.visible = false
  152.     self.z = 9998
  153.     @fade_in = false
  154.     @fade_out = false
  155.     @contents_showing = false
  156.     @cursor_width = 0
  157.     self.active = false
  158.     self.index = -1
  159.     @w = 0
  160.     @h = 0
  161.     @wait = 0
  162.     @dx = 0
  163.     @dy = 0
  164.     $mes_speed = FUKI::MES_SPEED
  165.     @auto_close=-1
  166.   end
  167.   
  168.   #--------------------------------------------------------------------------
  169.   # ○ 决定窗口尺寸并生成窗口
  170.   #--------------------------------------------------------------------------
  171.   def refresh_create
  172.     self.contents.clear
  173.     self.contents.font.color = normal_color
  174.     self.contents.font.size = FUKI::MES_FONT_SIZE
  175.     # 取得窗口尺寸
  176.     get_windowsize
  177.     w = @w + 32 + 8
  178.     h = @h * (self.contents.font.size + 10) + 26
  179.     # 生成呼出窗口
  180.     set_fukidasi(self.x, self.y, w, h)
  181.     # 生成角色名字窗口
  182.     set_namewindow
  183.     # 初始化信息表示使用的变量
  184.     @dx = @dy = 0
  185.     @cursor_width = 0
  186.     @contents_drawing = true
  187.     # ■■■■■ 任何时候都瞬间显示 ■■■■■■
  188.     if $mes_speed == 1
  189.       $mes_speed = 0
  190.     end
  191.     #■■■■■■■■■■■■■■■■■■■■■
  192.     # 瞬间表示的情况下
  193.     if $mes_speed == 0
  194.       # 循环信息描绘处理
  195.       while $game_temp.message_text != ""
  196.         draw_massage
  197.       end
  198.       draw_opt_text
  199.       @contents_showing_end = true
  200.       @contents_drawing = false
  201.     else
  202.       # 一个一个描绘文字
  203.       refresh_drawtext
  204.     end
  205.   end
  206.   
  207.   #--------------------------------------------------------------------------
  208.   # ○ 一个一个描绘文字
  209.   #--------------------------------------------------------------------------
  210.   def refresh_drawtext
  211.     if $game_temp.message_text != nil
  212.       if @wait > 0
  213.         @wait -= 1
  214.       elsif @wait == 0
  215.         # 描绘处理
  216.         draw_massage
  217.         @wait = $mes_speed
  218.       end
  219.     end
  220.     # 描绘结束
  221.     if $game_temp.message_text == ""
  222.       draw_opt_text
  223.       @contents_showing_end = true
  224.       @contents_drawing = false
  225.     end
  226.   end
  227.   
  228.   #--------------------------------------------------------------------------
  229.   # ○ 取得窗口尺寸
  230.   #--------------------------------------------------------------------------
  231.   def get_windowsize
  232.     x = y = 0
  233.     @h = @w = 0
  234.     @cursor_width = 0
  235.     # 有选择项的话,处理字的缩进
  236.     if $game_temp.choice_start == 0
  237.       x = 16
  238.     end
  239.     # 有等待显示的文字的情况下
  240.     if $game_temp.message_text != nil
  241.     text = $game_temp.message_text.clone
  242.       # 限制文字处理
  243.       begin
  244.         last_text = text.clone
  245.         text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
  246.       end until text == last_text
  247.       text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  248.         $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  249.       end
  250.       # 为了方便、将 "\\\" 变换为 "\000"
  251.       text.gsub!(/\\\\/) { "\000" }
  252.       # "\\C" 变为 "\001" 、"\\G" 变为 "\002"
  253.       text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001" }
  254.       text.gsub!(/\\[Gg]/) { "\002" }
  255.       text.slice!(/\\[Aa]\[(\w+)\]/) { "" }
  256.       # c 获取 1 个字 (如果不能取得文字就循环)
  257.       while ((c = text.slice!(/./m)) != nil)
  258.         # \\ 的情况下
  259.         if c == "\000"
  260.           # 还原为本来的文字
  261.           c = "\"
  262.         end
  263.         # \C[n] 或者 \G 的情况下
  264.         if c == "\001" or c == "\002"
  265.           # 下面的文字
  266.           next
  267.         end
  268.         # 另起一行文字的情况下
  269.         if c == "\n"
  270.           # y 累加 1
  271.           y += 1
  272.           # 取得纵横尺寸
  273.           @h = y
  274.           @w = x > @w ? x : @w
  275.           if y >= $game_temp.choice_start
  276.             @w = x + 8 > @w ? x + 8 : @w
  277.           end
  278.           x = 0
  279.           # 移动到选择项的下一行
  280.           if y >= $game_temp.choice_start
  281.             x = 8
  282.           end
  283.           # 下面的文字
  284.           next
  285.         end
  286.         # x 为要描绘文字的宽度加法运算
  287.         x += self.contents.text_size(c).width
  288.       end
  289.     end
  290.     # 输入数值的情况
  291.     if $game_temp.num_input_variable_id > 0
  292.       digits_max = $game_temp.num_input_digits_max
  293.       number = $game_variables[$game_temp.num_input_variable_id]
  294.       @h += 1
  295.       x = digits_max * self.contents.font.size + 16
  296.       @w = x > @w ? x : @w
  297.     end
  298.   end
  299.   
  300.   #--------------------------------------------------------------------------
  301.   # ○ 描绘信息处理
  302.   #--------------------------------------------------------------------------
  303.   def draw_massage
  304.     # 有等待显示的文字的情况下
  305.     if $game_temp.message_text != nil
  306.       text = $game_temp.message_text
  307.       # 限制文字处理
  308.       begin
  309.         last_text = text.clone
  310.         text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
  311.       end until text == last_text
  312.       text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  313.         $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  314.       end
  315.       # 为了方便、将 "\\\" 变换为 "\000"
  316.       text.gsub!(/\\\\/) { "\000" }
  317.       # "\\C" 变为 "\001"、"\\G" 变为 "\002"
  318.       text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
  319.       text.gsub!(/\\[Gg]/) { "\002" }
  320.       # "\\/" 删除行尾换行符号
  321.       text.gsub!(/\\\/\n/) {""}
  322.       # 去掉不在行尾的"\\/"符号,防止出错
  323.       text.gsub!(/\\\//) {""}
  324.       if text.slice!(/\\[Aa]\[(\w+)\]/)!=nil
  325.         @auto_close=$1.to_i
  326.       else
  327.         if text.slice!(/\\[Aa]/)!=nil
  328.           @auto_close = FUKI::DEFAULT_AUTO_CLOSE_TIME
  329.         end
  330.       end
  331.       # c 获取 1 个字
  332.       if ((c = text.slice!(/./m)) != nil)
  333.         # 选择项的情况
  334.         if @dy >= $game_temp.choice_start
  335.           # 处理字的缩进
  336.           @dx = 8
  337.           # 描绘文字
  338.           self.contents.draw_text(4 + @dx, 32 * @dy, 40, 32, c)
  339.           # x 为要描绘文字宽度的加法运算
  340.           @dx += self.contents.text_size(c).width
  341.           # 循环
  342.           while ((c = text.slice!(/./m)) != "\n")
  343.             # 描绘文字
  344.             self.contents.draw_text(4 + @dx, 32 * @dy, 40, 32, c)
  345.             # x 为要描绘文字宽度的加法运算
  346.             @dx += self.contents.text_size(c).width
  347.           end
  348.           if c == "\n"
  349.             # 更新光标宽度
  350.             @cursor_width = [@cursor_width, @dx].max
  351.             # dy 累加 1
  352.             @dy += 1
  353.             @dx = 0
  354.           end
  355.           return
  356.         end
  357.         # \\ 的情况下
  358.         if c == "\000"
  359.           # 还原为本来的文字
  360.           c = "\"
  361.         end
  362.         #\C[n] 的情况下
  363.         if c == "\001"
  364.           # 更改文字色
  365.           text.sub!(/\[([0-9]+)\]/, "")
  366.           color = $1.to_i
  367.           if color >= 0 and color <= 7 or color == 10
  368.             self.contents.font.color = text_color(color)
  369.           end
  370.         end
  371.         # \G 的情况下
  372.         if c == "\002"
  373.           # 生成金钱窗口
  374.           if @gold_window == nil
  375.             @gold_window = Window_Gold.new
  376.             @gold_window.x = 560 - @gold_window.width
  377.             if $game_temp.in_battle
  378.               @gold_window.y = 192
  379.             else
  380.               @gold_window.y = self.y >= 128 ? 32 : 384
  381.             end
  382.             @gold_window.opacity = self.opacity
  383.             @gold_window.back_opacity = self.back_opacity
  384.           end
  385.         end
  386.         # 另起一行文字的情况下
  387.         if c == "\n"
  388.           # dy 累加 1
  389.           @dy += 1
  390.           @dx = 0
  391.         end
  392.         # 描绘文字
  393.         self.contents.font.size = FUKI::MES_FONT_SIZE
  394.         font_size = self.contents.font.size
  395.         if c == "\001" or c == "\002" or c == "\003" or c == "\n"
  396.         c = ""
  397.       else
  398.         self.contents.draw_text(4+@dx, (font_size+10)*@dy, font_size, font_size, c)
  399.       end
  400.         # dx 为要描绘文字的宽度加法运算
  401.         @dx += self.contents.text_size(c).width
  402.       end
  403.     end
  404.   end
  405.   #--------------------------------------------------------------------------
  406.   # ○ 选择项和输入数值的情况下
  407.   #--------------------------------------------------------------------------
  408.   def draw_opt_text
  409.     # 选择项的情况下
  410.     if $game_temp.choice_max > 0
  411.       @item_max = $game_temp.choice_max
  412.       self.active = true
  413.       self.index = 0
  414.     end
  415.     # 输入数值的情况下
  416.     if $game_temp.num_input_variable_id > 0
  417.       digits_max = $game_temp.num_input_digits_max
  418.       number = $game_variables[$game_temp.num_input_variable_id]
  419.       @input_number_window = Window_InputNumber.new(digits_max)
  420.       @input_number_window.number = number
  421.       @input_number_window.x = self.x + 8
  422.       @input_number_window.y = self.y + $game_temp.num_input_start * 32
  423.     end
  424.   end
  425.   
  426.   #--------------------------------------------------------------------------
  427.   # ○ 设置呼出对话框
  428.   #--------------------------------------------------------------------------
  429.   def set_fukidasi(x, y, width, height)
  430.     # $mes_id 为空的时候,不显示呼出对话框
  431.     if $mes_id == nil or $mes_id == ""
  432.       del_fukidasi
  433.       reset_window
  434.     else
  435.       # 不显示暂停标志
  436.       self.pause = false
  437.       # 取得对话框位置
  438.       pos = get_fuki_pos(width, height)
  439.       x = pos[0]
  440.       y = pos[1]
  441.       skin = FUKI::FUKI_SKIN_NAME != "" ? FUKI::FUKI_SKIN_NAME : $game_system.windowskin_name
  442.       # 生成呼出对话框
  443.       self.windowskin = RPG::Cache.windowskin(skin)
  444.       self.x = x
  445.       self.y = y
  446.       self.height = height
  447.       self.width = width
  448.       self.contents.dispose
  449.       self.contents = Bitmap.new(width - 32, height - 32)
  450.       self.back_opacity = FUKI::FUKI_OPACITY
  451.       self.contents.clear
  452.       self.contents.font.color = normal_color
  453.       self.contents.font.size = FUKI::MES_FONT_SIZE
  454.       # 描绘尾部图标
  455.       if $game_system.message_frame == 0
  456.         # 取得位置
  457.         tale_pos = get_tale_pos
  458.         @tale = Sprite.new
  459.         # 是否显示尾部图标 <- bbschat
  460.         if FUKI::TAIL_SHOW == true
  461.           case @message_position
  462.             when 0  # 上
  463.               @tale.bitmap = RPG::Cache.windowskin(skin + "-top")
  464.               @tale.x = tale_pos[0]
  465.               @tale.y = tale_pos[1]
  466.               @tale.z = self.z + 1
  467.             when 1  # 中
  468.               @tale.dispose
  469.               @tale = nil
  470.             when 2  # 下
  471.               @tale.bitmap = RPG::Cache.windowskin(skin + "-under")
  472.               @tale.x = tale_pos[0]
  473.               @tale.y = tale_pos[1]
  474.               @tale.z = self.z + 1
  475.           end
  476.         end
  477.       end
  478.     end
  479.   end
  480.   
  481.   #--------------------------------------------------------------------------
  482.   # ○ 计算呼出对话框的位置
  483.   #--------------------------------------------------------------------------
  484.   def get_fuki_pos(width, height)
  485.    
  486.     # 取得角色
  487.     @character = get_character($mes_id)
  488.     if @character == nil
  489.       # 角色不存在的情况下使用默认信息框
  490.       del_fukidasi
  491.       reset_window
  492.       return
  493.     end
  494.     # 处理坐标
  495.     x = ( @character.real_x - $game_map.display_x + 64 ) * 32 / 128 - (width / 2)
  496.     # 为尽量显示在画面内而移动横坐标
  497.     if x + width > 640
  498.       x = 640 - width
  499.     elsif x < 0
  500.       x = 0
  501.     end
  502.     # 决定窗口位置
  503.     case $game_system.message_position
  504.       when 0  # 上
  505.         y = (@character.real_y - $game_map.display_y + 64) * 32 / 128 - height - FUKI::CHARACTOR_HEIGHT + FUKI::POP_SHIFT_TOP
  506.       when 1  # 中
  507.         y = (480 - height) / 2
  508.         x = (640 - width) / 2
  509.       when 2  # 下
  510.         y =  (@character.real_y - $game_map.display_y + 64) * 32 / 128 + 32 + FUKI::POP_SHIFT_UNDER
  511.     end
  512.     # 纪录文章显示位置
  513.     @message_position = $game_system.message_position
  514.     # 如果选择自动修正,则如果文章会显示到画面外则自动改变窗口的尺寸(高度)
  515.     if FUKI::POS_FIX
  516.       case @message_position
  517.         when 0  # 上
  518.           if y <= 0
  519.             @message_position = 2
  520.             y =  (@character.real_y - $game_map.display_y + 64) * 32 / 128 + 32 + FUKI::POP_SHIFT_UNDER
  521.           end
  522.         when 2  # 下
  523.           if y + height >= 480
  524.             p "上"
  525.             @message_position = 0
  526.             y = (@character.real_y - $game_map.display_y + 64) * 32 / 128 - height - FUKI::CHARACTOR_HEIGHT + FUKI::POP_SHIFT_TOP
  527.           end
  528.       end
  529.     end
  530.     return [x,y]
  531.    
  532.   end
  533.   
  534.   #--------------------------------------------------------------------------
  535.   # ○ 计算尾部图标的位置
  536.   #--------------------------------------------------------------------------
  537.   def get_tale_pos
  538.     case @message_position
  539.       when 0  # 上
  540.         # 处理坐标
  541.         x = ( @character.real_x - $game_map.display_x + 64 ) * 32 / 128 - 16
  542.         # 画面边缘的话则移动位置
  543.         if FUKI::CORNER_SHIFT
  544.           if x == 0
  545.             x = FUKI::SHIFT_PIXEL
  546.           elsif x == 640 - 32
  547.             x = 640 - 32 - FUKI::SHIFT_PIXEL
  548.           end
  549.         end
  550.         y = self.y + self.height - 16
  551.       when 1  # 中
  552.         x = nil
  553.         y = nil
  554.       when 2  # 下
  555.         # 处理坐标
  556.         x = ( @character.real_x - $game_map.display_x + 64 ) * 32 / 128 - 16
  557.         # 画面边缘的话则移动位置
  558.         if FUKI::CORNER_SHIFT
  559.           if x == 0
  560.             x = FUKI::SHIFT_PIXEL
  561.           elsif @tale.x == 640 - 32
  562.             x = 640 - 32 - FUKI::SHIFT_PIXEL
  563.           end
  564.         end
  565.         y = self.y - 16
  566.     end
  567.     return [x,y]
  568.   end

  569.   #--------------------------------------------------------------------------
  570.   # ○ 计算名字窗口的位置
  571.   #--------------------------------------------------------------------------
  572.   def get_name_pos
  573.     case @face_pic_txt
  574.       when 0  # 文字
  575.         x = self.x + FUKI::NAME_SHIFT_X
  576.         y = self.y - FUKI::NAME_FONT_SIZE - 16 + FUKI::NAME_SHIFT_Y
  577.       when 1  # 图片
  578.         if self.x >= @pic_width + 5
  579.           # 默认头像显示在对话框左边
  580.           x = self.x-@pic_width-5
  581.         else
  582.           # 对话框左边放不下时头像显示在右边
  583.           x = self.x + self.width
  584.         end
  585.         y = self.y+self.height/2 - (@pic_height + 5)/2
  586.       end

  587.     return [x,y]
  588.   end
  589.   
  590.   #--------------------------------------------------------------------------
  591.   # ○ 设置角色名字窗口
  592.   #--------------------------------------------------------------------------
  593.   def set_namewindow
  594.    
  595.     # $mes_name为空时不显示角色名字窗口
  596.     if $mes_name == nil or $mes_name == ""
  597.       return
  598.     else
  599.       # 设定变量
  600.       mes_name = $mes_name
  601.       skin = FUKI::NAME_SKIN_NAME != "" ? FUKI::NAME_SKIN_NAME : $game_system.windowskin_name
  602.       
  603.       #判断名称是否有对应的图片"Graphics/heads/" +
  604.       if $game_temp.namebmp[mes_name] == nil then
  605.         sFile = "Graphics/heads/" + mes_name + ".jpg"
  606.       else
  607.         sFile = "Graphics/heads/" + $game_temp.namebmp[mes_name] + ".jpg"
  608.       end
  609.       
  610.       begin
  611.         bmp = Bitmap.new(sFile)
  612.         @face_pic_txt = 1                       #名字窗口使用头像<- bbschat
  613.         
  614.         # 生成头像
  615.         
  616.         @pic_width = bmp.width
  617.         @pic_height = bmp.height
  618.         
  619.         if self.x >= @pic_width + 5
  620.           # 默认头像显示在对话框左边
  621.           name_x = self.x-@pic_width-5
  622.         else
  623.           # 对话框左边放不下时头像显示在右边
  624.           name_x = self.x + self.width
  625.         end
  626.         name_y = self.y+self.height/2 - (@pic_height + 5)/2
  627.         
  628.         # 生成角色头像窗口
  629.         @name_win = Window_Base.new(name_x, name_y, @pic_width + 5, @pic_height + 5)
  630.         @name_win.windowskin = RPG::Cache.windowskin(skin)
  631.         @name_win.back_opacity =0     
  632.         @name_win.z = self.z + 1
  633.         
  634.         @name_contents = Sprite.new
  635.         @name_contents.x = name_x + 2
  636.         @name_contents.y = name_y + 2
  637.         @name_contents.bitmap = bmp
  638.         #@name_contents.z = @name_win.z + 2     #这个用了似乎效果不好<- bbschat
  639.         
  640.       rescue
  641.         
  642.         @face_pic_txt = 0                       #名字窗口使用文字<- bbschat

  643.         # 生成名字
  644.         name_width = mes_name.size / 2 * FUKI::NAME_FONT_SIZE
  645.         name_height = FUKI::NAME_FONT_SIZE
  646.         name_x = self.x + FUKI::NAME_SHIFT_X
  647.         name_y = self.y - name_height - 16 + FUKI::NAME_SHIFT_Y

  648.         # 生成角色名字窗口(只有边框)
  649.         @name_win = Window_Base.new(name_x, name_y, name_width + 16, name_height + 16)
  650.         @name_win.windowskin = RPG::Cache.windowskin(skin)
  651.         @name_win.back_opacity = FUKI::NAME_OPACITY
  652.         @name_win.z = self.z + 1
  653.         
  654.         # 为了使空白比Windows类限定的更小使用双重结构
  655.         @name_contents = Sprite.new
  656.         @name_contents.x = name_x + 12
  657.         @name_contents.y = name_y + 8
  658.         @name_contents.bitmap = Bitmap.new(name_width, name_height)
  659.         @name_contents.z = @name_win.z + 2
  660.         
  661.         # 设定文字色
  662.         nil_color = Color.new(0,0,0,0)
  663.         if FUKI::NAME_COLOR != nil_color
  664.           @name_contents.bitmap.font.color = FUKI::NAME_COLOR
  665.         else
  666.           @name_contents.bitmap.font.color = normal_color
  667.         end
  668.         @name_contents.bitmap.font.size = FUKI::NAME_FONT_SIZE
  669.         # 调整窗口尺寸
  670.         rect = @name_contents.bitmap.text_size(mes_name)
  671.         @name_win.width = rect.width + 32
  672.         # 描画名字
  673.         @name_contents.bitmap.draw_text(rect, mes_name)
  674.       end
  675.     end

  676.   end
  677.   
  678.   #--------------------------------------------------------------------------
  679.   # ○ 释放呼出对话框和角色名字窗口
  680.   #--------------------------------------------------------------------------
  681.   def del_fukidasi
  682.     if @tale != nil
  683.       @tale.dispose
  684.       @tale = nil
  685.     end
  686.     if @name_win != nil
  687.       @name_win.dispose
  688.       @name_win = nil
  689.       @name_contents.dispose
  690.       @name_contents = nil
  691.     end
  692.     self.opacity = 0
  693.     self.x = 80
  694.     self.width = 480
  695.     self.height = 160
  696.     self.contents.dispose
  697.     self.contents = Bitmap.new(width - 32, height - 32)
  698.     self.pause = true
  699.   end
  700.   
  701.   #--------------------------------------------------------------------------
  702.   # ○ 取得角色
  703.   #     parameter : 参数
  704.   #--------------------------------------------------------------------------
  705.   def get_character(parameter)
  706.     # 参数分歧
  707.     case parameter
  708.     when -1  # 玩家
  709.       return $game_player
  710.     when 0   # 该事件
  711.       events = $game_map.events
  712.       return events == nil ? nil : events[$active_event_id]
  713.     else     # 特定事件
  714.       events = $game_map.events
  715.       return events == nil ? nil : events[parameter]
  716.     end
  717.   end
  718.   
  719.   #--------------------------------------------------------------------------
  720.   # ● 设定窗口位置和不透明度
  721.   #--------------------------------------------------------------------------
  722.   def reset_window
  723.     if $game_temp.in_battle
  724.       self.y = 16
  725.     else
  726.       case $game_system.message_position
  727.       when 0  # 上
  728.         self.y = 16
  729.       when 1  # 中
  730.         self.y = 160
  731.       when 2  # 下
  732.         self.y = 304
  733.       end
  734.     end
  735.     if $game_system.message_frame == 0
  736.       self.opacity = 255
  737.     else
  738.       self.opacity = 0
  739.     end
  740.     self.back_opacity = FUKI::MES_OPACITY
  741.   end
  742.   
  743.   #--------------------------------------------------------------------------
  744.   # ● 刷新画面
  745.   #--------------------------------------------------------------------------
  746.   def update
  747.     super
  748.     # 呼出模式下跟随事件移动
  749.     if @tale != nil
  750.       pos = get_fuki_pos(self.width, self.height)
  751.       self.x = pos[0]
  752.       self.y = pos[1]

  753.       tale_pos = get_tale_pos
  754.       @tale.x = tale_pos[0]
  755.       @tale.y = tale_pos[1]
  756.       
  757.       if @name_win != nil
  758.         name_pos = get_name_pos
  759.         @name_win.x = name_pos[0]
  760.         @name_win.y = name_pos[1]
  761.         case @face_pic_txt
  762.           when 0  # 文字
  763.             @name_contents.x = @name_win.x + 12
  764.             @name_contents.y = @name_win.y + 8
  765.           when 1  # 图片
  766.             @name_contents.x = @name_win.x + 2
  767.             @name_contents.y = @name_win.y + 2
  768.           end
  769.       end
  770.     end
  771.    
  772.     # 渐变的情况下
  773.     if @fade_in
  774.       self.contents_opacity += 24
  775.       if @name_win != nil
  776.         @name_win.opacity += 24
  777.       end
  778.       if @tale != nil
  779.         @tale.opacity += 24
  780.       end
  781.       if @input_number_window != nil
  782.         @input_number_window.contents_opacity += 24
  783.       end
  784.       if self.contents_opacity == 255
  785.         @fade_in = false
  786.       end
  787.       return
  788.     end
  789.     # 显示信息中的情况下
  790.     if @contents_drawing
  791.       refresh_drawtext
  792.       return
  793.     end
  794.     # 输入数值的情况下
  795.     if @input_number_window != nil
  796.       @input_number_window.update
  797.       # 确定
  798.       if Input.trigger?(Input::C)
  799.         $game_system.se_play($data_system.decision_se)
  800.         $game_variables[$game_temp.num_input_variable_id] =
  801.           @input_number_window.number
  802.         $game_map.need_refresh = true
  803.         # 释放输入数值窗口
  804.         @input_number_window.dispose
  805.         @input_number_window = nil
  806.         terminate_message
  807.       end
  808.       return
  809.     end
  810.     # 显示信息结束的情况下
  811.     if @contents_showing_end
  812.       # 不是显示选择项且不是呼出对话模式则显示暂停标志
  813.       if $game_temp.choice_max == 0 and @tale == nil
  814.         self.pause = true
  815.       else
  816.         self.pause = false
  817.       end
  818.       # 取消
  819.       if Input.trigger?(Input::B)
  820.         if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0
  821.           $game_system.se_play($data_system.cancel_se)
  822.           $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)
  823.           terminate_message
  824.         end
  825.       end
  826.       # 自动关闭
  827.       @auto_close > 0 ? @auto_close-=1 : @auto_close=-1
  828.       if @auto_close==0
  829.         # 文字还没有处理完的时候
  830.           # 选择项
  831.           if $game_temp.choice_max > 0
  832.             $game_system.se_play($data_system.decision_se)
  833.             $game_temp.choice_proc.call(self.index)
  834.           end
  835.           terminate_message
  836.           del_fukidasi
  837.         end
  838.       # 确定
  839.       if Input.trigger?(Input::C) and @auto_close == -1
  840.         if $game_temp.choice_max > 0
  841.           $game_system.se_play($data_system.decision_se)
  842.           $game_temp.choice_proc.call(self.index)
  843.         end
  844.         terminate_message
  845.         # 释放呼出窗口
  846.         del_fukidasi        
  847.       end      
  848.     return
  849.     end
  850.     # 在渐变以外的状态下有等待显示的信息与选择项的场合
  851.     if @fade_out == false and $game_temp.message_text != nil
  852.       @contents_showing = true
  853.       $game_temp.message_window_showing = true
  854.       reset_window
  855.       refresh_create
  856.       if @name_win != nil
  857.         @name_win.opacity = 0
  858.       end
  859.       if @tale != nil
  860.         @tale.opacity = 0
  861.       end
  862.       Graphics.frame_reset
  863.       self.visible = true
  864.       self.contents_opacity = 0
  865.       if @input_number_window != nil
  866.         @input_number_window.contents_opacity = 0
  867.       end
  868.       @fade_in = true
  869.       return
  870.     end
  871.     # 没有可以显示的信息、但是窗口为可见的情况下
  872.     if self.visible
  873.       @fade_out = true
  874.       self.opacity -= 48
  875.       if @name_win != nil
  876.         @name_win.opacity -= 48
  877.       end
  878.       if @tale != nil
  879.         @tale.opacity -= 48
  880.       end
  881.       if self.opacity == 0
  882.         self.visible = false
  883.         @fade_out = false
  884.         $game_temp.message_window_showing = false
  885.         del_fukidasi
  886.       end
  887.       return
  888.     end
  889.   end
  890.   #--------------------------------------------------------------------------
  891.   # ● 释放
  892.   #--------------------------------------------------------------------------
  893.   def dispose
  894.     terminate_message
  895.     $game_temp.message_window_showing = false
  896.     if @input_number_window != nil
  897.       @input_number_window.dispose
  898.     end
  899.     super
  900.   end
  901.   
  902.   #--------------------------------------------------------------------------
  903.   # ● 信息结束处理
  904.   #--------------------------------------------------------------------------
  905.   def terminate_message
  906.     @auto_close = -1
  907.     self.active = false
  908.     self.pause = false
  909.     self.index = -1
  910.     self.contents.clear
  911.     # 清除显示中标志
  912.     @contents_showing = false
  913.     @contents_showing_end = false
  914.     # 呼叫信息调用
  915.     if $game_temp.message_proc != nil
  916.       $game_temp.message_proc.call
  917.     end
  918.     # 清除文章、选择项、输入数值的相关变量
  919.     $game_temp.message_text = nil
  920.     $game_temp.message_proc = nil
  921.     $game_temp.choice_start = 99
  922.     $game_temp.choice_max = 0
  923.     $game_temp.choice_cancel_type = 0
  924.     $game_temp.choice_proc = nil
  925.     $game_temp.num_input_start = 99
  926.     $game_temp.num_input_variable_id = 0
  927.     $game_temp.num_input_digits_max = 0
  928.     # 释放金钱窗口
  929.     if @gold_window != nil
  930.       @gold_window.dispose
  931.       @gold_window = nil
  932.     end
  933.   end
  934.   
  935.   #--------------------------------------------------------------------------
  936.   # ● 刷新光标矩形
  937.   #--------------------------------------------------------------------------
  938.   def update_cursor_rect
  939.     if @index >= 0
  940.       n = $game_temp.choice_start + @index
  941.       self.cursor_rect.set(8, n * 32, @cursor_width, 32)
  942.     else
  943.       self.cursor_rect.empty
  944.     end
  945.   end
  946.   #--------------------------------------------------------------------------
  947.   # ● 取得普通文字色
  948.   #--------------------------------------------------------------------------
  949.   def normal_color
  950.     nil_color = Color.new(0,0,0,0)
  951.     if FUKI::FUKI_COLOR != nil_color
  952.       color = FUKI::FUKI_COLOR
  953.     else
  954.       color = super
  955.     end
  956.     return color
  957.   end
  958. end

  959. #==============================================================================
  960. # ■ Interpreter
  961. #==============================================================================

  962. class Interpreter
  963.   #--------------------------------------------------------------------------
  964.   # ● 设置事件
  965.   #     event_id : 事件 ID
  966.   #--------------------------------------------------------------------------
  967.   alias setup_fuki setup
  968.   def setup(list, event_id)
  969.     setup_fuki(list, event_id)
  970.     # 如果不是战斗中
  971.     if !($game_temp.in_battle)
  972.       # 记录事件 ID
  973.       $active_event_id = event_id
  974.     end
  975.   end
  976. end

  977. #==============================================================================
  978. # ■ Scene_Map
  979. #==============================================================================

  980. class Scene_Map
  981.   #--------------------------------------------------------------------------
  982.   # ● 主处理
  983.   #--------------------------------------------------------------------------
  984.   def main
  985.     # 生成活动块
  986.     @spriteset = Spriteset_Map.new
  987.     # 生成信息窗口
  988.     @message_window = Window_FukiMessage.new
  989.     # 执行过渡
  990.     Graphics.transition
  991.     # 主循环
  992.     loop do
  993.       # 刷新游戏画面
  994.       Graphics.update
  995.       # 刷新输入信息
  996.       Input.update
  997.       # 刷新画面
  998.       update
  999.       # 如果画面切换的话就中断循环
  1000.       if $scene != self
  1001.         break
  1002.       end
  1003.     end
  1004.     # 准备过渡
  1005.     Graphics.freeze
  1006.     # 释放活动块
  1007.     @spriteset.dispose
  1008.     # 释放信息窗口
  1009.     @message_window.dispose
  1010.     # 标题画面切换中的情况下
  1011.     if $scene.is_a?(Scene_Title)
  1012.       # 淡入淡出画面
  1013.       Graphics.transition
  1014.       Graphics.freeze
  1015.     end
  1016.   end
  1017. end

  1018. #==============================================================================
  1019. # ■ Window_InputNumber
  1020. #==============================================================================

  1021. class Window_InputNumber < Window_Base
  1022.   #--------------------------------------------------------------------------
  1023.   # ● 初始化对像
  1024.   #     digits_max : 位数
  1025.   #--------------------------------------------------------------------------
  1026.   def initialize(digits_max)
  1027.     @digits_max = digits_max
  1028.     @number = 0
  1029.     # 从数字的幅度计算(假定与 0~9 等幅)光标的幅度
  1030.     dummy_bitmap = Bitmap.new(32, 32)
  1031.     dummy_bitmap.font.size = FUKI::MES_FONT_SIZE
  1032.     @cursor_width = dummy_bitmap.text_size("0").width + 8
  1033.     dummy_bitmap.dispose
  1034.     super(0, 0, @cursor_width * @digits_max + 32, 64)
  1035.     self.contents = Bitmap.new(width - 32, height - 32)
  1036.     self.contents.font.size = FUKI::MES_FONT_SIZE
  1037.     self.z += 9999
  1038.     self.opacity = 0
  1039.     @index = 0
  1040.     refresh
  1041.     update_cursor_rect
  1042.   end
  1043. end
复制代码
001-Blue15-top.png 001-Blue15-under.png

  -fk: -azogi:
回复

使用道具 举报

咩

梦石
0
星屑
1640
在线时间
381 小时
注册时间
2010-10-9
回帖
286

开拓者

发表于 2015-6-29 15:57:38 | 显示全部楼层
把fuki那个脚本里面628行那个叫VX什么的字符串改成你想要的窗口皮肤的名字试试

评分

参与人数 1星屑 +150 收起 理由
RyanBern + 150 认可答案

查看全部评分

回复

使用道具 举报

梦石
0
星屑
50
在线时间
36 小时
注册时间
2015-5-22
回帖
20
 楼主| 发表于 2015-6-30 08:40:58 | 显示全部楼层
piaoy 发表于 2015-6-29 15:57
把fuki那个脚本里面628行那个叫VX什么的字符串改成你想要的窗口皮肤的名字试试 ...

3Q 原来是这个问题啊 谢谢大大了
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部