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

Project1

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

对话问题

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
94 小时
注册时间
2007-6-3
帖子
801
跳转到指定楼层
1
发表于 2008-1-7 00:58:32 | 只看该作者 回帖奖励 |正序浏览 |阅读模式

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

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

x
  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. #  来自 http://rpg.para.s3p.net/
  16. #
  17. #  汉化修改 66RPG bbschat(2006.1.5)
  18. #    来自 http://rpg.blue/web/
  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 = "001-Blue01"   # 呼出对话框用Skin
  34.   NAME_SKIN_NAME = "001-Blue01"   # 角色名字窗口用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 = 48
  66.   # 呼出对话框的相对位置(纵坐标)
  67.   POP_SHIFT_TOP = 0         # 表示位置为上的时候
  68.   POP_SHIFT_UNDER = 0       # 表示位置为下的时候
  69.   
  70.   # 信息的表示速度(数字越小速度越快,0为瞬间表示)
  71.   # 游戏中 可随时用数字代入 $mes_speed 来改变消息表示速度。
  72.   MES_SPEED = 1

  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 ={""=>""}
  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[2]【' + @kkme_name + '】:\C[1]'
  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 = '\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.         $game_system.se_play($data_system.cursor_se)
  197.         # 描绘处理
  198.         draw_massage
  199.         @wait = $mes_speed
  200.       end
  201.     end
  202.     # 描绘结束
  203.     if $game_temp.message_text == ""
  204.       draw_opt_text
  205.       @contents_showing_end = true
  206.       @contents_drawing = false
  207.     end
  208.   end
  209.   
  210.   #--------------------------------------------------------------------------
  211.   # ○ 取得窗口尺寸
  212.   #--------------------------------------------------------------------------
  213.   def get_windowsize
  214.     x = y = 0
  215.     @h = @w = 0
  216.     @cursor_width = 0
  217.     # 有选择项的话,处理字的缩进
  218.     if $game_temp.choice_start == 0
  219.       x = 16
  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.         # 处理字的缩进
  306.         @dx = 8
  307.         # 描绘文字
  308.         #self.contents.draw_text(4 + @dx, 32 * @dy, 40, 32, c)
  309.         font_size = self.contents.font.size
  310.         self.contents.draw_text(4 + @dx, (font_size+10)*@dy, 40, 32, c)
  311.         # x 为要描绘文字宽度的加法运算
  312.         @dx += self.contents.text_size(c).width
  313.         # 循环
  314.         while ((c = text.slice!(/./m)) != "\n")
  315.           # 描绘文字
  316.           #self.contents.draw_text(4 + @dx, 32 * @dy, 40, 32, c)
  317.           self.contents.draw_text(4 + @dx, (font_size+10)*@dy, 40, 32, c)
  318.           # x 为要描绘文字宽度的加法运算
  319.           @dx += self.contents.text_size(c).width
  320.         end
  321.         if c == "\n"
  322.           # 更新光标宽度
  323.           @cursor_width = [@cursor_width, @dx].max
  324.           # dy 累加 1
  325.           @dy += 1
  326.           @dx = 0
  327.         end
  328.         return
  329.       end
  330.       # \\ 的情况下
  331.       if c == "\000"
  332.         # 还原为本来的文字
  333.         c = "\\"
  334.       end
  335.       #\C[n] 的情况下
  336.       if c == "\001"
  337.         # 更改文字色
  338.         text.sub!(/\[([0-9]+)\]/, "")
  339.         color = $1.to_i
  340.         if color >= 0 and color <= 7
  341.           self.contents.font.color = text_color(color)
  342.         end
  343.       end
  344.       # \G 的情况下
  345.       if c == "\002"
  346.         # ★生成金钱窗口★
  347.         @contents_showing_end = true
  348.         @contents_drawing = false
  349.         terminate_messageX
  350.         @save_x = @dx
  351.         @save_y = @dy
  352.       end
  353.       # 另起一行文字的情况下
  354.       if c == "\n"
  355.         # dy 累加 1
  356.         @dy += 1
  357.         @dx = 0
  358.       end
  359.       # 描绘文字
  360.       
  361.       size_zy = 6 # 设定文字动态增大——别问我这么重要的参数为什么放在这里而不放在顶部,有特殊原因的。
  362.       
  363.       
  364.       unless @old_text_info == []
  365.         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))
  366.         col = self.contents.font.color.clone
  367.         self.contents.font.color = @old_text_info[3].clone
  368.         self.contents.font.size = @old_text_info[2] -= size_zy
  369.         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])
  370.         self.contents.font.color = col
  371.         #Audio.se_play("Audio/SE/",80,100)#001-system01
  372.         @old_text_info = []
  373.       end
  374.       if c != nil
  375.         self.contents.font.size = FUKI::MES_FONT_SIZE
  376.         font_size = self.contents.font.size += size_zy
  377.         @old_text_info.push(@dx , @dy , font_size, self.contents.font.color.clone, c)
  378.         self.contents.draw_text(4+@dx, (font_size+10-size_zy)*@dy - size_zy/2, font_size, font_size, c)
  379.         self.contents.font.size -= size_zy
  380.         # dx 为要描绘文字的宽度加法运算
  381.         @dx += self.contents.text_size(c).width
  382.       end
  383.     end
  384.   end
  385.   
  386.   #--------------------------------------------------------------------------
  387.   # ○ 选择项和输入数值的情况下
  388.   #--------------------------------------------------------------------------
  389.   def draw_opt_text
  390.     # 选择项的情况下
  391.     if $game_temp.choice_max > 0
  392.       @item_max = $game_temp.choice_max
  393.       self.active = true
  394.       self.index = 0
  395.     end
  396.     # 输入数值的情况下
  397.     if $game_temp.num_input_variable_id > 0
  398.       digits_max = $game_temp.num_input_digits_max
  399.       number = $game_variables[$game_temp.num_input_variable_id]
  400.       @input_number_window = Window_InputNumber.new(digits_max)
  401.       @input_number_window.number = number
  402.       @input_number_window.x = self.x + 8
  403.       @input_number_window.y = self.y + $game_temp.num_input_start * 32
  404.     end
  405.   end
  406.   
  407.   def pic_back
  408.     @pic_skin.dispose if @pic_skin != nil
  409.     @pic_skin = Sprite.new
  410.     @pic_skin.opacity = 0 unless @no_term_stop
  411.     @pic_skin.bitmap = Bitmap.new(self.width + 35, self.height + 35)
  412.     @pic_skin.x = self.x + 2
  413.     @pic_skin.y = self.y + 2
  414.     @pic_skin.z = self.z
  415.     @pic_skin.bitmap.blt(0, 0, RPG::Cache.icon("message_左上"),  RPG::Cache.icon("message_左上").rect)
  416.     @pic_skin.bitmap.blt(self.width - 35, 0, RPG::Cache.icon("message_右上"),  RPG::Cache.icon("message_右上").rect)
  417.     @pic_skin.bitmap.blt(0, self.height - 35, RPG::Cache.icon("message_左下"),  RPG::Cache.icon("message_左下").rect)
  418.     @pic_skin.bitmap.blt(self.width - 35, self.height - 35, RPG::Cache.icon("message_右下"),  RPG::Cache.icon("message_右下").rect)
  419.     @pic_skin.bitmap.stretch_blt(Rect.new(0,35,35,self.height-70), RPG::Cache.icon("message_左"), RPG::Cache.icon("message_左").rect)
  420.     @pic_skin.bitmap.stretch_blt(Rect.new(self.width - 35,35,35,self.height-70), RPG::Cache.icon("message_右"), RPG::Cache.icon("message_右").rect)
  421.     @pic_skin.bitmap.stretch_blt(Rect.new(35,0,self.width-70,35), RPG::Cache.icon("message_上"), RPG::Cache.icon("message_上").rect)
  422.     @pic_skin.bitmap.stretch_blt(Rect.new(35,self.height-35,self.width-70,35), RPG::Cache.icon("message_下"), RPG::Cache.icon("message_下").rect)
  423.     @pic_skin.bitmap.stretch_blt(Rect.new(35,35,self.width-70,self.height-70), RPG::Cache.icon("message_中"), RPG::Cache.icon("message_中").rect)
  424.   end
  425.    
  426.   
  427.   #--------------------------------------------------------------------------
  428.   # ○ 设置呼出对话框
  429.   #--------------------------------------------------------------------------
  430.   def set_fukidasi(x, y, width, height)
  431.     begin
  432.       # 不显示暂停标志
  433.       self.pause = false
  434.       # 取得对话框位置
  435.       pos = get_fuki_pos(width, height)
  436.       x = pos[0]
  437.       y = pos[1]
  438.       skin = FUKI::FUKI_SKIN_NAME != "" ? FUKI::FUKI_SKIN_NAME : $game_system.windowskin_name
  439.       # 生成呼出对话框
  440.       self.windowskin = RPG::Cache.windowskin(skin)
  441.       self.x = x
  442.       self.y = y
  443.       self.height = height
  444.       self.width = width
  445.       #self.opacity = 0
  446.       
  447.       unless @no_term_stop
  448.         self.contents.dispose
  449.         self.contents = Bitmap.new(width - 32, height - 32)
  450.         self.back_opacity = FUKI::FUKI_OPACITY
  451.         self.contents.clear
  452.         self.contents.font.color = Color.new(0, 0, 0, 255)
  453.         self.contents.font.size = FUKI::MES_FONT_SIZE
  454.       end
  455.       # 描绘尾部图标
  456.       if $game_system.message_frame == 0
  457.         # 取得位置
  458.         tale_pos = get_tale_pos
  459.         @tale = Sprite.new
  460.         @tale.opacity = 200
  461.         # 是否显示尾部图标 <- bbschat
  462.         if FUKI::TAIL_SHOW == true
  463.           case @message_position
  464.             when 0  # 上
  465.               @tale.bitmap = RPG::Cache.icon("message_箭头")
  466.               @tale.x = tale_pos[0]
  467.               @tale.y = tale_pos[1]
  468.               @tale.z = self.z + 1
  469.             when 1  # 中
  470.               @tale.dispose
  471.               @tale = nil
  472.             when 2  # 下
  473.               @tale.bitmap = RPG::Cache.icon("message_箭头")
  474.               @tale.x = tale_pos[0]
  475.               @tale.y = tale_pos[1]
  476.               @tale.z = self.z + 1
  477.           end
  478.         end
  479.       end
  480.     rescue
  481.       del_fukidasi
  482.       reset_window(width, height)
  483.     end
  484.   end
  485.   #--------------------------------------------------------------------------
  486.   # ○ 新功能:根据输入文章计算呼出对话框的位置
  487.   #--------------------------------------------------------------------------
  488.   def get_character_KKME
  489.     if @kkme_name == "" or @kkme_name == nil
  490.       return nil
  491.     else
  492.       @kkme_name.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  493.         $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  494.       end
  495.       $mes_name = @kkme_name
  496.       for ev in $game_map.events.values
  497.         if ev.name == @kkme_name
  498.           return ev
  499.         end
  500.       end
  501.       for actor in $game_party.actors
  502.         if actor.name == @kkme_name
  503.           return $game_player
  504.         end
  505.       end
  506.       return nil
  507.     end
  508.   end
  509.    
  510.   
  511.   #--------------------------------------------------------------------------
  512.   # ○ 计算呼出对话框的位置
  513.   #--------------------------------------------------------------------------
  514.   def get_fuki_pos(width, height)
  515.    
  516.     # 取得角色
  517.     if $mes_id != nil
  518.       @character = get_character($mes_id)
  519.     else
  520.       @character = get_character_KKME
  521.     end
  522.    
  523.     if @character == nil
  524.       # 角色不存在的情况下使用默认信息框
  525.       del_fukidasi
  526.       reset_window(width, height)
  527.       return
  528.     end
  529.     # 处理坐标
  530.     x = ( @character.real_x - $game_map.display_x + 64 ) * 32 / 128 - (width / 2)
  531.     # 为尽量显示在画面内而移动横坐标
  532.     if x + width > 640
  533.       x = 640 - width
  534.     elsif x < 0
  535.       x = 0
  536.     end
  537.     # 决定窗口位置
  538.     case $game_system.message_position
  539.       when 0  # 上
  540.         y = (@character.real_y - $game_map.display_y + 64) * 32 / 128 - height - FUKI::CHARACTOR_HEIGHT + FUKI::POP_SHIFT_TOP
  541.       when 1  # 中
  542.         y = (480 - height) / 2
  543.         x = (640 - width) / 2
  544.       when 2  # 下
  545.         y =  (@character.real_y - $game_map.display_y + 64) * 32 / 128 + 32 + FUKI::POP_SHIFT_UNDER
  546.     end
  547.     # 纪录文章显示位置
  548.     @message_position = $game_system.message_position
  549.     # 如果选择自动修正,则如果文章会显示到画面外则自动改变窗口的尺寸(高度)
  550.     if FUKI::POS_FIX
  551.       case @message_position
  552.         when 0  # 上
  553.           if y <= 0
  554.             @message_position = 2
  555.             y =  (@character.real_y - $game_map.display_y + 64) * 32 / 128 + 32 + FUKI::POP_SHIFT_UNDER
  556.           end
  557.         when 2  # 下
  558.           if y + height >= 480
  559.             @message_position = 0
  560.             y = (@character.real_y - $game_map.display_y + 64) * 32 / 128 - height - FUKI::CHARACTOR_HEIGHT + FUKI::POP_SHIFT_TOP
  561.           end
  562.       end
  563.     end
  564.     return [x,y]
  565.    
  566.   end
  567.   
  568.   #--------------------------------------------------------------------------
  569.   # ○ 计算尾部图标的位置
  570.   #--------------------------------------------------------------------------
  571.   def get_tale_pos
  572.     case @message_position
  573.       when 0  # 上
  574.         # 处理坐标
  575.         x = ( @character.real_x - $game_map.display_x + 64 ) * 32 / 128 - 16
  576.         # 画面边缘的话则移动位置
  577.         if FUKI::CORNER_SHIFT
  578.           if x == 0
  579.             x = FUKI::SHIFT_PIXEL
  580.           elsif x == 640 - 32
  581.             x = 640 - 32 - FUKI::SHIFT_PIXEL
  582.           end
  583.         end
  584.         y = self.y + self.height - 16
  585.       when 1  # 中
  586.         x = nil
  587.         y = nil
  588.       when 2  # 下
  589.         # 处理坐标
  590.         x = ( @character.real_x - $game_map.display_x + 64 ) * 32 / 128 - 16
  591.         # 画面边缘的话则移动位置
  592.         if FUKI::CORNER_SHIFT
  593.           if x == 0
  594.             x = FUKI::SHIFT_PIXEL
  595.           elsif @tale.x == 640 - 32
  596.             x = 640 - 32 - FUKI::SHIFT_PIXEL
  597.           end
  598.         end
  599.         y = self.y - 16
  600.     end
  601.     return [x+8, y+10]
  602.   end

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

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

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

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

  977.   #--------------------------------------------------------------------------
  978.   # ● ★信息结束处理★
  979.   #--------------------------------------------------------------------------
  980.   def terminate_messageX
  981.     self.active = false
  982.     self.pause = false
  983.     self.index = -1
  984.     # 清除显示中标志
  985.     @contents_showing = false
  986.     @contents_showing_end = false
  987.     # 呼叫信息调用
  988.     if $game_temp.message_proc != nil
  989.       $game_temp.message_proc.call
  990.     end
  991.     # 清除文章、选择项、输入数值的相关变量
  992.     $game_temp.message_text = nil
  993.     $game_temp.message_proc = nil
  994.     @no_term_stop = true
  995.   end
  996.   
  997.   def clear
  998.     self.contents.clear   
  999.     @save_x = 0
  1000.     @save_y = 0
  1001.   end
  1002.   #--------------------------------------------------------------------------
  1003.   # ● 刷新光标矩形
  1004.   #--------------------------------------------------------------------------
  1005.   def update_cursor_rect
  1006.     if @index >= 0
  1007.       n = $game_temp.choice_start + @index
  1008.       self.cursor_rect.set(8, n * 32, @cursor_width, 32)
  1009.     else
  1010.       self.cursor_rect.empty
  1011.     end
  1012.   end
  1013.   #--------------------------------------------------------------------------
  1014.   # ● 取得普通文字色
  1015.   #--------------------------------------------------------------------------
  1016.   def normal_color
  1017.     nil_color = Color.new(0,0,0,255)
  1018.     if FUKI::FUKI_COLOR != nil_color
  1019.       color = FUKI::FUKI_COLOR
  1020.     else
  1021.       color = super
  1022.     end
  1023.     return color
  1024.   end
  1025. end


复制代码

这是那个柳柳的对话框
为什么我在Game.ini里的RTP1=没加上Standard的话
[Game]
Library=RGSS102J.dll
Scripts=Data\Scripts.rxdata
Title=XXXXXXXXX
RTP1=
RTP2=
RTP3=
就成了这样
没有箭头,对话也不在人物上面......(注:像使用方法不对的等错误应该不可能.)
后来我加上Standard
就变成正常的了.....

不知道是怎么回事

无签名,不解释

Lv1.梦旅人

梦石
0
星屑
50
在线时间
94 小时
注册时间
2007-6-3
帖子
801
5
 楼主| 发表于 2008-1-18 02:26:45 | 只看该作者
以下引用黑撒旦于2008-1-11 21:24:50的发言:

素材没拷全吧?

应该不会吧?
无签名,不解释
回复 支持 反对

使用道具 举报

Lv1.梦旅人

剑·法

梦石
0
星屑
55
在线时间
12 小时
注册时间
2006-8-31
帖子
1015
4
发表于 2008-1-12 05:24:50 | 只看该作者
素材没拷全吧?{/fd}
复活?复活!XD
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
94 小时
注册时间
2007-6-3
帖子
801
3
 楼主| 发表于 2008-1-12 04:46:25 | 只看该作者
没人知道吗?{/fd}
无签名,不解释
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
94 小时
注册时间
2007-6-3
帖子
801
2
 楼主| 发表于 2008-1-7 00:58:32 | 只看该作者 回帖奖励 |正序浏览 |阅读模式

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

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

x
  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. #  来自 http://rpg.para.s3p.net/
  16. #
  17. #  汉化修改 66RPG bbschat(2006.1.5)
  18. #    来自 http://rpg.blue/web/
  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 = "001-Blue01"   # 呼出对话框用Skin
  34.   NAME_SKIN_NAME = "001-Blue01"   # 角色名字窗口用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 = 48
  66.   # 呼出对话框的相对位置(纵坐标)
  67.   POP_SHIFT_TOP = 0         # 表示位置为上的时候
  68.   POP_SHIFT_UNDER = 0       # 表示位置为下的时候
  69.   
  70.   # 信息的表示速度(数字越小速度越快,0为瞬间表示)
  71.   # 游戏中 可随时用数字代入 $mes_speed 来改变消息表示速度。
  72.   MES_SPEED = 1

  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 ={""=>""}
  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[2]【' + @kkme_name + '】:\C[1]'
  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 = '\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.         $game_system.se_play($data_system.cursor_se)
  197.         # 描绘处理
  198.         draw_massage
  199.         @wait = $mes_speed
  200.       end
  201.     end
  202.     # 描绘结束
  203.     if $game_temp.message_text == ""
  204.       draw_opt_text
  205.       @contents_showing_end = true
  206.       @contents_drawing = false
  207.     end
  208.   end
  209.   
  210.   #--------------------------------------------------------------------------
  211.   # ○ 取得窗口尺寸
  212.   #--------------------------------------------------------------------------
  213.   def get_windowsize
  214.     x = y = 0
  215.     @h = @w = 0
  216.     @cursor_width = 0
  217.     # 有选择项的话,处理字的缩进
  218.     if $game_temp.choice_start == 0
  219.       x = 16
  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.         # 处理字的缩进
  306.         @dx = 8
  307.         # 描绘文字
  308.         #self.contents.draw_text(4 + @dx, 32 * @dy, 40, 32, c)
  309.         font_size = self.contents.font.size
  310.         self.contents.draw_text(4 + @dx, (font_size+10)*@dy, 40, 32, c)
  311.         # x 为要描绘文字宽度的加法运算
  312.         @dx += self.contents.text_size(c).width
  313.         # 循环
  314.         while ((c = text.slice!(/./m)) != "\n")
  315.           # 描绘文字
  316.           #self.contents.draw_text(4 + @dx, 32 * @dy, 40, 32, c)
  317.           self.contents.draw_text(4 + @dx, (font_size+10)*@dy, 40, 32, c)
  318.           # x 为要描绘文字宽度的加法运算
  319.           @dx += self.contents.text_size(c).width
  320.         end
  321.         if c == "\n"
  322.           # 更新光标宽度
  323.           @cursor_width = [@cursor_width, @dx].max
  324.           # dy 累加 1
  325.           @dy += 1
  326.           @dx = 0
  327.         end
  328.         return
  329.       end
  330.       # \\ 的情况下
  331.       if c == "\000"
  332.         # 还原为本来的文字
  333.         c = "\\"
  334.       end
  335.       #\C[n] 的情况下
  336.       if c == "\001"
  337.         # 更改文字色
  338.         text.sub!(/\[([0-9]+)\]/, "")
  339.         color = $1.to_i
  340.         if color >= 0 and color <= 7
  341.           self.contents.font.color = text_color(color)
  342.         end
  343.       end
  344.       # \G 的情况下
  345.       if c == "\002"
  346.         # ★生成金钱窗口★
  347.         @contents_showing_end = true
  348.         @contents_drawing = false
  349.         terminate_messageX
  350.         @save_x = @dx
  351.         @save_y = @dy
  352.       end
  353.       # 另起一行文字的情况下
  354.       if c == "\n"
  355.         # dy 累加 1
  356.         @dy += 1
  357.         @dx = 0
  358.       end
  359.       # 描绘文字
  360.       
  361.       size_zy = 6 # 设定文字动态增大——别问我这么重要的参数为什么放在这里而不放在顶部,有特殊原因的。
  362.       
  363.       
  364.       unless @old_text_info == []
  365.         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))
  366.         col = self.contents.font.color.clone
  367.         self.contents.font.color = @old_text_info[3].clone
  368.         self.contents.font.size = @old_text_info[2] -= size_zy
  369.         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])
  370.         self.contents.font.color = col
  371.         #Audio.se_play("Audio/SE/",80,100)#001-system01
  372.         @old_text_info = []
  373.       end
  374.       if c != nil
  375.         self.contents.font.size = FUKI::MES_FONT_SIZE
  376.         font_size = self.contents.font.size += size_zy
  377.         @old_text_info.push(@dx , @dy , font_size, self.contents.font.color.clone, c)
  378.         self.contents.draw_text(4+@dx, (font_size+10-size_zy)*@dy - size_zy/2, font_size, font_size, c)
  379.         self.contents.font.size -= size_zy
  380.         # dx 为要描绘文字的宽度加法运算
  381.         @dx += self.contents.text_size(c).width
  382.       end
  383.     end
  384.   end
  385.   
  386.   #--------------------------------------------------------------------------
  387.   # ○ 选择项和输入数值的情况下
  388.   #--------------------------------------------------------------------------
  389.   def draw_opt_text
  390.     # 选择项的情况下
  391.     if $game_temp.choice_max > 0
  392.       @item_max = $game_temp.choice_max
  393.       self.active = true
  394.       self.index = 0
  395.     end
  396.     # 输入数值的情况下
  397.     if $game_temp.num_input_variable_id > 0
  398.       digits_max = $game_temp.num_input_digits_max
  399.       number = $game_variables[$game_temp.num_input_variable_id]
  400.       @input_number_window = Window_InputNumber.new(digits_max)
  401.       @input_number_window.number = number
  402.       @input_number_window.x = self.x + 8
  403.       @input_number_window.y = self.y + $game_temp.num_input_start * 32
  404.     end
  405.   end
  406.   
  407.   def pic_back
  408.     @pic_skin.dispose if @pic_skin != nil
  409.     @pic_skin = Sprite.new
  410.     @pic_skin.opacity = 0 unless @no_term_stop
  411.     @pic_skin.bitmap = Bitmap.new(self.width + 35, self.height + 35)
  412.     @pic_skin.x = self.x + 2
  413.     @pic_skin.y = self.y + 2
  414.     @pic_skin.z = self.z
  415.     @pic_skin.bitmap.blt(0, 0, RPG::Cache.icon("message_左上"),  RPG::Cache.icon("message_左上").rect)
  416.     @pic_skin.bitmap.blt(self.width - 35, 0, RPG::Cache.icon("message_右上"),  RPG::Cache.icon("message_右上").rect)
  417.     @pic_skin.bitmap.blt(0, self.height - 35, RPG::Cache.icon("message_左下"),  RPG::Cache.icon("message_左下").rect)
  418.     @pic_skin.bitmap.blt(self.width - 35, self.height - 35, RPG::Cache.icon("message_右下"),  RPG::Cache.icon("message_右下").rect)
  419.     @pic_skin.bitmap.stretch_blt(Rect.new(0,35,35,self.height-70), RPG::Cache.icon("message_左"), RPG::Cache.icon("message_左").rect)
  420.     @pic_skin.bitmap.stretch_blt(Rect.new(self.width - 35,35,35,self.height-70), RPG::Cache.icon("message_右"), RPG::Cache.icon("message_右").rect)
  421.     @pic_skin.bitmap.stretch_blt(Rect.new(35,0,self.width-70,35), RPG::Cache.icon("message_上"), RPG::Cache.icon("message_上").rect)
  422.     @pic_skin.bitmap.stretch_blt(Rect.new(35,self.height-35,self.width-70,35), RPG::Cache.icon("message_下"), RPG::Cache.icon("message_下").rect)
  423.     @pic_skin.bitmap.stretch_blt(Rect.new(35,35,self.width-70,self.height-70), RPG::Cache.icon("message_中"), RPG::Cache.icon("message_中").rect)
  424.   end
  425.    
  426.   
  427.   #--------------------------------------------------------------------------
  428.   # ○ 设置呼出对话框
  429.   #--------------------------------------------------------------------------
  430.   def set_fukidasi(x, y, width, height)
  431.     begin
  432.       # 不显示暂停标志
  433.       self.pause = false
  434.       # 取得对话框位置
  435.       pos = get_fuki_pos(width, height)
  436.       x = pos[0]
  437.       y = pos[1]
  438.       skin = FUKI::FUKI_SKIN_NAME != "" ? FUKI::FUKI_SKIN_NAME : $game_system.windowskin_name
  439.       # 生成呼出对话框
  440.       self.windowskin = RPG::Cache.windowskin(skin)
  441.       self.x = x
  442.       self.y = y
  443.       self.height = height
  444.       self.width = width
  445.       #self.opacity = 0
  446.       
  447.       unless @no_term_stop
  448.         self.contents.dispose
  449.         self.contents = Bitmap.new(width - 32, height - 32)
  450.         self.back_opacity = FUKI::FUKI_OPACITY
  451.         self.contents.clear
  452.         self.contents.font.color = Color.new(0, 0, 0, 255)
  453.         self.contents.font.size = FUKI::MES_FONT_SIZE
  454.       end
  455.       # 描绘尾部图标
  456.       if $game_system.message_frame == 0
  457.         # 取得位置
  458.         tale_pos = get_tale_pos
  459.         @tale = Sprite.new
  460.         @tale.opacity = 200
  461.         # 是否显示尾部图标 <- bbschat
  462.         if FUKI::TAIL_SHOW == true
  463.           case @message_position
  464.             when 0  # 上
  465.               @tale.bitmap = RPG::Cache.icon("message_箭头")
  466.               @tale.x = tale_pos[0]
  467.               @tale.y = tale_pos[1]
  468.               @tale.z = self.z + 1
  469.             when 1  # 中
  470.               @tale.dispose
  471.               @tale = nil
  472.             when 2  # 下
  473.               @tale.bitmap = RPG::Cache.icon("message_箭头")
  474.               @tale.x = tale_pos[0]
  475.               @tale.y = tale_pos[1]
  476.               @tale.z = self.z + 1
  477.           end
  478.         end
  479.       end
  480.     rescue
  481.       del_fukidasi
  482.       reset_window(width, height)
  483.     end
  484.   end
  485.   #--------------------------------------------------------------------------
  486.   # ○ 新功能:根据输入文章计算呼出对话框的位置
  487.   #--------------------------------------------------------------------------
  488.   def get_character_KKME
  489.     if @kkme_name == "" or @kkme_name == nil
  490.       return nil
  491.     else
  492.       @kkme_name.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  493.         $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  494.       end
  495.       $mes_name = @kkme_name
  496.       for ev in $game_map.events.values
  497.         if ev.name == @kkme_name
  498.           return ev
  499.         end
  500.       end
  501.       for actor in $game_party.actors
  502.         if actor.name == @kkme_name
  503.           return $game_player
  504.         end
  505.       end
  506.       return nil
  507.     end
  508.   end
  509.    
  510.   
  511.   #--------------------------------------------------------------------------
  512.   # ○ 计算呼出对话框的位置
  513.   #--------------------------------------------------------------------------
  514.   def get_fuki_pos(width, height)
  515.    
  516.     # 取得角色
  517.     if $mes_id != nil
  518.       @character = get_character($mes_id)
  519.     else
  520.       @character = get_character_KKME
  521.     end
  522.    
  523.     if @character == nil
  524.       # 角色不存在的情况下使用默认信息框
  525.       del_fukidasi
  526.       reset_window(width, height)
  527.       return
  528.     end
  529.     # 处理坐标
  530.     x = ( @character.real_x - $game_map.display_x + 64 ) * 32 / 128 - (width / 2)
  531.     # 为尽量显示在画面内而移动横坐标
  532.     if x + width > 640
  533.       x = 640 - width
  534.     elsif x < 0
  535.       x = 0
  536.     end
  537.     # 决定窗口位置
  538.     case $game_system.message_position
  539.       when 0  # 上
  540.         y = (@character.real_y - $game_map.display_y + 64) * 32 / 128 - height - FUKI::CHARACTOR_HEIGHT + FUKI::POP_SHIFT_TOP
  541.       when 1  # 中
  542.         y = (480 - height) / 2
  543.         x = (640 - width) / 2
  544.       when 2  # 下
  545.         y =  (@character.real_y - $game_map.display_y + 64) * 32 / 128 + 32 + FUKI::POP_SHIFT_UNDER
  546.     end
  547.     # 纪录文章显示位置
  548.     @message_position = $game_system.message_position
  549.     # 如果选择自动修正,则如果文章会显示到画面外则自动改变窗口的尺寸(高度)
  550.     if FUKI::POS_FIX
  551.       case @message_position
  552.         when 0  # 上
  553.           if y <= 0
  554.             @message_position = 2
  555.             y =  (@character.real_y - $game_map.display_y + 64) * 32 / 128 + 32 + FUKI::POP_SHIFT_UNDER
  556.           end
  557.         when 2  # 下
  558.           if y + height >= 480
  559.             @message_position = 0
  560.             y = (@character.real_y - $game_map.display_y + 64) * 32 / 128 - height - FUKI::CHARACTOR_HEIGHT + FUKI::POP_SHIFT_TOP
  561.           end
  562.       end
  563.     end
  564.     return [x,y]
  565.    
  566.   end
  567.   
  568.   #--------------------------------------------------------------------------
  569.   # ○ 计算尾部图标的位置
  570.   #--------------------------------------------------------------------------
  571.   def get_tale_pos
  572.     case @message_position
  573.       when 0  # 上
  574.         # 处理坐标
  575.         x = ( @character.real_x - $game_map.display_x + 64 ) * 32 / 128 - 16
  576.         # 画面边缘的话则移动位置
  577.         if FUKI::CORNER_SHIFT
  578.           if x == 0
  579.             x = FUKI::SHIFT_PIXEL
  580.           elsif x == 640 - 32
  581.             x = 640 - 32 - FUKI::SHIFT_PIXEL
  582.           end
  583.         end
  584.         y = self.y + self.height - 16
  585.       when 1  # 中
  586.         x = nil
  587.         y = nil
  588.       when 2  # 下
  589.         # 处理坐标
  590.         x = ( @character.real_x - $game_map.display_x + 64 ) * 32 / 128 - 16
  591.         # 画面边缘的话则移动位置
  592.         if FUKI::CORNER_SHIFT
  593.           if x == 0
  594.             x = FUKI::SHIFT_PIXEL
  595.           elsif @tale.x == 640 - 32
  596.             x = 640 - 32 - FUKI::SHIFT_PIXEL
  597.           end
  598.         end
  599.         y = self.y - 16
  600.     end
  601.     return [x+8, y+10]
  602.   end

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

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

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

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

  977.   #--------------------------------------------------------------------------
  978.   # ● ★信息结束处理★
  979.   #--------------------------------------------------------------------------
  980.   def terminate_messageX
  981.     self.active = false
  982.     self.pause = false
  983.     self.index = -1
  984.     # 清除显示中标志
  985.     @contents_showing = false
  986.     @contents_showing_end = false
  987.     # 呼叫信息调用
  988.     if $game_temp.message_proc != nil
  989.       $game_temp.message_proc.call
  990.     end
  991.     # 清除文章、选择项、输入数值的相关变量
  992.     $game_temp.message_text = nil
  993.     $game_temp.message_proc = nil
  994.     @no_term_stop = true
  995.   end
  996.   
  997.   def clear
  998.     self.contents.clear   
  999.     @save_x = 0
  1000.     @save_y = 0
  1001.   end
  1002.   #--------------------------------------------------------------------------
  1003.   # ● 刷新光标矩形
  1004.   #--------------------------------------------------------------------------
  1005.   def update_cursor_rect
  1006.     if @index >= 0
  1007.       n = $game_temp.choice_start + @index
  1008.       self.cursor_rect.set(8, n * 32, @cursor_width, 32)
  1009.     else
  1010.       self.cursor_rect.empty
  1011.     end
  1012.   end
  1013.   #--------------------------------------------------------------------------
  1014.   # ● 取得普通文字色
  1015.   #--------------------------------------------------------------------------
  1016.   def normal_color
  1017.     nil_color = Color.new(0,0,0,255)
  1018.     if FUKI::FUKI_COLOR != nil_color
  1019.       color = FUKI::FUKI_COLOR
  1020.     else
  1021.       color = super
  1022.     end
  1023.     return color
  1024.   end
  1025. end


复制代码

这是那个柳柳的对话框
为什么我在Game.ini里的RTP1=没加上Standard的话
[Game]
Library=RGSS102J.dll
Scripts=Data\Scripts.rxdata
Title=XXXXXXXXX
RTP1=
RTP2=
RTP3=
就成了这样
没有箭头,对话也不在人物上面......(注:像使用方法不对的等错误应该不可能.)
后来我加上Standard
就变成正常的了.....

不知道是怎么回事

无签名,不解释
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

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

GMT+8, 2025-7-27 17:22

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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