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

Project1

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

[已经解决] 漫画式对话框出现“口”

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
87 小时
注册时间
2011-7-27
帖子
34
跳转到指定楼层
1
发表于 2012-9-16 10:50:44 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 hcm 于 2012-9-17 09:36 编辑

我用fuki对话的解决方式解决,结果不行
  1. class Game_Event < Game_Character
  2.   #===========================================================================
  3.   # 便于返回姓名和修改姓名
  4.   #===========================================================================
  5.   def name
  6.     return @event.name
  7.   end
  8.   def name=(na)
  9.     @event.name = na
  10.   end
  11. end
  12. #==============================================================================
  13. #
  14. #    呼出对话框 ver. 1.31 By パラ犬(日)
  15. #  来自 [url]http://rpg.para.s3p.net/[/url]
  16. #
  17. #  汉化修改 66RPG bbschat(2006.1.5)
  18. #    来自 [url]http://www.66RPG.com/[/url]
  19. #
  20. #    脚本更新:by KKME◎66RPG.com,2007年2月
  21. #
  22. #    脚本更新:by 绫晓露雪萌◎66RPG.com,2007年7月
  23. #
  24. #==============================================================================

  25. module FUKI

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

  28.   # 是否显示尾部图标
  29.   TAIL_SHOW = true
  30.   
  31.   # Skin的设定
  32.   # 使用数据库默认窗口Skin情况下这里使用[""]
  33.   FUKI_SKIN_NAME = "Lang2fk"   # 呼出对话框用Skin
  34.   NAME_SKIN_NAME = "Lang2fk"   # 角色名字窗口用Skin
  35.   
  36.   # 字体大小
  37.   MES_FONT_SIZE = 19    # 呼出对话框
  38.   NAME_FONT_SIZE = 14   # 角色名字窗口
  39.   
  40.   # 字体颜色
  41.   #(设定为 Color.new(0, 0, 0, 0) 表示使用普通文字色)
  42.   FUKI_COLOR = Color.new(0, 0, 0, 255)  # 呼出对话框
  43.   NAME_COLOR = Color.new(0, 0, 0, 255)  # 角色名字窗口
  44.   
  45.   # 窗口透明度
  46.   # 如修改窗口透明度请同时修改尾部箭头图形内部的透明度
  47.   FUKI_OPACITY = 255    # 呼出对话框
  48.   MES_OPACITY = 255     # 默认信息窗口
  49.   NAME_OPACITY = 255    # 角色名字窗口
  50.   
  51.   # 角色名字窗口的相对位置
  52.   NAME_SHIFT_X = 0      # 横坐标
  53.   NAME_SHIFT_Y = 16     # 纵坐标
  54.   
  55.   # 窗口表示时是否根据画面大小自动检查窗口出现的位置,
  56.   # 自动改变位置( true / false )
  57.   # 设置成 true 在某些变态情况下可能出现箭头图标颠倒的问题 <- bbschat <= KKME
  58.   POS_FIX = true

  59.   # 在画面最边缘表示时的稍微挪动
  60.   # 使用圆形Skin的角和方框的角重合的情况下为 true
  61.   CORNER_SHIFT = false
  62.   SHIFT_PIXEL = 4   # true 时挪动的象素
  63.   
  64.   # 角色高度尺寸
  65.   CHARACTOR_HEIGHT = 53
  66.   # 呼出对话框的相对位置(纵坐标)
  67.   POP_SHIFT_TOP = 0         # 表示位置为上的时候
  68.   POP_SHIFT_UNDER = 2       # 表示位置为下的时候
  69.   
  70.   # 信息的表示速度(数字越小速度越快,0为瞬间表示)
  71.   # 游戏中 可随时用数字代入 $mes_speed 来改变消息表示速度。
  72.   MES_SPEED = 3

  73. end


  74. #==============================================================================
  75. # 初始化两个变量,不要动(by KKME◎66RPG.com)
  76. #==============================================================================
  77. $mes_name = ""
  78. $mes_id   = nil


  79. #==============================================================================
  80. # 方便用户同时设置2个常用参数而使用的函数
  81. #==============================================================================
  82. def chat(id = nil,name = "")
  83.   $mes_id = id
  84.   $mes_name = name
  85. end

  86. #==============================================================================
  87. # □ Game_Temp
  88. #==============================================================================

  89. class Game_Temp
  90.   attr_accessor  :namebmp              #保存头像图片的Hash表
  91.   alias initialize_fuki initialize
  92.   def initialize
  93.     initialize_fuki
  94.     # 如果不想使用角色名字直接作为头像文件名
  95.     # 可在这里重新设定角色名字与文件名的对应关系
  96.     @namebmp ={"桃叫兽"=>"TJS"}
  97.   end
  98. end

  99. #==============================================================================
  100. # □ Window_Message
  101. #==============================================================================

  102. class Window_Message < Window_Selectable

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

  600.   #--------------------------------------------------------------------------
  601.   # ○ 计算名字窗口的位置
  602.   #--------------------------------------------------------------------------
  603.   def get_name_pos
  604.     case @face_pic_txt
  605.       when 0  # 文字
  606.         x = self.x + FUKI::NAME_SHIFT_X
  607.         y = self.y - FUKI::NAME_FONT_SIZE - 16 + FUKI::NAME_SHIFT_Y
  608.       when 1  # 图片
  609.         if self.x >= @pic_width + 5
  610.           # 默认头像显示在对话框左边
  611.           x = self.x-@pic_width-5
  612.         else
  613.           # 对话框左边放不下时头像显示在右边
  614.           x = self.x + self.width
  615.         end
  616.         y = self.y+self.height/2 - (@pic_height + 5)/2
  617.       end

  618.     return [x,y]
  619.   end
  620.   
  621.   #--------------------------------------------------------------------------
  622.   # ○ 设置角色名字窗口
  623.   #--------------------------------------------------------------------------
  624.   def set_namewindow
  625.    
  626.     # $mes_name为空时不显示角色名字窗口
  627.     if $mes_name == nil or $mes_name == ""
  628.       return
  629.     else
  630.       # 设定变量
  631.       mes_name = $mes_name
  632.       skin = FUKI::NAME_SKIN_NAME != "" ? FUKI::NAME_SKIN_NAME : $game_system.windowskin_name
  633.       
  634.       #判断名称是否有对应的图片"Graphics/heads/" +
  635.       if $game_temp.namebmp[mes_name] == nil then
  636.         sFile = "Graphics/heads/" + mes_name + ".png"
  637.       else
  638.         sFile = "Graphics/heads/" + $game_temp.namebmp[mes_name] + ".png"
  639.       end
  640.       
  641.       #if FileTest.exist?(sFile) == true then
  642.       begin
  643.                
  644.         @face_pic_txt = 1                       #名字窗口使用头像<- bbschat
  645.         
  646.         # 生成头像
  647.         bmp = Bitmap.new(sFile)
  648.         @pic_width = bmp.width
  649.         @pic_height = bmp.height
  650.         
  651.         self.width += @pic_width
  652.         
  653.         if self.x >= @pic_width + 5
  654.           # 默认头像显示在对话框左边
  655.           name_x = self.x-@pic_width-5
  656.         else
  657.           # 对话框左边放不下时头像显示在右边
  658.           name_x = self.x + self.width
  659.         end
  660.         name_y = self.y+self.height/2 - (@pic_height + 5)/2
  661.         
  662.         # 生成角色头像窗口
  663.         #@name_win = Window_Base.new(name_x, name_y, @pic_width + 5, @pic_height + 5)
  664.         #@name_win.windowskin = RPG::Cache.windowskin(skin)
  665.         #@name_win.opacity =0     
  666.         #@name_win.z = self.z + 1
  667.         @name_contents.dispose if @name_contents != nil
  668.         @name_contents = Sprite.new
  669.         @name_contents.x = self.x + self.width - bmp.width
  670.         @name_contents.y = name_y - 7
  671.         @name_contents.bitmap = bmp
  672.         @name_contents.z = self.z + 3
  673.         @name_contents.opacity = 0
  674.         #self.width += 50
  675.         #@name_contents.z = @name_win.z + 2     #这个用了似乎效果不好<- bbschat
  676.         
  677.       rescue
  678.       end
  679.     end

  680.   end
  681.   
  682.   #--------------------------------------------------------------------------
  683.   # ○ 释放呼出对话框和角色名字窗口
  684.   #--------------------------------------------------------------------------
  685.   def del_fukidasi
  686.     if @tale != nil
  687.       @tale.dispose
  688.       @tale = nil
  689.     end
  690.     if @name_win != nil
  691.       @name_win.dispose
  692.       @name_win = nil
  693.       @name_contents.dispose
  694.       @name_contents = nil
  695.     end
  696.     self.opacity = 0
  697.     self.x = 90
  698.     self.width = 460
  699.     self.height = 120
  700.     self.contents.dispose
  701.     self.contents = Bitmap.new(width - 32, height - 32)
  702.     self.pause = true
  703.   end
  704.   
  705.   #--------------------------------------------------------------------------
  706.   # ○ 取得角色
  707.   #     parameter : 参数
  708.   #--------------------------------------------------------------------------
  709. # def get_character(parameter)
  710.     # 参数分歧
  711. #   case parameter
  712. #   when -1  # 玩家
  713.    #   return $game_player
  714.   #  when 0   # 该事件
  715.   #    events = $game_map.events
  716.   #    return events == nil ? nil : events[$active_event_id]
  717.   #  else     # 特定事件
  718.   #    events = $game_map.events
  719.   #    return events == nil ? nil : events[parameter]
  720.   #  end
  721. # end
  722.    #-------------------------------------------------------------------
  723. # ○ 取得角色
  724. #     parameter : 参数
  725. #-------------------------------------------------------------------
  726. def get_character(parameter)
  727.   # 参数分歧
  728.   case parameter
  729.   when -1  # 玩家
  730.     return $game_player
  731.   when 0   # 该事件
  732.     events = $game_map.events
  733.     return events == nil ? nil : events[$active_event_id]
  734.   else     # 特定事件
  735.     if parameter >0
  736.       events = $game_map.events
  737.       return events == nil ? nil : events[parameter]
  738.     else
  739.       $game_party.return_char(-parameter-2)
  740.     end
  741.   end
  742. end

  743.   #--------------------------------------------------------------------------
  744.   # ● 设定窗口位置和不透明度
  745.   #--------------------------------------------------------------------------
  746.   def reset_window(width = nil, height = nil)
  747.     if $game_temp.in_battle
  748.       self.y = 16
  749.     else
  750.       case $game_system.message_position
  751.       when 0  # 上
  752.         self.y = 16
  753.       when 1  # 中
  754.   #      if height != nil and width != nil
  755.     #      self.y = (480 - height) / 2 - 32
  756.     ##      self.x = (640 - width) / 2
  757.      #     self.width = width
  758.     #      self.height = height
  759.     #      self.contents.dispose
  760.     #      self.contents = Bitmap.new(width - 32, height - 32)
  761.     #    else
  762.           self.y = 160
  763.      #   end
  764.       when 2  # 下
  765.         self.y = 324
  766.       end
  767.     end
  768.     #if $game_system.message_frame == 0
  769.       #self.opacity = 255
  770.     #else
  771.       self.opacity = 0
  772.     #end
  773.     self.back_opacity = FUKI::MES_OPACITY
  774.   end
  775.   
  776.   #--------------------------------------------------------------------------
  777.   # ● 刷新画面
  778.   #--------------------------------------------------------------------------
  779.   def update
  780.     super
  781.     #if @no_term_stop
  782.       #terminate_messageX      
  783.     #end
  784.    
  785.     # 呼出模式下跟随事件移动
  786.     if @tale != nil
  787.       pos = get_fuki_pos(self.width, self.height)
  788.       self.x = pos[0]
  789.       self.y = pos[1]

  790.       tale_pos = get_tale_pos
  791.       @tale.x = tale_pos[0]
  792.       @tale.y = tale_pos[1]
  793.    
  794.       @pic_skin.x = self.x + 2
  795.       @pic_skin.y = self.y + 2
  796.       if @name_contents != nil and !@name_contents.disposed?
  797.       @name_contents.x = self.x + self.width - @name_contents.bitmap.width - 22
  798.       @name_contents.y = self.y + self.height - @name_contents.bitmap.height - 6
  799.       end
  800.    
  801.       if @name_win != nil
  802.         name_pos = get_name_pos
  803.         @name_win.x = name_pos[0]
  804.         @name_win.y = name_pos[1]
  805.         case @face_pic_txt
  806.           when 0  # 文字
  807.             @name_contents.x = @name_win.x + 12
  808.             @name_contents.y = @name_win.y + 8
  809.           when 1  # 图片
  810.             @name_contents.x = @name_win.x + 2
  811.             @name_contents.y = @name_win.y + 2
  812.           end
  813.       end
  814.     end
  815.    
  816.     # 渐变的情况下
  817.     if @fade_in
  818.       #if @no_term_stop
  819.         #@fade_in = false
  820.         #return
  821.       #else        
  822.         self.contents_opacity += 24
  823.         @pic_skin.opacity += 20
  824.         if @name_win != nil
  825.           @name_win.opacity += 24
  826.         end
  827.         if @tale != nil
  828.           @name_contents.opacity += 24 if @name_contents != nil and !@name_contents.disposed?
  829.           @tale.opacity += 20
  830.         end
  831.         if @input_number_window != nil
  832.           @input_number_window.contents_opacity += 24
  833.         end
  834.         if self.contents_opacity == 255
  835.           @fade_in = false
  836.         end
  837.         return
  838.       #end
  839.     end
  840.     # 显示信息中的情况下
  841.     if @contents_drawing
  842.       refresh_drawtext
  843.       return
  844.     end
  845.     # 输入数值的情况下
  846.     if @input_number_window != nil
  847.       @input_number_window.update
  848.       # 确定
  849.       if Input.trigger?(Input::C)
  850.         $game_system.se_play($data_system.decision_se)
  851.         $game_variables[$game_temp.num_input_variable_id] =
  852.           @input_number_window.number
  853.         $game_map.need_refresh = true
  854.         # 释放输入数值窗口
  855.         @input_number_window.dispose
  856.         @input_number_window = nil
  857.         terminate_message
  858.       end
  859.       return
  860.     end
  861.     # 显示信息结束的情况下
  862.     if @contents_showing_end
  863.       # 不是显示选择项且不是呼出对话模式则显示暂停标志
  864.       if $game_temp.choice_max == 0 and @tale == nil
  865.         self.pause = true
  866.       else
  867.         self.pause = false
  868.       end
  869.       # 取消
  870.       if Input.trigger?(Input::B)
  871.         if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0
  872.           $game_system.se_play($data_system.cancel_se)
  873.           $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)
  874.           terminate_message
  875.         end
  876.       end
  877.       # 确定
  878.       if Input.trigger?(Input::C)
  879.         if $game_temp.choice_max > 0
  880.           $game_system.se_play($data_system.decision_se)
  881.           $game_temp.choice_proc.call(self.index)
  882.         end
  883.         terminate_message
  884.         # 释放呼出窗口
  885.         del_fukidasi
  886.       end
  887.       return
  888.     end
  889.     # 在渐变以外的状态下有等待显示的信息与选择项的场合
  890.     if @fade_out == false and $game_temp.message_text != nil
  891.       @contents_showing = true
  892.       $game_temp.message_window_showing = true
  893.       reset_window
  894.       refresh_create
  895.       if @no_term_stop
  896.         self.visible = true        
  897.       else
  898.         if @name_win != nil
  899.           @name_win.opacity = 0
  900.         end
  901.         if @tale != nil
  902.           @tale.opacity = 0
  903.         end
  904.         Graphics.frame_reset
  905.         self.visible = true
  906.         self.contents_opacity = 0
  907.         if @input_number_window != nil
  908.           @input_number_window.contents_opacity = 0
  909.         end
  910.         @fade_in = true
  911.       end
  912.       return
  913.     end
  914.    
  915.     # 没有可以显示的信息、但是窗口为可见的情况下
  916.     unless @no_term_stop
  917.       if self.visible
  918.         @fade_out = true
  919.         self.opacity -= 48
  920.         @name_contents.opacity -= 48 if @name_contents != nil and !@name_contents.disposed?
  921.         @pic_skin.opacity -= 48 if @pic_skin != nil and !@pic_skin.disposed?
  922.         if @name_win != nil
  923.           @name_win.opacity -= 48        
  924.         end
  925.         if @tale != nil
  926.           @tale.opacity -= 48 if @tale != nil and [email protected]?
  927.         end
  928.         if (@name_contents == nil) or @name_contents.disposed? or (@name_contents.opacity == 0)
  929.           self.visible = false
  930.           @name_contents.dispose if @name_contents != nil
  931.           @pic_skin.dispose
  932.           @fade_out = false
  933.           $game_temp.message_window_showing = false
  934.           del_fukidasi
  935.         end
  936.         return
  937.       end
  938.     else
  939.       $game_temp.message_window_showing = false   
  940.     end
  941.    
  942.   end
  943.   
  944.   #--------------------------------------------------------------------------
  945.   # ● 释放
  946.   #--------------------------------------------------------------------------
  947.   def dispose
  948.     terminate_message
  949.     $game_temp.message_window_showing = false
  950.     if @input_number_window != nil
  951.       @input_number_window.dispose
  952.     end
  953.     super
  954.   end
  955.   
  956.   #--------------------------------------------------------------------------
  957.   # ● 信息结束处理
  958.   #--------------------------------------------------------------------------
  959.   def terminate_message
  960.     self.active = false
  961.     self.pause = false
  962.     self.index = -1
  963.     self.contents.clear
  964.     # 清除显示中标志
  965.     @contents_showing = false
  966.     @contents_showing_end = false
  967.     unless @kkme_name == "" or @kkme_name == nil
  968.       $mes_name = ""
  969.       @kkme_name = ""
  970.     end
  971.     # 呼叫信息调用
  972.     if $game_temp.message_proc != nil
  973.       $game_temp.message_proc.call
  974.     end
  975.     # 清除文章、选择项、输入数值的相关变量
  976.     $game_temp.message_text = nil
  977.     $game_temp.message_proc = nil
  978.     $game_temp.choice_start = 99
  979.     $game_temp.choice_max = 0
  980.     $game_temp.choice_cancel_type = 0
  981.     $game_temp.choice_proc = nil
  982.     $game_temp.num_input_start = 99
  983.     $game_temp.num_input_variable_id = 0
  984.     $game_temp.num_input_digits_max = 0
  985.     # 释放金钱窗口
  986.     if @gold_window != nil
  987.       @gold_window.dispose
  988.       @gold_window = nil
  989.     end
  990.     @no_term_stop = false
  991.     @save_x = 0
  992.     @save_y = 0
  993.   end

  994.   #--------------------------------------------------------------------------
  995.   # ● ★信息结束处理★
  996.   #--------------------------------------------------------------------------
  997.   def terminate_messageX
  998.     self.active = false
  999.     self.pause = false
  1000.     self.index = -1
  1001.     # 清除显示中标志
  1002.     @contents_showing = false
  1003.     @contents_showing_end = false
  1004.     # 呼叫信息调用
  1005.     if $game_temp.message_proc != nil
  1006.       $game_temp.message_proc.call
  1007.     end
  1008.     # 清除文章、选择项、输入数值的相关变量
  1009.     $game_temp.message_text = nil
  1010.     $game_temp.message_proc = nil
  1011.     @no_term_stop = true
  1012.   end
  1013.   
  1014.   def clear
  1015.     self.contents.clear   
  1016.     @save_x = 0
  1017.     @save_y = 0
  1018.   end
  1019.   #--------------------------------------------------------------------------
  1020.   # ● 刷新光标矩形
  1021.   #--------------------------------------------------------------------------
  1022.   def update_cursor_rect
  1023.     if @index >= 0
  1024.       n = $game_temp.choice_start + @index
  1025.       self.cursor_rect.set(8, n * 32, @cursor_width, 32)
  1026.     else
  1027.       self.cursor_rect.empty
  1028.     end
  1029.   end
  1030.   #--------------------------------------------------------------------------
  1031.   # ● 取得普通文字色
  1032.   #--------------------------------------------------------------------------
  1033.   def normal_color
  1034.     nil_color = Color.new(0,0,0,255)
  1035.     if FUKI::FUKI_COLOR != nil_color
  1036.       color = FUKI::FUKI_COLOR
  1037.     else
  1038.       color = super
  1039.     end
  1040.     return color
  1041.   end
  1042. end

复制代码

Lv1.梦旅人

梦石
0
星屑
50
在线时间
251 小时
注册时间
2009-11-13
帖子
453
2
发表于 2012-9-16 11:09:16 | 只看该作者
本帖最后由 hcm 于 2012-9-17 09:35 编辑

我记得这是rpg游戏制作大师版本的问题,原脚本是1.02,你用的应该是1.03的,解决在搜索里搜。
这是我自己用的,没有问题。
  1. #============================================================================
  2. # 66加强对话框Fuki对话框整合+附送功能
  3. # By whbm
  4. #============================================================================

  5. #   说明:
  6. #     这是一个整合了66加强对话框和Fuki对话框功能脚本,你可以靠改变开关来切换
  7. #     两个脚本。
  8.      
  9. #     附送功能:
  10. #     在对话中按enter键跳过打字效果

  11. #   33号开关控制对话框的切换:
  12. #     打开--使用66加强对话框
  13. #     关闭--使用Fuki对话框
  14. #   34号开关控制附送功能的打开与关闭:
  15. #     打开--使用附送功能
  16. #     关闭--不使用附送功能

  17. #============================================================================
  18. # 66加强对话框说明--66rpg
  19. #============================================================================

  20. #默认为一个字一个字的方式,如果需要一次全部显示,
  21. #请在游戏中使用脚本:$game_system.typing = true
  22.       
  23. #默认对话字没有声音,如果需要声音,
  24. #请在游戏中使用脚本:$game_system.soundname_on_speak = "这里输入文件名"
  25. #我唯一一个见过“胡乱配音”的游戏是天使帝国2代,该游戏说话的时候每个字符随机发一个外星语音

  26. # 其他在对话中可以使用的功能:
  27.   
  28. # \n[1]:显示1号角色的姓名

  29. # \name[李逍遥]:显示一个“李逍遥”方框,表示说话人姓名

  30. # \p[1]:对话框出现在1号事件的上方
  31. # \p[0]:主人公上方出现对话框
  32. #——————————————————使用\p功能后可以自动调整对话框大小

  33. # \\:显示"\"这个符号

  34. # \v[1] :显示变量1

  35. # \v[a1] :显示防具1

  36. # \v[w1] :显示武器1

  37. # \v[i1] :显示物品1

  38. # \v[s1] :显示特技1

  39. # \c[1-8]:更改颜色

  40. # \g:显示金钱窗口

  41. # \a[SE文件名]:对话的时候播放SE

  42. # \s[1-19]:更改弹字的速度

  43. # \.   :停顿一刹那(1、2帧)
  44. # \|   :停顿片刻(20帧)

  45. # \>   :文字不用打字方式
  46. # \<   :文字使用打字方式

  47. # \!   :等待玩家按回车再继续
  48. # \~   :文字直接消失

  49. # \I   :下一行从这个位置开始

  50. # \o[123]:文字透明度改为123,模拟将死之人(汗)

  51. # \h[12]:改用12号字

  52. # \b[50]:空50象素

  53. # \K[今天天气不错]:在出现“今天天气不错”这几个字的时候播放$game_system.soundname_on_speak设置的音效

  54. # \L[001]:在左边显示图片“Graphics/battlers/66rpg_001_h.png”
  55. # \R[001]:在右边显示图片“Graphics/battlers/66rpg_001_h.png”

  56. # \Lk:清除左边的图像
  57. # \Rk:清除右边的图像







  58. #============================================================================
  59. # Fuki对话框说明--bbschat
  60. #============================================================================
  61. #
  62. #    呼出对话框 ver. 1.31 By パラ犬(日)
  63. #  来自 [url]http://rpg.para.s3p.net/[/url]
  64. #
  65. #  汉化修改 66RPG bbschat(2006.1.5)
  66. #    来自
  67. #
  68. #    ●准备工作-窗口Skin
  69. #
  70. #    首先,确认自己使用的对话框窗口Skin,(数据库-系统-窗口外观图形)
  71. #    然后根据该窗口Skin制作对话框尾部使用的两个箭头图形
  72. #    尾部箭头图形命名方式:“窗口skin名-top”,“窗口skin名-under”
  73. #    将该图形文件存放在“Graphics/Windowskins”文件夹下。
  74. #
  75. #    本演示游戏内置2套窗口和箭头图形,
  76. #    一套是游戏默认的“001-Blue01”,一套是定制的“fk”
  77. #    玩家可以根据自己的需要参照样本定制自己的呼出对话框窗口Skin。
  78. #
  79. #    ●呼出对话框使用方法
  80. #
  81. #    在事件命令行使用[脚本]将事件ID代入[$mes_id]
  82. #    该事件就可以使用呼出对话框了。
  83. #   (举例:$mes_id=4)
  84. #
  85. #    ID 代入 -1 表示玩家,代入 0 表示事件自身。
  86. #    代入 nil 或者 "" 则返回成通常的信息窗口。
  87. #    对话框的表示位置可以通过事件的“更改文章选项”来设定(上、中、下)。
  88. #    表示位置为“中央”的话,不管事件位置在哪里,对话框都将显示在画面中央。
  89. #
  90. #    ●角色名字窗口的使用文字的方法
  91. #
  92. #    在事件命令行使用[脚本]将文字列代入[$mes_name]
  93. #    对话框就会显示角色名字窗口
  94. #   (举例:$mes_name="阿尔西斯")
  95. #    代入 nil 或者 "" 则不显示角色名字窗口。
  96. #
  97. #    以上两个机能是独立的,所以可以单独使用
  98. #
  99. #   $mes_id=(ID) + $mes_name="名字"  :呼出对话框显示 + 角色名字窗口
  100. #   $mes_id=(ID) + $mes_name=""      :呼出对话框显示(没有角色名字)
  101. #   $mes_id=nil  + $mes_name="名字"  :默认信息窗口 + 角色名字窗口
  102. #   $mes_id=nil  + $mes_name=""      :默认信息窗口(没有角色名字)
  103. #
  104. #    ●角色名字窗口使用角色图片的方法(汉化特别追加功能,原脚本只能使用文字)
  105. #   
  106. #    如果能在对应文件夹中找到文件名和角色名字相同的图片,   
  107. #    则角色名字窗口显示角色头像图片,角色图片最好能包括角色的名字。
  108. #    默认头像图片保存目录为“Graphics/Heads/”,玩家可自行修改。
  109. #
  110. #    如果不想使用角色名字直接作为头像文件名。
  111. #    可以使用下面在 Game_Temp 类里增加的namebmp属性。
  112. #    重新设定角色名字与文件名的对应关系。
  113. #
  114. #    ●信息表示速度的变更方法
  115. #
  116. #    在事件命令行使用[脚本]将数值代入[$mes_speed]
  117. #    速度为 0 即瞬间显示全部信息,数字越大,信息表示速度越慢。
  118. #   (举例:$mes_speed=1)
  119. #
  120. #    ●其他设置
  121. #
  122. #    请参照下面的注释
  123. #
  124. #    补一句,用脚本chat(id,"名字")就相当于$mes_id=ID;$mes_name="名字"
  125. #==============================================================================

  126. module FUKI

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

  129. # 是否显示尾部图标
  130. TAIL_SHOW = true

  131. # Skin的设定
  132. # 使用数据库默认窗口Skin情况下这里使用[""]
  133. FUKI_SKIN_NAME = "001-Blue01"   # 呼出对话框用Skin
  134. NAME_SKIN_NAME = "001-Blue01"   # 角色名字窗口用Skin

  135. # 字体大小
  136. MES_FONT_SIZE = 22    # 呼出对话框
  137. NAME_FONT_SIZE = 14   # 角色名字窗口

  138. # 字体颜色
  139. #(设定为 Color.new(0, 0, 0, 0) 表示使用普通文字色)
  140. FUKI_COLOR = Color.new(255, 255, 255, 255)  # 呼出对话框
  141. NAME_COLOR = Color.new(255, 255, 255, 255)  # 角色名字窗口

  142. # 窗口透明度
  143. # 如修改窗口透明度请同时修改尾部箭头图形内部的透明度
  144. FUKI_OPACITY = 255    # 呼出对话框
  145. MES_OPACITY = 255     # 默认信息窗口
  146. NAME_OPACITY = 255    # 角色名字窗口

  147. # 角色名字窗口的相对位置
  148. NAME_SHIFT_X = 0      # 横坐标
  149. NAME_SHIFT_Y = 16     # 纵坐标

  150. # 窗口表示时是否根据画面大小自动检查窗口出现的位置,
  151. # 自动改变位置( true / false )
  152. # 设置成 true 可能出现箭头图标颠倒的问题 <- bbschat
  153. POS_FIX = false

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

  158. # 角色高度尺寸
  159. CHARACTOR_HEIGHT = 48
  160. # 呼出对话框的相对位置(纵坐标)
  161. POP_SHIFT_TOP = 0         # 表示位置为上的时候
  162. POP_SHIFT_UNDER = 0       # 表示位置为下的时候

  163. # 信息的表示速度(数字越小速度越快,0为瞬间表示)
  164. # 游戏中 可随时用数字代入 $mes_speed 来改变消息表示速度。
  165. MES_SPEED = 1

  166. end

  167. #==============================================================================
  168. # 方便用户同时设置2个常用参数而使用的函数
  169. #==============================================================================
  170. def chat(id = 0,name = "")
  171. $mes_id = id
  172. $mes_name = name
  173. end

  174. #==============================================================================
  175. # □ Game_Temp
  176. #==============================================================================

  177. class Game_Temp
  178. attr_accessor  :namebmp              #保存头像图片的Hash表
  179. alias initialize_fuki initialize
  180. def initialize
  181.    initialize_fuki
  182.    # 如果不想使用角色名字直接作为头像文件名
  183.    # 可在这里重新设定角色名字与文件名的对应关系
  184.    @namebmp ={"玩家"=>"001-Player-Face", "维斯特"=>"002-Player-Face"}
  185. end
  186. end
  187. #==============================================================================
  188. # □ Game_System
  189. #==============================================================================
  190. class Game_System
  191. attr_accessor :typing
  192. attr_accessor :soundname_on_speak
  193. alias carol3_ini initialize
  194. def initialize
  195.    carol3_ini
  196.    @typing = true
  197.    @soundname_on_speak = nil
  198. end
  199. end
  200. #==============================================================================
  201. # □ Window_FukiMessage
  202. #==============================================================================

  203. class Window_FukiMessage < Window_Selectable

  204. #--------------------------------------------------------------------------
  205. # ● 初始化状态
  206. #--------------------------------------------------------------------------
  207. def initialize
  208.    super(0, 304, 480, 160)
  209.    self.contents = Bitmap.new(width - 32, height - 32)
  210.    self.visible = false
  211.    self.z = 9998
  212.    @fade_in = false
  213.    @fade_out = false
  214.    @contents_showing = false
  215.    @cursor_width = 0
  216.    self.active = false
  217.    self.index = -1
  218.    #........................................................................
  219.    if $game_system.soundname_on_speak == nil then
  220.      $game_system.soundname_on_speak = ""
  221.    end
  222.    @opacity_text_buf = Bitmap.new(32, 32)
  223.    #........................................................................
  224.    @w = 0
  225.    @h = 0
  226.    @wait = 0
  227.    @dx = 0
  228.    @dy = 0
  229.    $mes_speed = FUKI::MES_SPEED
  230. end

  231. #--------------------------------------------------------------------------
  232. # ○ 决定窗口尺寸并生成窗口
  233. #--------------------------------------------------------------------------
  234. def refresh_create
  235.    self.contents.clear
  236.    self.contents.font.color = normal_color
  237.    self.contents.font.size = FUKI::MES_FONT_SIZE
  238.    # 取得窗口尺寸
  239.    get_windowsize
  240.    w = @w + 32 + 8
  241.    h = @h * (self.contents.font.size + 10) + 26
  242.    # 生成呼出窗口
  243.    set_fukidasi(self.x, self.y, w, h)
  244.    # 生成角色名字窗口
  245.    set_namewindow
  246.    # 初始化信息表示使用的变量
  247.    @dx = @dy = 0
  248.    @cursor_width = 0
  249.    @contents_drawing = true
  250.    # 瞬间表示的情况下
  251.    if $mes_speed == 0
  252.      # 循环信息描绘处理
  253.      while $game_temp.message_text != ""
  254.        draw_massage
  255.      end
  256.      draw_opt_text
  257.      @contents_showing_end = true
  258.      @contents_drawing = false
  259.    else
  260.      # 一个一个描绘文字
  261.      refresh_drawtext
  262.    end
  263. end

  264. #--------------------------------------------------------------------------
  265. # ○ 一个一个描绘文字
  266. #--------------------------------------------------------------------------
  267. def refresh_drawtext
  268.    #........................................................................
  269.    if Input.trigger?(Input::C) and $game_switches[34]
  270.      # 循环信息描绘处理
  271.      while $game_temp.message_text != ""
  272.        draw_massage
  273.      end
  274.      draw_opt_text
  275.      @contents_showing_end = true
  276.      @contents_drawing = false
  277.    end
  278.    #........................................................................
  279.    if $game_temp.message_text != nil
  280.      if @wait > 0
  281.        @wait -= 1
  282.      elsif @wait == 0
  283.        # 描绘处理
  284.        draw_massage
  285.        @wait = $mes_speed
  286.      end
  287.    end
  288.    # 描绘结束
  289.    if $game_temp.message_text == ""
  290.      draw_opt_text
  291.      @contents_showing_end = true
  292.      @contents_drawing = false
  293.    end
  294. end

  295. #--------------------------------------------------------------------------
  296. # ○ 66rpg-refresh
  297. #--------------------------------------------------------------------------
  298.   def refresh
  299.     # 初期化
  300.     self.contents.clear
  301.     self.contents.font.color = normal_color
  302.     self.contents.font.size = Font.default_size
  303.     @x = @y = @max_x = @max_y = @indent = @lines = 0
  304.     @left_keep = @right_keep = false
  305.     @face_indent = 0
  306.     @opacity = 255
  307.     @cursor_width = 0
  308.     @write_speed = 0
  309.     @write_wait = 0
  310.     @mid_stop = false
  311.     @face_file = nil
  312.     @popchar = -2
  313.     if $game_temp.choice_start == 0
  314.       @x = 8
  315.     end
  316.     if $game_temp.message_text != nil
  317.       @now_text = $game_temp.message_text
  318.       #——头像设置
  319.       if (/\\[Ff]\[(.+?)\]/.match(@now_text))!=nil then
  320.         @face_file = $1 + ".png"
  321.         @x = @face_indent = 128
  322.         if FileTest.exist?("Graphics/Pictures/" + $1 + ".png")
  323.           self.contents.blt(16, 16, RPG::Cache.picture(@face_file), Rect.new(0, 0, 96, 96))
  324.         end
  325.         @now_text.gsub!(/\\[Ff]\[(.*?)\]/) { "" }
  326.       end
  327.       #——左半身像设置
  328.       if (/\\[Ll]\[(.+?)\]/.match(@now_text))!=nil then
  329.         @face = "66rpg_" + $1 + "_h.png"
  330.         if $加密 == true
  331.           if @left_picture != nil
  332.             @left_picture.dispose
  333.           end
  334.           @left_picture = Sprite.new
  335.           @left_picture.bitmap = Bitmap.new("Graphics/battlers/#{@face}")
  336.           @left_picture.y = [email]480-@left_picture.bitmap.height[/email]
  337.           @left_picture.x = 0
  338.           @left_picture.mirror = true
  339.           @now_text.gsub!(/\\[Ll]\[(.*?)\]/) { "" }
  340.         else         
  341.           if FileTest.exist?("Graphics/battlers/#{@face}")
  342.             if @left_picture != nil
  343.               @left_picture.dispose
  344.             end
  345.             @left_picture = Sprite.new
  346.             @left_picture.bitmap = Bitmap.new("Graphics/battlers/#{@face}")
  347.             @left_picture.y = [email]480-@left_picture.bitmap.height[/email]
  348.             @left_picture.x = 0
  349.             @left_picture.mirror = true
  350.             @now_text.gsub!(/\\[Ll]\[(.*?)\]/) { "" }
  351.           end
  352.         end        
  353.       end
  354.       #——右半身像设置
  355.       if (/\\[Rr]\[(.+?)\]/.match(@now_text))!=nil then
  356.         @face = "66rpg_" + $1 + "_h.png"
  357.         if $加密 == true
  358.           if @right_picture != nil
  359.             @right_picture.dispose
  360.           end
  361.           @right_picture = Sprite.new
  362.           @right_picture.bitmap = Bitmap.new("Graphics/battlers/#{@face}")
  363.           @right_picture.y = [email]480-@right_picture.bitmap.height[/email]
  364.           @right_picture.x = [email]640-@right_picture.bitmap.width[/email]
  365.           @now_text.gsub!(/\\[Rr]\[(.*?)\]/) { "" }
  366.         else
  367.           if FileTest.exist?("Graphics/battlers/#{@face}")
  368.             if @right_picture != nil
  369.               @right_picture.dispose
  370.             end
  371.             @right_picture = Sprite.new
  372.             @right_picture.bitmap = Bitmap.new("Graphics/battlers/#{@face}")
  373.             @right_picture.y = [email]480-@right_picture.bitmap.height[/email]
  374.             @right_picture.x = [email]640-@right_picture.bitmap.width[/email]
  375.             @now_text.gsub!(/\\[Rr]\[(.*?)\]/) { "" }
  376.           end
  377.         end
  378.       end
  379.       if (/\\[Rr]k/.match(@now_text)) != nil
  380.         @right_keep = true
  381.         @now_text.sub!(/\\[Rr]k/) { "" }
  382.       end
  383.       if (/\\[Ll]k/.match(@now_text)) != nil
  384.         @left_keep = true
  385.         @now_text.sub!(/\\[Ll]k/) { "" }
  386.       end
  387.       # 显示人物姓名
  388.       name_window_set = false
  389.       if (/\\[Nn]ame\[(.+?)\]/.match(@now_text)) != nil
  390.         name_window_set = true
  391.         name_text = $1
  392.         @now_text.sub!(/\\[Nn]ame\[(.*?)\]/) { "" }
  393.       end
  394.       
  395.       # 文字位置的判定
  396.       if (/\\[Pp]\[([-1,0-9]+)\]/.match(@now_text))!=nil then
  397.         @popchar = $1.to_i
  398.         if @popchar == -1
  399.           @x = @indent = 48
  400.           @y = 4
  401.         end
  402.         @now_text.gsub!(/\\[Pp]\[([-1,0-9]+)\]/) { "" }
  403.       end
  404.       
  405.       # 开始
  406.       begin
  407.         last_text = @now_text.clone
  408.         @now_text.gsub!(/\\[Vv]\[([IiWwAaSs]?)([0-9]+)\]/) { convart_value($1, $2.to_i) }
  409.       end until @now_text == last_text
  410.       @now_text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  411.       $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  412.     end
  413.     @now_text.gsub!(/\\\\/) { "\000" }
  414.     @now_text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
  415.     @now_text.gsub!(/\\[Gg]/) { "\002" }
  416.     @now_text.gsub!(/\\[Ss]\[([0-9]+)\]/) { "\003[#{$1}]" }
  417.     @now_text.gsub!(/\\[Aa]\[(.*?)\]/) { "\004[#{$1}]" }
  418.     @now_text.gsub!(/\\[.]/) { "\005" }
  419.     @now_text.gsub!(/\\[|]/) { "\006" }

  420.     @now_text.gsub!(/\\[>]/) { "\016" }
  421.     @now_text.gsub!(/\\[<]/) { "\017" }
  422.     @now_text.gsub!(/\\[!]/) { "\020" }
  423.     @now_text.gsub!(/\\[~]/) { "\021" }
  424.    
  425.     @now_text.gsub!(/\\[Ii]/) { "\023" }
  426.     @now_text.gsub!(/\\[Oo]\[([0-9]+)\]/) { "\024[#{$1}]" }
  427.     @now_text.gsub!(/\\[Hh]\[([0-9]+)\]/) { "\025[#{$1}]" }
  428.     @now_text.gsub!(/\\[Bb]\[([0-9]+)\]/) { "\026[#{$1}]" }
  429.     @now_text.gsub!(/\\[Kk]\[(.*?)\]/) { "\027[#{$1}]" }
  430.     if @popchar >= 0
  431.       @text_save = @now_text.clone
  432.       @max_x = 0
  433.       @max_y = 4
  434.       for i in 0..3
  435.         line = @now_text.split(/\n/)[3-i]
  436.         @max_y -= 1 if line == nil and @max_y <= 4-i
  437.         next if line == nil
  438.         cx = contents.text_size(line).width
  439.         @max_x = cx if cx > @max_x
  440.       end
  441.       self.width = @max_x + 48 + @face_indent
  442.       self.height = (@max_y - 1) * 32 + 64
  443.     else
  444.       @max_x = self.width - 32 - @face_indent
  445.     end
  446.     reset_window
  447.       if name_window_set
  448.         off_x = 0
  449.         off_y = -40
  450.         space = 2
  451.         x = self.x + off_x - space / 2
  452.         y = self.y + off_y - space / 2
  453.         w = self.contents.text_size(name_text).width + 26 + space
  454.         h = 40 + space
  455.         @name_window_frame = Window_Frame.new(x, y, w, h)
  456.         @name_window_frame.z = self.z + 1
  457.         x = self.x + off_x + 4
  458.         y = self.y + off_y
  459.         @name_window_text = Air_Text.new(x+4, y+6, name_text)
  460.         @name_window_text.z = self.z + 2
  461.       end
  462.     end
  463.     reset_window
  464.     if $game_temp.choice_max > 0
  465.       @item_max = $game_temp.choice_max
  466.       self.active = true
  467.       self.index = 0
  468.     end
  469.     if $game_temp.num_input_variable_id > 0
  470.       digits_max = $game_temp.num_input_digits_max
  471.       number = $game_variables[$game_temp.num_input_variable_id]
  472.       @input_number_window = Window_InputNumber.new(digits_max)
  473.       @input_number_window.number = number
  474.       @input_number_window.x = self.x + 8
  475.       @input_number_window.y = self.y + $game_temp.num_input_start * 32
  476.     end
  477.   end



  478. #==============================================================================
  479. # ■ Window_Frame (枠だけで中身の無いウィンドウ)
  480. #==============================================================================
  481. class Window_Frame < Window_Base
  482. #--------------------------------------------------------------------------
  483. # ● オブジェクト初期化
  484. #--------------------------------------------------------------------------
  485. def initialize(x, y, width, height)
  486.    super(x, y, width, height)
  487.    self.contents = nil
  488.    self.back_opacity = 100
  489. end
  490. #--------------------------------------------------------------------------
  491. # ● 解放
  492. #--------------------------------------------------------------------------
  493. def dispose
  494.    super
  495. end
  496. end

  497. #==============================================================================
  498. # ■ Air_Text (何も無いところに文字描写 = 枠の無い瞬間表示メッセージウィンドウ)
  499. #==============================================================================
  500. class Air_Text < Window_Base
  501.   #--------------------------------------------------------------------------
  502.   # ● オブジェクト初期化
  503.   #--------------------------------------------------------------------------
  504.   def initialize(x, y, designate_text)
  505.     super(x-16, y-16, 32 + designate_text.size * 12, 56)
  506.     self.opacity = 0
  507.     self.back_opacity = 0
  508.     self.contents = Bitmap.new(self.width - 32, self.height - 32)
  509.     w = self.contents.width
  510.     h = self.contents.height
  511.     self.contents.draw_text(0, 0, w, h, designate_text)
  512.   end
  513.   #--------------------------------------------------------------------------
  514.   # ● 解放
  515.   #--------------------------------------------------------------------------
  516.   def dispose
  517.     self.contents.clear
  518.     super
  519.   end
  520. end


  521. #--------------------------------------------------------------------------
  522. # ○ 取得窗口尺寸
  523. #--------------------------------------------------------------------------
  524. def get_windowsize
  525.    x = y = 0
  526.    @h = @w = 0
  527.    @cursor_width = 0
  528.    # 有选择项的话,处理字的缩进
  529.    if $game_temp.choice_start == 0
  530.      x = 16
  531.    end
  532.    # 有等待显示的文字的情况下
  533.    if $game_temp.message_text != nil
  534.    text = $game_temp.message_text.clone
  535.      # 限制文字处理
  536.      begin
  537.        last_text = text.clone
  538.        text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
  539.      end until text == last_text
  540.      text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  541.        $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  542.      end
  543.      # 为了方便、将 "\\\\" 变换为 "\000"
  544.      text.gsub!(/\\\\/) { "\000" }
  545.      # "\\C" 变为 "\001" 、"\\G" 变为 "\002"
  546.      text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001" }
  547.      text.gsub!(/\\[Gg]/) { "\002" }
  548.      # c 获取 1 个字 (如果不能取得文字就循环)
  549.      while ((c = text.slice!(/./m)) != nil)
  550.        # \\ 的情况下
  551.        if c == "\000"
  552.          # 还原为本来的文字
  553.          c = "\\"
  554.        end
  555.        # \C[n] 或者 \G 的情况下
  556.        if c == "\001" or c == "\002"
  557.          # 下面的文字
  558.          next
  559.        end
  560.        # 另起一行文字的情况下
  561.        if c == "\n"
  562.          # y 累加 1
  563.          y += 1
  564.          # 取得纵横尺寸
  565.          @h = y
  566.          @w = x > @w ? x : @w
  567.          if y >= $game_temp.choice_start
  568.            @w = x + 8 > @w ? x + 8 : @w
  569.          end
  570.          x = 0
  571.          # 移动到选择项的下一行
  572.          if y >= $game_temp.choice_start
  573.            x = 8
  574.          end
  575.          # 下面的文字
  576.          next
  577.        end
  578.        # x 为要描绘文字的宽度加法运算
  579.        x += self.contents.text_size(c).width
  580.      end
  581.    end
  582.    # 输入数值的情况
  583.    if $game_temp.num_input_variable_id > 0
  584.      digits_max = $game_temp.num_input_digits_max
  585.      number = $game_variables[$game_temp.num_input_variable_id]
  586.      @h += 1
  587.      x = digits_max * self.contents.font.size + 16
  588.      @w = x > @w ? x : @w
  589.    end
  590. end

  591. #--------------------------------------------------------------------------
  592. # ○ 描绘信息处理
  593. #--------------------------------------------------------------------------
  594. def draw_massage
  595.    # 有等待显示的文字的情况下
  596.    if $game_temp.message_text != nil
  597.      text = $game_temp.message_text
  598.      # 限制文字处理
  599.      begin
  600.        last_text = text.clone
  601.        text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
  602.      end until text == last_text
  603.      text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  604.        $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  605.      end
  606.      # 为了方便、将 "\\\\" 变换为 "\000"
  607.      text.gsub!(/\\\\/) { "\000" }
  608.      # "\\C" 变为 "\001"、"\\G" 变为 "\002"
  609.      text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
  610.      text.gsub!(/\\[Gg]/) { "\002" }
  611.      # c 获取 1 个字
  612.      if ((c = text.slice!(/./m)) != nil)
  613.        # 选择项的情况
  614.        if @dy >= $game_temp.choice_start
  615.          # 处理字的缩进
  616.          @dx = 8
  617.          # 描绘文字
  618.          self.contents.draw_text(4 + @dx, 32 * @dy, 40, 32, c)
  619.          # x 为要描绘文字宽度的加法运算
  620.          @dx += self.contents.text_size(c).width
  621.          # 循环
  622.          while ((c = text.slice!(/./m)) != "\n")
  623.            # 描绘文字
  624.            self.contents.draw_text(4 + @dx, 32 * @dy, 40, 32, c)
  625.            # x 为要描绘文字宽度的加法运算
  626.            @dx += self.contents.text_size(c).width
  627.          end
  628.          if c == "\n"
  629.            # 更新光标宽度
  630.            @cursor_width = [@cursor_width, @dx].max
  631.            # dy 累加 1
  632.            @dy += 1
  633.            @dx = 0
  634.          end
  635.          return
  636.        end
  637.        # \\ 的情况下
  638.        if c == "\000"
  639.          # 还原为本来的文字
  640.          c = "\\"
  641.        end
  642.        #\C[n] 的情况下
  643.        if c == "\001"
  644.          # 更改文字色
  645.          text.sub!(/\[([0-9]+)\]/, "")
  646.          color = $1.to_i
  647.          if color >= 0 and color <= 7
  648.            self.contents.font.color = text_color(color)
  649.          end
  650.        end
  651.        # \G 的情况下
  652.        if c == "\002"
  653.          # 生成金钱窗口
  654.          if @gold_window == nil
  655.            @gold_window = Window_Gold.new
  656.            @gold_window.x = 560 - @gold_window.width
  657.            if $game_temp.in_battle
  658.              @gold_window.y = 192
  659.            else
  660.              @gold_window.y = self.y >= 128 ? 32 : 384
  661.            end
  662.            @gold_window.opacity = self.opacity
  663.            @gold_window.back_opacity = self.back_opacity
  664.          end
  665.        end
  666.        # 另起一行文字的情况下
  667.        if c == "\n"
  668.          # dy 累加 1
  669.          @dy += 1
  670.          @dx = 0
  671.        end
  672.        # 描绘文字
  673.        self.contents.font.size = FUKI::MES_FONT_SIZE
  674.        font_size = self.contents.font.size
  675.        if c == "\001" or c == "\002" or c == "\003" or c == "\n"
  676.          c = ""
  677.        else
  678.          self.contents.draw_text(4+@dx, (font_size+10)*@dy, font_size, font_size, c)
  679.        end
  680.        # dx 为要描绘文字的宽度加法运算
  681.        @dx += self.contents.text_size(c).width
  682.      end
  683.    end
  684. end

  685. #--------------------------------------------------------------------------
  686. # ○ 选择项和输入数值的情况下
  687. #--------------------------------------------------------------------------
  688. def draw_opt_text
  689.    # 选择项的情况下
  690.    if $game_temp.choice_max > 0
  691.      @item_max = $game_temp.choice_max
  692.      self.active = true
  693.      self.index = 0
  694.    end
  695.    # 输入数值的情况下
  696.    if $game_temp.num_input_variable_id > 0
  697.      digits_max = $game_temp.num_input_digits_max
  698.      number = $game_variables[$game_temp.num_input_variable_id]
  699.      @input_number_window = Window_InputNumber.new(digits_max)
  700.      @input_number_window.number = number
  701.      @input_number_window.x = self.x + 8
  702.      @input_number_window.y = self.y + $game_temp.num_input_start * 32
  703.    end
  704. end

  705. #--------------------------------------------------------------------------
  706. # ○ 设置呼出对话框
  707. #--------------------------------------------------------------------------
  708. def set_fukidasi(x, y, width, height)
  709.    # $mes_id 为空的时候,不显示呼出对话框
  710.    if $mes_id == nil or $mes_id == ""
  711.      del_fukidasi
  712.      reset_window
  713.    else
  714.      # 不显示暂停标志
  715.      self.pause = false
  716.      # 取得对话框位置
  717.      pos = get_fuki_pos(width, height)
  718.      x = pos[0]
  719.      y = pos[1]
  720.      skin = FUKI::FUKI_SKIN_NAME != "" ? FUKI::FUKI_SKIN_NAME : $game_system.windowskin_name
  721.      # 生成呼出对话框
  722.      self.windowskin = RPG::Cache.windowskin(skin)
  723.      self.x = x
  724.      self.y = y
  725.      self.height = height
  726.      self.width = width
  727.      self.contents.dispose
  728.      self.contents = Bitmap.new(width - 32, height - 32)
  729.      self.back_opacity = FUKI::FUKI_OPACITY
  730.      self.contents.clear
  731.      self.contents.font.color = normal_color
  732.      self.contents.font.size = FUKI::MES_FONT_SIZE
  733.      # 描绘尾部图标
  734.      if $game_system.message_frame == 0
  735.        # 取得位置
  736.        tale_pos = get_tale_pos
  737.        @tale = Sprite.new
  738.        # 是否显示尾部图标 <- bbschat
  739.        if FUKI::TAIL_SHOW == true
  740.          case @message_position
  741.            when 0  # 上
  742.              @tale.bitmap = RPG::Cache.windowskin(skin + "-top")
  743.              @tale.x = tale_pos[0]
  744.              @tale.y = tale_pos[1]
  745.              @tale.z = self.z + 1
  746.            when 1  # 中
  747.              @tale.dispose
  748.              @tale = nil
  749.            when 2  # 下
  750.              @tale.bitmap = RPG::Cache.windowskin(skin + "-under")
  751.              @tale.x = tale_pos[0]
  752.              @tale.y = tale_pos[1]
  753.              @tale.z = self.z + 1
  754.          end
  755.        end
  756.      end
  757.    end
  758. end

  759. #--------------------------------------------------------------------------
  760. # ○ 计算呼出对话框的位置
  761. #--------------------------------------------------------------------------
  762. def get_fuki_pos(width, height)
  763.    
  764.    # 取得角色
  765.    @character = get_character($mes_id)
  766.    if @character == nil
  767.      # 角色不存在的情况下使用默认信息框
  768.      del_fukidasi
  769.      reset_window
  770.      return
  771.    end
  772.    # 处理坐标
  773.    x = ( @character.real_x - $game_map.display_x + 64 ) * 32 / 128 - (width / 2)
  774.    # 为尽量显示在画面内而移动横坐标
  775.    if x + width > 640
  776.      x = 640 - width
  777.    elsif x < 0
  778.      x = 0
  779.    end
  780.    # 决定窗口位置
  781.    case $game_system.message_position
  782.      when 0  # 上
  783.        y = (@character.real_y - $game_map.display_y + 64) * 32 / 128 - height - FUKI::CHARACTOR_HEIGHT + FUKI::POP_SHIFT_TOP
  784.      when 1  # 中
  785.        y = (480 - height) / 2
  786.        x = (640 - width) / 2
  787.      when 2  # 下
  788.        y =  (@character.real_y - $game_map.display_y + 64) * 32 / 128 + 32 + FUKI::POP_SHIFT_UNDER
  789.    end
  790.    # 纪录文章显示位置
  791.    @message_position = $game_system.message_position
  792.    # 如果选择自动修正,则如果文章会显示到画面外则自动改变窗口的尺寸(高度)
  793.    if FUKI::POS_FIX
  794.      case @message_position
  795.        when 0  # 上
  796.          if y <= 0
  797.            @message_position = 2
  798.            y =  (@character.real_y - $game_map.display_y + 64) * 32 / 128 + 32 + FUKI::POP_SHIFT_UNDER
  799.          end
  800.        when 2  # 下
  801.          if y + height >= 480
  802.            p "上"
  803.            @message_position = 0
  804.            y = (@character.real_y - $game_map.display_y + 64) * 32 / 128 - height - FUKI::CHARACTOR_HEIGHT + FUKI::POP_SHIFT_TOP
  805.          end
  806.      end
  807.    end
  808.    return [x,y]
  809.    
  810. end

  811. #--------------------------------------------------------------------------
  812. # ○ 计算尾部图标的位置
  813. #--------------------------------------------------------------------------
  814. def get_tale_pos
  815.    case @message_position
  816.      when 0  # 上
  817.        # 处理坐标
  818.        x = ( @character.real_x - $game_map.display_x + 64 ) * 32 / 128 - 16
  819.        # 画面边缘的话则移动位置
  820.        if FUKI::CORNER_SHIFT
  821.          if x == 0
  822.            x = FUKI::SHIFT_PIXEL
  823.          elsif x == 640 - 32
  824.            x = 640 - 32 - FUKI::SHIFT_PIXEL
  825.          end
  826.        end
  827.        y = self.y + self.height - 16
  828.      when 1  # 中
  829.        x = nil
  830.        y = nil
  831.      when 2  # 下
  832.        # 处理坐标
  833.        x = ( @character.real_x - $game_map.display_x + 64 ) * 32 / 128 - 16
  834.        # 画面边缘的话则移动位置
  835.        if FUKI::CORNER_SHIFT
  836.          if x == 0
  837.            x = FUKI::SHIFT_PIXEL
  838.          elsif @tale.x == 640 - 32
  839.            x = 640 - 32 - FUKI::SHIFT_PIXEL
  840.          end
  841.        end
  842.        y = self.y - 16
  843.    end
  844.    return [x,y]
  845. end

  846. #--------------------------------------------------------------------------
  847. # ○ 计算名字窗口的位置
  848. #--------------------------------------------------------------------------
  849. def get_name_pos
  850.    case @face_pic_txt
  851.      when 0  # 文字
  852.        x = self.x + FUKI::NAME_SHIFT_X
  853.        y = self.y - FUKI::NAME_FONT_SIZE - 16 + FUKI::NAME_SHIFT_Y
  854.      when 1  # 图片
  855.        if self.x >= @pic_width + 5
  856.          # 默认头像显示在对话框左边
  857.          x = self.x-@pic_width-5
  858.        else
  859.          # 对话框左边放不下时头像显示在右边
  860.          x = self.x + self.width
  861.        end
  862.        y = self.y+self.height/2 - (@pic_height + 5)/2
  863.      end

  864.    return [x,y]
  865. end

  866. #--------------------------------------------------------------------------
  867. # ○ 设置角色名字窗口
  868. #--------------------------------------------------------------------------
  869. def set_namewindow
  870.    
  871.    # $mes_name为空时不显示角色名字窗口
  872.    if $mes_name == nil or $mes_name == ""
  873.      return
  874.    else
  875.      # 设定变量
  876.      mes_name = $mes_name
  877.      skin = FUKI::NAME_SKIN_NAME != "" ? FUKI::NAME_SKIN_NAME : $game_system.windowskin_name
  878.      
  879.      #判断名称是否有对应的图片"Graphics/heads/" +
  880.      if $game_temp.namebmp[mes_name] == nil then
  881.        sFile = "Graphics/heads/" + mes_name + ".png"
  882.      else
  883.        sFile = "Graphics/heads/" + $game_temp.namebmp[mes_name] + ".png"
  884.      end
  885.      
  886.      if FileTest.exist?(sFile) == true then
  887.       
  888.        @face_pic_txt = 1                       #名字窗口使用头像<- bbschat
  889.       
  890.        # 生成头像
  891.        bmp = Bitmap.new(sFile)
  892.        @pic_width = bmp.width
  893.        @pic_height = bmp.height
  894.       
  895.        if self.x >= @pic_width + 5
  896.          # 默认头像显示在对话框左边
  897.          name_x = self.x-@pic_width-5
  898.        else
  899.          # 对话框左边放不下时头像显示在右边
  900.          name_x = self.x + self.width
  901.        end
  902.        name_y = self.y+self.height/2 - (@pic_height + 5)/2
  903.       
  904.        # 生成角色头像窗口
  905.        @name_win = Window_Base.new(name_x, name_y, @pic_width + 5, @pic_height + 5)
  906.        @name_win.windowskin = RPG::Cache.windowskin(skin)
  907.        @name_win.back_opacity =0     
  908.        @name_win.z = self.z + 1
  909.       
  910.        @name_contents = Sprite.new
  911.        @name_contents.x = name_x + 2
  912.        @name_contents.y = name_y + 2
  913.        @name_contents.bitmap = bmp
  914.        #@name_contents.z = @name_win.z + 2     #这个用了似乎效果不好<- bbschat
  915.       
  916.      else
  917.       
  918.        @face_pic_txt = 0                       #名字窗口使用文字<- bbschat

  919.        # 生成名字
  920.        name_width = mes_name.size / 2 * FUKI::NAME_FONT_SIZE
  921.        name_height = FUKI::NAME_FONT_SIZE
  922.        name_x = self.x + FUKI::NAME_SHIFT_X
  923.        name_y = self.y - name_height - 16 + FUKI::NAME_SHIFT_Y

  924.        # 生成角色名字窗口(只有边框)
  925.        @name_win = Window_Base.new(name_x, name_y, name_width + 16, name_height + 16)
  926.        @name_win.windowskin = RPG::Cache.windowskin(skin)
  927.        @name_win.back_opacity = FUKI::NAME_OPACITY
  928.        @name_win.z = self.z + 1
  929.       
  930.        # 为了使空白比Windows类限定的更小使用双重结构
  931.        @name_contents = Sprite.new
  932.        @name_contents.x = name_x + 12
  933.        @name_contents.y = name_y + 8
  934.        @name_contents.bitmap = Bitmap.new(name_width, name_height)
  935.        @name_contents.z = @name_win.z + 2
  936.       
  937.        # 设定文字色
  938.        nil_color = Color.new(0,0,0,0)
  939.        if FUKI::NAME_COLOR != nil_color
  940.          @name_contents.bitmap.font.color = FUKI::NAME_COLOR
  941.        else
  942.          @name_contents.bitmap.font.color = normal_color
  943.        end
  944.        @name_contents.bitmap.font.size = FUKI::NAME_FONT_SIZE
  945.        # 调整窗口尺寸
  946.        rect = @name_contents.bitmap.text_size(mes_name)
  947.        @name_win.width = rect.width + 32
  948.        # 描画名字
  949.        @name_contents.bitmap.draw_text(rect, mes_name)
  950.      end
  951.    end

  952. end

  953. #--------------------------------------------------------------------------
  954. # ○ 释放呼出对话框和角色名字窗口
  955. #--------------------------------------------------------------------------
  956. def del_fukidasi
  957.    if @tale != nil
  958.      @tale.dispose
  959.      @tale = nil
  960.    end
  961.    if @name_win != nil
  962.      @name_win.dispose
  963.      @name_win = nil
  964.      @name_contents.dispose
  965.      @name_contents = nil
  966.    end
  967.    self.opacity = 0
  968.    self.x = 80
  969.    self.width = 480
  970.    self.height = 160
  971.    self.contents.dispose
  972.    self.contents = Bitmap.new(width - 32, height - 32)
  973.    self.pause = true
  974. end

  975. #--------------------------------------------------------------------------
  976. # ○ 取得角色
  977. #     parameter : 参数
  978. #--------------------------------------------------------------------------
  979. def get_character(parameter)
  980.   if $game_switches[33]
  981.    #........................................................................
  982.    case parameter
  983.    when 0
  984.      return $game_player
  985.    else
  986.      events = $game_map.events
  987.      return events == nil ? nil : events[parameter]
  988.    end
  989.    #........................................................................
  990.   else
  991.    # 参数分歧
  992.    case parameter
  993.    when -1  # 玩家
  994.      return $game_player
  995.    when 0   # 该事件
  996.      events = $game_map.events
  997.      return events == nil ? nil : events[$active_event_id]
  998.    else     # 特定事件
  999.     if parameter >0
  1000.       events = $game_map.events
  1001.       return events == nil ? nil : events[parameter]
  1002.     else
  1003.       $game_party.return_char(-parameter-2)
  1004.     end
  1005.    end
  1006.   end
  1007. end

  1008. #--------------------------------------------------------------------------
  1009. # ● 设定窗口位置和不透明度
  1010. #--------------------------------------------------------------------------
  1011. def reset_window
  1012.   if $game_switches[33]
  1013.     #........................................................................
  1014.     # 判定
  1015.     if @popchar >= 0
  1016.       events = $game_map.events
  1017.       if events != nil
  1018.         character = get_character(@popchar)
  1019.         x = [[character.screen_x - 0 - self.width / 2, 4].max, 636 - self.width].min
  1020.         y = [[character.screen_y - 48 - self.height, 4].max, 476 - self.height].min
  1021.         self.x = x
  1022.         self.y = y
  1023.       end
  1024.     elsif @popchar == -1
  1025.       self.x = -4
  1026.       self.y = -4
  1027.       self.width = 648
  1028.       self.height = 488
  1029.     else
  1030.       if $game_temp.in_battle
  1031.         self.y = 16
  1032.       else
  1033.         case $game_system.message_position
  1034.         when 0 # 上
  1035.           self.y = 16
  1036.         when 1 # 中
  1037.           self.y = 160
  1038.         when 2 # 下
  1039.           self.y = 304
  1040.         end
  1041.         self.x = 80
  1042.         if @face_file == nil
  1043.           self.width = 480
  1044.         else
  1045.           self.width = 600
  1046.           self.x -= 60
  1047.         end
  1048.         self.height = 160
  1049.       end
  1050.     end
  1051.     self.contents = Bitmap.new(self.width - 32, self.height - 32)
  1052.     if @face_file != nil
  1053.       self.contents.blt(16, 16, RPG::Cache.picture(@face_file), Rect.new(0, 0, 96, 96))
  1054.     end
  1055.     if @popchar == -1
  1056.       self.opacity = 255
  1057.       self.back_opacity = 0
  1058.     elsif $game_system.message_frame == 0
  1059.       self.opacity = 255
  1060.       self.back_opacity = 200
  1061.     else
  1062.       self.opacity = 0
  1063.       self.back_opacity = 200
  1064.     end
  1065.     #........................................................................
  1066.   else
  1067.    if $game_temp.in_battle
  1068.      self.y = 16
  1069.    else
  1070.      case $game_system.message_position
  1071.      when 0  # 上
  1072.        self.y = 16
  1073.      when 1  # 中
  1074.        self.y = 160
  1075.      when 2  # 下
  1076.        self.y = 304
  1077.      end
  1078.    end
  1079.    if $game_system.message_frame == 0
  1080.      self.opacity = 255
  1081.    else
  1082.      self.opacity = 0
  1083.    end
  1084.    self.back_opacity = FUKI::MES_OPACITY
  1085.   end
  1086. end

  1087. #--------------------------------------------------------------------------
  1088. # ● line_height-66rpg
  1089. #--------------------------------------------------------------------------
  1090. # 返回値:行高
  1091. #--------------------------------------------------------------------------
  1092. def line_height
  1093.    return 32
  1094.    if self.contents.font.size >= 20 and self.contents.font.size <= 24
  1095.      return 32
  1096.    else
  1097.      return self.contents.font.size * 15 / 10
  1098.    end
  1099. end
  1100. #--------------------------------------------------------------------------
  1101. # ● \V 变换-66rpg
  1102. #--------------------------------------------------------------------------
  1103. def convart_value(option, index)
  1104.    option == nil ? option = "" : nil
  1105.    option.downcase!
  1106.    case option
  1107.      when "i"
  1108.        unless $data_items[index].name == nil
  1109.          r = sprintf("\030[%s]%s", $data_items[index].icon_name, $data_items[index].name)
  1110.        end
  1111.      when "w"
  1112.        unless $data_weapons[index].name == nil
  1113.          r = sprintf("\030[%s]%s", $data_weapons[index].icon_name, $data_weapons[index].name)
  1114.        end
  1115.      when "a"
  1116.        unless $data_armors[index].name == nil
  1117.          r = sprintf("\030[%s]%s", $data_armors[index].icon_name, $data_armors[index].name)
  1118.        end
  1119.      when "s"
  1120.        unless $data_skills[index].name == nil
  1121.          r = sprintf("\030[%s]%s", $data_skills[index].icon_name, $data_skills[index].name)
  1122.        end
  1123.      else
  1124.      r = $game_variables[index]
  1125.    end
  1126.    r == nil ? r = "" : nil
  1127.    return r
  1128. end
  1129. #--------------------------------------------------------------------------
  1130. # ● 刷新画面
  1131. #--------------------------------------------------------------------------
  1132. def update
  1133.    if $game_switches[33]
  1134.     #........................................................................
  1135.     super
  1136.     if @fade_in
  1137.       self.contents_opacity += 24
  1138.       if @input_number_window != nil
  1139.         @input_number_window.contents_opacity += 24
  1140.       end
  1141.       if self.contents_opacity == 255
  1142.         @fade_in = false
  1143.       end
  1144.       return
  1145.     end
  1146.     @now_text = nil if @now_text == ""
  1147.    
  1148.     if @now_text != nil and @mid_stop == false
  1149.       if @write_wait > 0
  1150.         @write_wait -= 1
  1151.         return
  1152.       end
  1153.       text_not_skip = $game_system.typing
  1154.       while true
  1155.         @max_x = @x if @max_x < @x
  1156.         @max_y = @y if @max_y < @y
  1157.         if (c = @now_text.slice!(/./m)) != nil
  1158.           if c == "\000"
  1159.             c = "\\"
  1160.           end
  1161.           if c == "\001"
  1162.             @now_text.sub!(/\[([0-9]+)\]/, "")
  1163.             color = $1.to_i
  1164.             if color >= 0 and color <= 7
  1165.               self.contents.font.color = text_color(color)
  1166.             end
  1167.             c = ""
  1168.           end
  1169.           if c == "\002"
  1170.             if @gold_window == nil and @popchar <= 0
  1171.               @gold_window = Window_Gold.new
  1172.               @gold_window.x = 560 - @gold_window.width
  1173.               if $game_temp.in_battle
  1174.                 @gold_window.y = 192
  1175.               else
  1176.                 @gold_window.y = self.y >= 128 ? 32 : 384
  1177.               end
  1178.               @gold_window.opacity = self.opacity
  1179.               @gold_window.back_opacity = self.back_opacity
  1180.             end
  1181.             c = ""
  1182.           end
  1183.           if c == "\003"
  1184.             @now_text.sub!(/\[([0-9]+)\]/, "")
  1185.             speed = $1.to_i
  1186.             if speed >= 0 and speed <= 19
  1187.               @write_speed = speed
  1188.             end
  1189.             c = ""
  1190.           end
  1191.           if c == "\004"
  1192.             @now_text.sub!(/\[(.*?)\]/, "")
  1193.             buftxt = $1.dup.to_s
  1194.             if buftxt.match(/\//) == nil and buftxt != "" then
  1195.               $game_system.soundname_on_speak = "Audio/SE/" + buftxt
  1196.             else
  1197.               $game_system.soundname_on_speak = buftxt.dup
  1198.             end
  1199.             c = ""
  1200.           elsif c == "\004"
  1201.             c = ""
  1202.           end
  1203.           if c == "\005"
  1204.             @write_wait += 5
  1205.             c = ""
  1206.           end
  1207.           if c == "\006"
  1208.             @write_wait += 20
  1209.             c = ""
  1210.           end
  1211.           if c == "\016"
  1212.             text_not_skip = false
  1213.             c = ""
  1214.           end
  1215.           if c == "\017"
  1216.             text_not_skip = true
  1217.             c = ""
  1218.           end
  1219.           if c == "\020"
  1220.             @mid_stop = true
  1221.             c = ""
  1222.           end
  1223.           if c == "\021"
  1224.             terminate_message
  1225.             return
  1226.           end
  1227.           if c == "\023"
  1228.             @indent = @x
  1229.             c = ""
  1230.           end
  1231.           if c == "\024"
  1232.             @now_text.sub!(/\[([0-9]+)\]/, "")
  1233.             @opacity = $1.to_i
  1234.             c = ""
  1235.           end
  1236.           if c == "\025"
  1237.             @now_text.sub!(/\[([0-9]+)\]/, "")
  1238.             self.contents.font.size = [[$1.to_i, 6].max, 32].min
  1239.             c = ""
  1240.           end
  1241.           if c == "\026"
  1242.             @now_text.sub!(/\[([0-9]+)\]/, "")
  1243.             @x += $1.to_i
  1244.             c = ""
  1245.           end
  1246.           if c == "\027"
  1247.             @now_text.sub!(/\[(.*?)\]/, "")
  1248.             @x += ruby_draw_text(self.contents, @x, @y * line_height + (line_height - self.contents.font.size), $1, @opacity)
  1249.             if $game_system.soundname_on_speak != ""
  1250.               Audio.se_play($game_system.soundname_on_speak)
  1251.             end
  1252.             c = ""
  1253.           end
  1254.           if c == "\030"
  1255.             @now_text.sub!(/\[(.*?)\]/, "")
  1256.             self.contents.blt(@x , @y * line_height + 8, RPG::Cache.icon($1), Rect.new(0, 0, 24, 24))
  1257.            if $game_system.soundname_on_speak != ""
  1258.               Audio.se_play($game_system.soundname_on_speak)
  1259.             end
  1260.             @x += 24
  1261.             c = ""
  1262.           end
  1263.           if c == "\n"
  1264.             if @lines >= $game_temp.choice_start
  1265.               @cursor_width = [@cursor_width, @max_x - @face_indent].max
  1266.             end
  1267.             @lines += 1
  1268.             @y += 1
  1269.             @x = 0 + @indent + @face_indent
  1270.             if @lines >= $game_temp.choice_start
  1271.               @x = 8 + @indent + @face_indent
  1272.             end
  1273.             c = ""
  1274.           end
  1275.           if c != ""
  1276.             # 文字描画
  1277.             @x += opacity_draw_text(self.contents, @x, @y * line_height + (line_height - self.contents.font.size), c, @opacity)
  1278.             if $game_system.soundname_on_speak != "" then
  1279.             Audio.se_play($game_system.soundname_on_speak)
  1280.             end
  1281.           end
  1282.           if Input.press?(Input::C) and $game_switches[34]
  1283.             text_not_skip = false
  1284.           end
  1285.           if Input.press?(Input::B)
  1286.             text_not_skip = false
  1287.           end
  1288.         else
  1289.           text_not_skip = true
  1290.           break
  1291.         end
  1292.         # 終了判定
  1293.         if text_not_skip
  1294.           break
  1295.         end
  1296.       end
  1297.       @write_wait += @write_speed
  1298.       return
  1299.     end
  1300.     if @input_number_window != nil
  1301.       @input_number_window.update
  1302.       # 決定
  1303.       if Input.trigger?(Input::C)
  1304.         $game_system.se_play($data_system.decision_se)
  1305.         $game_variables[$game_temp.num_input_variable_id] =
  1306.         @input_number_window.number
  1307.         $game_map.need_refresh = true
  1308.         @input_number_window.dispose
  1309.         @input_number_window = nil
  1310.         terminate_message
  1311.       end
  1312.       return
  1313.     end
  1314.     if @contents_showing
  1315.       if $game_temp.choice_max == 0
  1316.         self.pause = true
  1317.       end
  1318.       # 取消
  1319.       if Input.trigger?(Input::B)
  1320.         if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0
  1321.           $game_system.se_play($data_system.cancel_se)
  1322.           $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)
  1323.           terminate_message
  1324.         end
  1325.       end
  1326.       # 決定
  1327.       if Input.trigger?(Input::C)
  1328.         if $game_temp.choice_max > 0
  1329.           $game_system.se_play($data_system.decision_se)
  1330.           $game_temp.choice_proc.call(self.index)
  1331.         end
  1332.         if @mid_stop
  1333.           @mid_stop = false
  1334.           return
  1335.         else
  1336.           terminate_message
  1337.         end
  1338.       end
  1339.       return
  1340.     end
  1341.     if @fade_out == false and $game_temp.message_text != nil
  1342.       @contents_showing = true
  1343.       $game_temp.message_window_showing = true
  1344.       refresh
  1345.       Graphics.frame_reset
  1346.       self.visible = true
  1347.       self.contents_opacity = 0
  1348.     if @input_number_window != nil
  1349.       @input_number_window.contents_opacity = 0
  1350.     end
  1351.       @fade_in = true
  1352.       return
  1353.     end
  1354.     if self.visible
  1355.       @fade_out = true
  1356.       self.opacity -= 48
  1357.       if self.opacity == 0
  1358.         self.visible = false
  1359.         @fade_out = false
  1360.         $game_temp.message_window_showing = false
  1361.       end
  1362.       return
  1363.     end
  1364.     #........................................................................
  1365.   else
  1366.    super
  1367.    # 呼出模式下跟随事件移动
  1368.    if @tale != nil
  1369.      pos = get_fuki_pos(self.width, self.height)
  1370.      self.x = pos[0]
  1371.      self.y = pos[1]

  1372.      tale_pos = get_tale_pos
  1373.      @tale.x = tale_pos[0]
  1374.      @tale.y = tale_pos[1]
  1375.      
  1376.      if @name_win != nil
  1377.        name_pos = get_name_pos
  1378.        @name_win.x = name_pos[0]
  1379.        @name_win.y = name_pos[1]
  1380.        case @face_pic_txt
  1381.          when 0  # 文字
  1382.            @name_contents.x = @name_win.x + 12
  1383.            @name_contents.y = @name_win.y + 8
  1384.          when 1  # 图片
  1385.            @name_contents.x = @name_win.x + 2
  1386.            @name_contents.y = @name_win.y + 2
  1387.          end
  1388.      end
  1389.    end
  1390.    
  1391.    # 渐变的情况下
  1392.    if @fade_in
  1393.      self.contents_opacity += 24
  1394.      if @name_win != nil
  1395.        @name_win.opacity += 24
  1396.      end
  1397.      if @tale != nil
  1398.        @tale.opacity += 24
  1399.      end
  1400.      if @input_number_window != nil
  1401.        @input_number_window.contents_opacity += 24
  1402.      end
  1403.      if self.contents_opacity == 255
  1404.        @fade_in = false
  1405.      end
  1406.      return
  1407.    end
  1408.    # 显示信息中的情况下
  1409.    if @contents_drawing
  1410.      refresh_drawtext
  1411.      return
  1412.    end
  1413.    # 输入数值的情况下
  1414.    if @input_number_window != nil
  1415.      @input_number_window.update
  1416.      # 确定
  1417.      if Input.trigger?(Input::C)
  1418.        $game_system.se_play($data_system.decision_se)
  1419.        $game_variables[$game_temp.num_input_variable_id] =
  1420.          @input_number_window.number
  1421.        $game_map.need_refresh = true
  1422.        # 释放输入数值窗口
  1423.        @input_number_window.dispose
  1424.        @input_number_window = nil
  1425.        terminate_message
  1426.      end
  1427.      return
  1428.    end
  1429.    # 显示信息结束的情况下
  1430.    if @contents_showing_end
  1431.      # 不是显示选择项且不是呼出对话模式则显示暂停标志
  1432.      if $game_temp.choice_max == 0 and @tale == nil
  1433.        self.pause = true
  1434.      else
  1435.        self.pause = false
  1436.      end
  1437.      # 取消
  1438.      if Input.trigger?(Input::B)
  1439.        if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0
  1440.          $game_system.se_play($data_system.cancel_se)
  1441.          $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)
  1442.          terminate_message
  1443.        end
  1444.      end
  1445.      # 确定
  1446.      if Input.trigger?(Input::C)
  1447.        if $game_temp.choice_max > 0
  1448.          $game_system.se_play($data_system.decision_se)
  1449.          $game_temp.choice_proc.call(self.index)
  1450.        end
  1451.        terminate_message
  1452.        # 释放呼出窗口
  1453.        del_fukidasi
  1454.      end
  1455.      return
  1456.    end
  1457.    # 在渐变以外的状态下有等待显示的信息与选择项的场合
  1458.    if @fade_out == false and $game_temp.message_text != nil
  1459.      @contents_showing = true
  1460.      $game_temp.message_window_showing = true
  1461.      reset_window
  1462.      refresh_create
  1463.      if @name_win != nil
  1464.        @name_win.opacity = 0
  1465.      end
  1466.      if @tale != nil
  1467.        @tale.opacity = 0
  1468.      end
  1469.      Graphics.frame_reset
  1470.      self.visible = true
  1471.      self.contents_opacity = 0
  1472.      if @input_number_window != nil
  1473.        @input_number_window.contents_opacity = 0
  1474.      end
  1475.      @fade_in = true
  1476.      return
  1477.    end
  1478.    # 没有可以显示的信息、但是窗口为可见的情况下
  1479.    if self.visible
  1480.      @fade_out = true
  1481.      self.opacity -= 48
  1482.      if @name_win != nil
  1483.        @name_win.opacity -= 48
  1484.      end
  1485.      if @tale != nil
  1486.        @tale.opacity -= 48
  1487.      end
  1488.      if self.opacity == 0
  1489.        self.visible = false
  1490.        @fade_out = false
  1491.        $game_temp.message_window_showing = false
  1492.        del_fukidasi
  1493.      end
  1494.      return
  1495.    end
  1496.   end
  1497. end

  1498. #--------------------------------------------------------------------------
  1499. # ● 透過文字描画 - 66rpg
  1500. #--------------------------------------------------------------------------
  1501. # target :描画対象。Bitmapクラスを指定。
  1502. # x :x座標
  1503. # y :y座標
  1504. # str  :描画文字列
  1505. # opacity:透過率(0~255)
  1506. # 返回値 :文字幅(@x増加値)。
  1507. #--------------------------------------------------------------------------
  1508. def opacity_draw_text(target, x, y, str,opacity)
  1509.    height = target.font.size
  1510.    width = target.text_size(str).width
  1511.    opacity = [[opacity, 0].max, 255].min
  1512.    if opacity == 255
  1513.      target.draw_text(x, y, width, height, str)
  1514.      return width
  1515.    else
  1516.      if @opacity_text_buf.width < width or @opacity_text_buf.height < height
  1517.        @opacity_text_buf.dispose
  1518.        @opacity_text_buf = Bitmap.new(width, height)
  1519.      else
  1520.        @opacity_text_buf.clear
  1521.      end
  1522.      @opacity_text_buf.font.size = target.font.size
  1523.      @opacity_text_buf.draw_text(0, 0, width, height, str)
  1524.      target.blt(x, y, @opacity_text_buf, Rect.new(0, 0, width, height), opacity)
  1525.    return width
  1526.    end
  1527. end
  1528. def ruby_draw_text(target, x, y, str,opacity)
  1529.    sizeback = target.font.size
  1530.    target.font.size * 3 / 2 > 32 ? rubysize = 32 - target.font.size : rubysize = target.font.size / 2
  1531.    rubysize = [rubysize, 6].max
  1532.    
  1533.    opacity = [[opacity, 0].max, 255].min
  1534.    split_s = str.split(/,/)
  1535.    
  1536.    split_s[0] == nil ? split_s[0] = "" : nil
  1537.    split_s[1] == nil ? split_s[1] = "" : nil
  1538.    
  1539.    height = sizeback + rubysize
  1540.    width = target.text_size(split_s[0]).width
  1541.    
  1542.    target.font.size = rubysize
  1543.    ruby_width = target.text_size(split_s[1]).width
  1544.    target.font.size = sizeback
  1545.    
  1546.    buf_width = [target.text_size(split_s[0]).width, ruby_width].max
  1547.    
  1548.    width - ruby_width != 0 ? sub_x = (width - ruby_width) / 2 : sub_x = 0
  1549.    
  1550.    if opacity == 255
  1551.      target.font.size = rubysize
  1552.      target.draw_text(x + sub_x, y - target.font.size, target.text_size(split_s[1]).width, target.font.size, split_s[1])
  1553.      target.font.size = sizeback
  1554.      target.draw_text(x, y, width, target.font.size, split_s[0])
  1555.      return width
  1556.    else
  1557.      if @opacity_text_buf.width < buf_width or @opacity_text_buf.height < height
  1558.        @opacity_text_buf.dispose
  1559.        @opacity_text_buf = Bitmap.new(buf_width, height)
  1560.      else
  1561.        @opacity_text_buf.clear
  1562.      end
  1563.      @opacity_text_buf.font.size = rubysize
  1564.      @opacity_text_buf.draw_text(0 , 0, buf_width, rubysize, split_s[1], 1)
  1565.      @opacity_text_buf.font.size = sizeback
  1566.      @opacity_text_buf.draw_text(0 , rubysize, buf_width, sizeback, split_s[0], 1)
  1567.      if sub_x >= 0
  1568.        target.blt(x, y - rubysize, @opacity_text_buf, Rect.new(0, 0, buf_width, height), opacity)
  1569.      else
  1570.        target.blt(x + sub_x, y - rubysize, @opacity_text_buf, Rect.new(0, 0, buf_width, height), opacity)
  1571.      end
  1572.      return width
  1573.    end
  1574. end

  1575. #--------------------------------------------------------------------------
  1576. # ● 释放
  1577. #--------------------------------------------------------------------------
  1578. def dispose
  1579.   if $game_switches[33]
  1580.    #........................................................................
  1581.    terminate_message
  1582.    if @gaiji_cache != nil
  1583.      unless @gaiji_cache.disposed?
  1584.        @gaiji_cache.dispose
  1585.      end
  1586.    end
  1587.    unless @opacity_text_buf.disposed?
  1588.      @opacity_text_buf.dispose
  1589.    end
  1590.    $game_temp.message_window_showing = false
  1591.    if @input_number_window != nil
  1592.      @input_number_window.dispose
  1593.    end
  1594.    super
  1595.    #........................................................................
  1596.   else
  1597.    terminate_message
  1598.    $game_temp.message_window_showing = false
  1599.    if @input_number_window != nil
  1600.      @input_number_window.dispose
  1601.    end
  1602.    super
  1603.   end
  1604. end

  1605. #--------------------------------------------------------------------------
  1606. # ● 信息结束处理
  1607. #--------------------------------------------------------------------------
  1608. def terminate_message
  1609.   if $game_switches[33]
  1610.    #........................................................................
  1611.    self.active = false
  1612.    self.pause = false
  1613.    self.index = -1
  1614.    self.contents.clear
  1615.    # 清除显示中标志
  1616.    @contents_showing = false
  1617.    # 呼叫信息调用
  1618.    if $game_temp.message_proc != nil
  1619.      $game_temp.message_proc.call
  1620.    end
  1621.    # 清除文章、选择项、输入数值的相关变量
  1622.    $game_temp.message_text = nil
  1623.    $game_temp.message_proc = nil
  1624.    $game_temp.choice_start = 99
  1625.    $game_temp.choice_max = 0
  1626.    $game_temp.choice_cancel_type = 0
  1627.    $game_temp.choice_proc = nil
  1628.    $game_temp.num_input_start = 99
  1629.    $game_temp.num_input_variable_id = 0
  1630.    $game_temp.num_input_digits_max = 0
  1631.    # 开放金钱窗口
  1632.    if @gold_window != nil
  1633.      @gold_window.dispose
  1634.      @gold_window = nil
  1635.    end
  1636.    if @name_window_frame != nil
  1637.      @name_window_frame.dispose
  1638.      @name_window_frame = nil
  1639.    end
  1640.    if @name_window_text != nil
  1641.      @name_window_text.dispose
  1642.      @name_window_text = nil
  1643.    end
  1644.    if @right_picture != nil and @right_keep == true
  1645.      @right_picture.dispose
  1646.    end   
  1647.    if @left_picture != nil and @left_keep == true
  1648.      @left_picture.dispose
  1649.    end
  1650.    #........................................................................
  1651.   else
  1652.    self.active = false
  1653.    self.pause = false
  1654.    self.index = -1
  1655.    self.contents.clear
  1656.    # 清除显示中标志
  1657.    @contents_showing = false
  1658.    @contents_showing_end = false
  1659.    # 呼叫信息调用
  1660.    if $game_temp.message_proc != nil
  1661.      $game_temp.message_proc.call
  1662.    end
  1663.    # 清除文章、选择项、输入数值的相关变量
  1664.    $game_temp.message_text = nil
  1665.    $game_temp.message_proc = nil
  1666.    $game_temp.choice_start = 99
  1667.    $game_temp.choice_max = 0
  1668.    $game_temp.choice_cancel_type = 0
  1669.    $game_temp.choice_proc = nil
  1670.    $game_temp.num_input_start = 99
  1671.    $game_temp.num_input_variable_id = 0
  1672.    $game_temp.num_input_digits_max = 0
  1673.    # 释放金钱窗口
  1674.    if @gold_window != nil
  1675.      @gold_window.dispose
  1676.      @gold_window = nil
  1677.    end
  1678.   end
  1679. end

  1680. #--------------------------------------------------------------------------
  1681. # ● 刷新光标矩形
  1682. #--------------------------------------------------------------------------
  1683. def update_cursor_rect
  1684.   if $game_switches[33]
  1685.    #.........................................................................
  1686.    if @index >= 0
  1687.      n = $game_temp.choice_start + @index
  1688.      self.cursor_rect.set(4 + @indent + @face_indent, n * 32 + 4, @cursor_width, 32)
  1689.    else
  1690.      self.cursor_rect.empty
  1691.    end
  1692.    #.........................................................................
  1693.   else
  1694.    if @index >= 0
  1695.      n = $game_temp.choice_start + @index
  1696.      self.cursor_rect.set(8, n * 32, @cursor_width, 32)
  1697.    else
  1698.      self.cursor_rect.empty
  1699.    end
  1700.   end
  1701. end
  1702. #--------------------------------------------------------------------------
  1703. # ● 取得普通文字色
  1704. #--------------------------------------------------------------------------
  1705. def normal_color
  1706.    nil_color = Color.new(0,0,0,0)
  1707.    if FUKI::FUKI_COLOR != nil_color
  1708.      color = FUKI::FUKI_COLOR
  1709.    else
  1710.      color = super
  1711.    end
  1712.    return color
  1713. end
  1714. end

  1715. #==============================================================================
  1716. # ■ Interpreter
  1717. #==============================================================================

  1718. class Interpreter
  1719. #--------------------------------------------------------------------------
  1720. # ● 设置事件
  1721. #     event_id : 事件 ID
  1722. #--------------------------------------------------------------------------
  1723. alias setup_fuki setup
  1724. def setup(list, event_id)
  1725.    setup_fuki(list, event_id)
  1726.    # 如果不是战斗中
  1727.    if !($game_temp.in_battle)
  1728.      # 记录事件 ID
  1729.      $active_event_id = event_id
  1730.    end
  1731. end
  1732. end

  1733. #==============================================================================
  1734. # ■ Scene_Map
  1735. #==============================================================================

  1736. class Scene_Map
  1737. #--------------------------------------------------------------------------
  1738. # ● 主处理
  1739. #--------------------------------------------------------------------------
  1740. def main
  1741.    # 生成活动块
  1742.    @spriteset = Spriteset_Map.new
  1743.    # 生成信息窗口
  1744.    @message_window = Window_FukiMessage.new
  1745.    # 执行过渡
  1746.    Graphics.transition
  1747.    # 主循环
  1748.    loop do
  1749.      # 刷新游戏画面
  1750.      Graphics.update
  1751.      # 刷新输入信息
  1752.      Input.update
  1753.      # 刷新画面
  1754.      update
  1755.      # 如果画面切换的话就中断循环
  1756.      if $scene != self
  1757.        break
  1758.      end
  1759.    end
  1760.    # 准备过渡
  1761.    Graphics.freeze
  1762.    # 释放活动块
  1763.    @spriteset.dispose
  1764.    # 释放信息窗口
  1765.    @message_window.dispose
  1766.    # 标题画面切换中的情况下
  1767.    if $scene.is_a?(Scene_Title)
  1768.      # 淡入淡出画面
  1769.      Graphics.transition
  1770.      Graphics.freeze
  1771.    end
  1772. end
  1773. end

  1774. #==============================================================================
  1775. # ■ Window_InputNumber
  1776. #==============================================================================

  1777. class Window_InputNumber < Window_Base
  1778. #--------------------------------------------------------------------------
  1779. # ● 初始化对像
  1780. #     digits_max : 位数
  1781. #--------------------------------------------------------------------------
  1782. def initialize(digits_max)
  1783.    @digits_max = digits_max
  1784.    @number = 0
  1785.    # 从数字的幅度计算(假定与 0~9 等幅)光标的幅度
  1786.    dummy_bitmap = Bitmap.new(32, 32)
  1787.    dummy_bitmap.font.size = FUKI::MES_FONT_SIZE
  1788.    @cursor_width = dummy_bitmap.text_size("0").width + 8
  1789.    dummy_bitmap.dispose
  1790.    super(0, 0, @cursor_width * @digits_max + 32, 64)
  1791.    self.contents = Bitmap.new(width - 32, height - 32)
  1792.    self.contents.font.size = FUKI::MES_FONT_SIZE
  1793.    self.z += 9999
  1794.    self.opacity = 0
  1795.    @index = 0
  1796.    refresh
  1797.    update_cursor_rect
  1798. end
  1799. end
复制代码
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
87 小时
注册时间
2011-7-27
帖子
34
3
 楼主| 发表于 2012-9-16 13:09:50 | 只看该作者
楼上那个和显示地图名称有冲突啊
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
49
在线时间
423 小时
注册时间
2011-3-11
帖子
299
4
发表于 2012-9-16 14:30:31 | 只看该作者
据我所知(有可能错了)、这种情况只会在测试游戏中出现、游戏直接执行时不会出现。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
87
在线时间
303 小时
注册时间
2006-7-12
帖子
958
5
发表于 2012-9-16 17:12:24 | 只看该作者
版本问题,换1.02试试

点评

我认为此人才是正解  发表于 2012-9-20 15:14
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
123 小时
注册时间
2012-6-5
帖子
109
6
发表于 2012-9-17 09:24:17 | 只看该作者
找到:
self.contents.draw_text(4+@dx, (font_size+10)*@dy, font_size, font_size, c)

将他改成:if c == "\001" or c == "\002" or c == "\003" or c == "\n"

         c = ""

       else

         self.contents.draw_text(4+@dx, (font_size+10)*@dy, font_size, font_size, c)

       end                                                 希望对你有帮助!

评分

参与人数 1星屑 +20 收起 理由
闻人翎 + 20 认可答案

查看全部评分

回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-22 06:43

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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