查看: 2007|回复: 11

[已经过期] 求一个对话框显示字同时伴有声音的脚本

[复制链接]
梦石
0
星屑
915
在线时间
107 小时
注册时间
2017-12-2
回帖
51
发表于 2018-2-10 12:08:21 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 wskai 于 2018-2-10 12:37 编辑

这是放在我的工程里出的错误

这是放在我的工程里出的错误
可以给个范例工程,不要FUKI对话框之类的,和我游戏的脚本冲突了还什么怎么了不清楚导致无法使用或是帮我解决一下也行,谢谢!!!!!!!

按图片顺序发布

在别的工程也不行,一个个脚本排查也排查不出来



  1. #==============================================================================
  2. #
  3. # ▼ Yami Engine Ace - 气泡对话框
  4. # -- 最后更新: 2012.06.07
  5. # -- 使用难度: Normal
  6. # -- 需要脚本: 无
  7. #
  8. #==============================================================================

  9. $imported = {} if $imported.nil?
  10. $imported["YSE-PopMessage"] = true

  11. #==============================================================================
  12. # ▼ Updates
  13. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  14. # 2012.06.07 - Fixed Compatible: YEA - Ace Message System.
  15. # 2012.05.11 - Fixed Message Position.
  16. #            - Remove Requirement: YSE - Fix Events Order.
  17. # 2012.05.07 - Fixed Face position.
  18. #            - Added Requirement: YSE - Fix Events Order.
  19. # 2012.04.06 - You can change Bubble Tag filename.
  20. # 2012.03.28 - Fixed Default Message Position and Sizes.
  21. # 2012.03.27 - Fixed Default Message.
  22. # 2012.03.27 - Added Bubble Tag.
  23. # 2012.03.25 - Fixed Escape Message.
  24. # 2012.03.24 - Fixed Battle Message.
  25. # 2012.03.24 - Rewrote script.
  26. #
  27. #==============================================================================
  28. # ▼ 介绍
  29. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  30. # 本脚本可以将对话框改变为气泡对话框,使用"BubbleTag"作为气泡标志图片,放在:
  31. # \Graphics\System 文件夹中.
  32. # 需要配合脚本:Yami Engine Ace - Bug修复: 事件ID顺序 一起使用.
  33. #==============================================================================
  34. # ▼ 安装方式
  35. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  36. # 打开脚本编辑器,将本脚本拷贝/复制到一个在▼ 插件脚本之下▼ Main之上的新
  37. # 脚本页/槽中.记得保存你的工程以使脚本生效.
  38. #
  39. # -----------------------------------------------------------------------------
  40. # 文本代码 - 可以在文字窗口中使用的代码.
  41. # -----------------------------------------------------------------------------
  42. #     代码:    效果:
  43. #    \bm[x]    - 在x号事件处显示气泡对话框. *注释
  44. #    \cbm      - 关闭气泡对话框效果.
  45. #
  46. #              *注释: 设定为 0 则会在角色处显示.
  47. #
  48. #==============================================================================
  49. # ▼ 兼容性
  50. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  51. # 本脚本仅为RPG Maker VX Ace编写.极不可能在无任何修改的情况下运行于RPG Maker VX.
  52. #
  53. #==============================================================================

  54. module YSE
  55.   module POP_MESSAGE
  56.    
  57.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  58.     # - 视觉效果设置 -
  59.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  60.     LIMIT = { # 开始.
  61.       :limit_width    =>  0,  # 宽度限制,设定为0则无限制.
  62.       :limit_line     =>  6,  # 行数限制,设定为0则无限制.
  63.     } # 结束.
  64.    
  65.     POSITION = { # 开始.
  66.       :x_buffer       =>  0,   #调整气泡对话框的x坐标
  67.       :y_buffer       =>  -36, #调整气泡对话框的y坐标
  68.       :face_x_buffer  =>  8,   #调整角色肖像图的x坐标
  69.       :face_y_buffer  =>  24,  #调整角色肖像图的y坐标
  70.       :tag_y_buffer   =>  -6,  #调整角色肖像图的y坐标
  71.       :name_x_buffer  =>  112, #调整名称窗口的x坐标,需要脚本 YEA - 文本系统.
  72.     } # 结束.
  73.    
  74.     EFFECT = { # 开始.
  75.       :fade_face       =>  true, #是否显示角色肖像图淡入效果
  76.       :move_face       =>  true, #是否显示角色肖像图移动效果
  77.       :use_bubble_tag  =>  true, #是否显示气泡标志图片
  78.       :bubble_tag_name => "BubbleTag",#气泡标志图片的文件名
  79.     } # 结束.
  80.    
  81.   end
  82. end

  83. #==============================================================================
  84. # ▼ 编辑以下内容可能会出现电脑损坏、死机,电脑主人脑袋爆炸、昏迷、死亡或口臭
  85. # 所以编辑了后果自负。
  86. #==============================================================================

  87. #==============================================================================
  88. # ■ Spriteset_Map
  89. #==============================================================================

  90. class Spriteset_Map
  91.   
  92.   #--------------------------------------------------------------------------
  93.   # public instance variables
  94.   #--------------------------------------------------------------------------
  95.   attr_accessor :character_sprites
  96.   
  97. end # Spriteset_Map

  98. #==============================================================================
  99. # ■ Window_Message_Face
  100. #==============================================================================

  101. class Window_Message_Face < Window_Base
  102.   
  103.   #--------------------------------------------------------------------------
  104.   # initialize
  105.   #--------------------------------------------------------------------------
  106.   def initialize
  107.     super(0, 0, 120, 120)
  108.     self.opacity = 0
  109.     @face_name = ""
  110.     @face_index = 0
  111.     @move_x = 0
  112.     close
  113.   end
  114.   
  115.   #--------------------------------------------------------------------------
  116.   # message_window=
  117.   #--------------------------------------------------------------------------
  118.   def message_window=(window)
  119.     @message_window = window
  120.   end
  121.   
  122.   #--------------------------------------------------------------------------
  123.   # set_face
  124.   #--------------------------------------------------------------------------
  125.   def set_face
  126.     contents.clear
  127.     return unless @message_window
  128.     if !$game_message.face_name.empty?
  129.       draw_face($game_message.face_name, $game_message.face_index, 0, 0)
  130.       set_position
  131.       show_face
  132.     else
  133.       hide_face
  134.     end
  135.   end
  136.   
  137.   #--------------------------------------------------------------------------
  138.   # set_position
  139.   #--------------------------------------------------------------------------
  140.   def set_position
  141.     return unless @message_window
  142.     self.x = @message_window.x
  143.     self.y = @message_window.y - 96
  144.     self.x += YSE::POP_MESSAGE::POSITION[:face_x_buffer]
  145.     self.y += YSE::POP_MESSAGE::POSITION[:face_y_buffer]
  146.     self.y += (@message_window.real_lines - 1) * 24
  147.     self.z = @message_window.z + 1
  148.     if (@face_name != $game_message.face_name || @face_index != $game_message.face_index)
  149.       if YSE::POP_MESSAGE::EFFECT[:move_face]
  150.         @move_x = 30
  151.         self.x -= 30
  152.       end
  153.       @face_name = $game_message.face_name
  154.       @face_index = $game_message.face_index
  155.       self.contents_opacity = 0 if YSE::POP_MESSAGE::EFFECT[:fade_face]
  156.     end
  157.   end
  158.   
  159.   #--------------------------------------------------------------------------
  160.   # show_face
  161.   #--------------------------------------------------------------------------
  162.   def show_face
  163.     open
  164.   end
  165.   
  166.   #--------------------------------------------------------------------------
  167.   # hide_face
  168.   #--------------------------------------------------------------------------
  169.   def hide_face
  170.     contents.clear
  171.     close
  172.   end
  173.   
  174.   #--------------------------------------------------------------------------
  175.   # update
  176.   #--------------------------------------------------------------------------
  177.   def update
  178.     super
  179.     self.contents_opacity += 15 if self.contents_opacity < 255
  180.     unless @move_x <= 0
  181.       self.x += 2
  182.       @move_x -= 2
  183.     end
  184.   end
  185.   
  186. end # Sprite_Message_Face

  187. #==============================================================================
  188. # ■ Window_Message
  189. #==============================================================================

  190. class Window_Message < Window_Base
  191.   
  192.   #--------------------------------------------------------------------------
  193.   # new method: face_window=
  194.   #--------------------------------------------------------------------------
  195.   def face_window=(window)
  196.     @face_window = window
  197.   end
  198.   
  199.   #--------------------------------------------------------------------------
  200.   # new method: bubble_tag=
  201.   #--------------------------------------------------------------------------
  202.   def bubble_tag=(sprite)
  203.     @bubble_tag = sprite
  204.   end
  205.   
  206.   #--------------------------------------------------------------------------
  207.   # new method: message_escape_characters_pop_message
  208.   #--------------------------------------------------------------------------
  209.   def message_escape_characters_pop_message(result)
  210.     result.gsub!(/\eBM\[(\d+)\]/i) { event_pop_message_setup($1.to_i, false) }
  211.     result.gsub!(/\eBMF\[(\d+)\]/i) { event_pop_message_setup($1.to_i, true) }
  212.     result.gsub!(/\eCBM/i) { event_pop_message_setup(nil, false) }
  213.     result
  214.   end
  215.   
  216.   #--------------------------------------------------------------------------
  217.   # alias method: convert_escape_characters
  218.   #--------------------------------------------------------------------------
  219.   alias yse_convert_escape_characters_pm convert_escape_characters
  220.   def convert_escape_characters(text)
  221.     result = yse_convert_escape_characters_pm(text)
  222.     result = message_escape_characters_pop_message(result)
  223.     result
  224.   end
  225.   
  226.   #--------------------------------------------------------------------------
  227.   # new method: event_pop_message_setup
  228.   #--------------------------------------------------------------------------
  229.   def event_pop_message_setup(event_id, follower = false)
  230.     if follower && $game_player.followers[event_id].nil?
  231.       @event_pop_id = nil
  232.       @event_pop_follower = false
  233.       return ""
  234.     end
  235.     @event_pop_follower = follower
  236.     @event_pop_id = event_id
  237.     return ""
  238.   end
  239.   
  240.   #--------------------------------------------------------------------------
  241.   # new method: set_face_position
  242.   #--------------------------------------------------------------------------
  243.   def set_face_position
  244.     return unless SceneManager.scene_is?(Scene_Map)
  245.     return unless @event_pop_id
  246.     return unless @face_window
  247.     contents.clear
  248.     @face_window.set_face
  249.     return unless $imported["YEA-MessageSystem"]
  250.     return if @face_window.close?
  251.     #@name_window.x = self.x + YSE::POP_MESSAGE::POSITION[:face_x_buffer] + YSE::POP_MESSAGE::POSITION[:name_x_buffer] if (@name_position == 1 || @name_position == 2)
  252.   end
  253.   
  254.   #--------------------------------------------------------------------------
  255.   # alias method: new_page
  256.   #--------------------------------------------------------------------------
  257.   alias window_message_new_page_pm_yse new_page
  258.   def new_page(text, pos)
  259.     window_message_new_page_pm_yse(text, pos)
  260.     set_face_position
  261.   end
  262.   
  263.   #--------------------------------------------------------------------------
  264.   # alias method: close
  265.   #--------------------------------------------------------------------------
  266.   alias pop_message_close close
  267.   def close
  268.     pop_message_close
  269.     return unless SceneManager.scene_is?(Scene_Map)
  270.     return unless @event_pop_id
  271.     @event_pop_id = nil
  272.     @event_pop_follower = false
  273.     @face_window.hide_face
  274.     return unless YSE::POP_MESSAGE::EFFECT[:use_bubble_tag]
  275.     @bubble_tag.visible = false if @bubble_tag
  276.   end
  277.   
  278.   #--------------------------------------------------------------------------
  279.   # alias method: open_and_wait
  280.   #--------------------------------------------------------------------------
  281.   alias pop_message_open_and_wait open_and_wait
  282.   def open_and_wait
  283.     pop_message_open_and_wait
  284.     return unless YSE::POP_MESSAGE::EFFECT[:use_bubble_tag]
  285.     @bubble_tag.visible = true if @event_pop_id && @bubble_tag
  286.   end
  287.   
  288.   #--------------------------------------------------------------------------
  289.   # alias method: process_all_text
  290.   #--------------------------------------------------------------------------
  291.   alias pop_message_process_all_text process_all_text
  292.   def process_all_text
  293.     @event_pop_id = nil
  294.     convert_escape_characters($game_message.all_text)
  295.     update_placement
  296.     adjust_pop_message($game_message.all_text)
  297.     pop_message_process_all_text
  298.   end

  299.   #--------------------------------------------------------------------------
  300.   # alias method: update_placement
  301.   #--------------------------------------------------------------------------
  302.   alias event_pop_message_update_placement update_placement
  303.   def update_placement
  304.     if SceneManager.scene_is?(Scene_Map)
  305.       if @event_pop_id.nil?
  306.         fix_default_message
  307.         event_pop_message_update_placement
  308.       elsif @event_pop_id == 0
  309.         character = $game_player
  310.         self.y = character.screen_y - self.height + YSE::POP_MESSAGE::POSITION[:y_buffer]
  311.         self.x = character.screen_x - self.width / 2 + YSE::POP_MESSAGE::POSITION[:x_buffer]
  312.         fix_position_bubble(character)
  313.         set_bubble_tag(character)
  314.       elsif @event_pop_id > 0
  315.         hash = @event_pop_follower ? $game_player.followers : $game_map.events
  316.         character = hash[@event_pop_id]
  317.         self.y = character.screen_y - self.height + YSE::POP_MESSAGE::POSITION[:y_buffer]
  318.         self.x = character.screen_x - self.width / 2 + YSE::POP_MESSAGE::POSITION[:x_buffer]
  319.         fix_position_bubble(character)
  320.         set_bubble_tag(character)
  321.       end
  322.     else
  323.       event_pop_message_update_placement
  324.     end
  325.   end
  326.   
  327.   #--------------------------------------------------------------------------
  328.   # new method: fix_default_message
  329.   #--------------------------------------------------------------------------
  330.   def fix_default_message
  331.     self.width = window_width
  332.     self.height = window_height
  333.     self.x = 0
  334.     @face_window.hide_face if @face_window
  335.     create_contents
  336.     return unless YSE::POP_MESSAGE::EFFECT[:use_bubble_tag]
  337.     @bubble_tag.visible = false if @bubble_tag
  338.   end
  339.   
  340.   #--------------------------------------------------------------------------
  341.   # new method: fix_position_bubble
  342.   #--------------------------------------------------------------------------
  343.   def fix_position_bubble(character)
  344.     end_x = self.x + self.width
  345.     end_y = self.y + self.height
  346.     self.x = 0 if self.x < 0
  347.     self.y = character.screen_y if self.y < 0
  348.     self.x = Graphics.width - self.width if end_x > Graphics.width
  349.     self.y = Graphics.height - self.height if end_y > Graphics.height
  350.   end
  351.   
  352.   #--------------------------------------------------------------------------
  353.   # new method: set_bubble_tag
  354.   #--------------------------------------------------------------------------
  355.   def set_bubble_tag(character)
  356.     return unless YSE::POP_MESSAGE::EFFECT[:use_bubble_tag]
  357.     return unless @bubble_tag
  358.     up = self.y == character.screen_y
  359.     self.y += up ? @bubble_tag.height / 2 : -@bubble_tag.height / 2
  360.     @bubble_tag.x = character.screen_x - @bubble_tag.width / 2
  361.     if up
  362.       @bubble_tag.src_rect.set(0, @bubble_tag.height, @bubble_tag.width, @bubble_tag.height)
  363.       @bubble_tag.y = self.y - @bubble_tag.height - YSE::POP_MESSAGE::POSITION[:tag_y_buffer]
  364.     else
  365.       @bubble_tag.src_rect.set(0, 0, @bubble_tag.width, @bubble_tag.height)
  366.       @bubble_tag.y = self.y + self.height + YSE::POP_MESSAGE::POSITION[:tag_y_buffer]
  367.     end
  368.   end
  369.   
  370.   #--------------------------------------------------------------------------
  371.   # new method: cal_number_line
  372.   #--------------------------------------------------------------------------
  373.   def cal_number_line(text)
  374.     result = 0
  375.     text.each_line { result += 1 }
  376.     return result
  377.   end
  378.   
  379.   #--------------------------------------------------------------------------
  380.   # new method: cal_width_line
  381.   #--------------------------------------------------------------------------
  382.   def cal_width_line(text)
  383.     result = 0
  384.     text.each_line { |line|
  385.       result = text_size(line).width if result < text_size(line).width
  386.     }
  387.     return result
  388.   end

  389.   #--------------------------------------------------------------------------
  390.   # alias method: adjust_message_window_size
  391.   #--------------------------------------------------------------------------
  392.   if $imported["YEA-MessageSystem"]
  393.   alias yse_pop_message_adjust_message_window_size adjust_message_window_size
  394.   def adjust_message_window_size
  395.     start_name_window if @event_pop_id
  396.     return if @event_pop_id
  397.     yse_pop_message_adjust_message_window_size
  398.   end
  399.   end
  400.   
  401.   #--------------------------------------------------------------------------
  402.   # new method: adjust_pop_message
  403.   #--------------------------------------------------------------------------
  404.   def adjust_pop_message(text = " ")
  405.     return unless SceneManager.scene_is?(Scene_Map)
  406.     unless @event_pop_id
  407.       if $imported["YEA-MessageSystem"]
  408.         #adjust_message_window_size
  409.       end
  410.       return
  411.     end
  412.     n_line = cal_number_line(text)
  413.     n_line = YSE::POP_MESSAGE::LIMIT[:limit_line] if YSE::POP_MESSAGE::LIMIT[:limit_line] > 0 && cal_number_line(text) > YSE::POP_MESSAGE::LIMIT[:limit_line]
  414.     @real_lines = n_line
  415.     self.height = fitting_height(n_line)
  416.     self.width = cal_width_line(text) + 24
  417.     self.width += new_line_x
  418.     if self.width > YSE::POP_MESSAGE::LIMIT[:limit_width] && YSE::POP_MESSAGE::LIMIT[:limit_width] > 0
  419.       self.width = YSE::POP_MESSAGE::LIMIT[:limit_width]
  420.     end
  421.     create_contents
  422.     update_placement
  423.   end
  424.   
  425.   #--------------------------------------------------------------------------
  426.   # overwrite method: new_line_x
  427.   #--------------------------------------------------------------------------
  428.   def new_line_x
  429.     if $game_message.face_name.empty?
  430.       return 0
  431.     else
  432.       result = YSE::POP_MESSAGE::POSITION[:face_x_buffer]
  433.       p_x = $imported["YEA-MessageSystem"] ? YEA::MESSAGE::FACE_INDENT_X : 112
  434.       result += p_x
  435.       return result
  436.     end
  437.   end
  438.   
  439.   #--------------------------------------------------------------------------
  440.   # new method: real_lines
  441.   #--------------------------------------------------------------------------
  442.   def real_lines
  443.     @real_lines
  444.   end
  445.   
  446. end # Window_Message

  447. #==============================================================================
  448. # ■ Scene_Map
  449. #==============================================================================

  450. class Scene_Map < Scene_Base
  451.   
  452.   #--------------------------------------------------------------------------
  453.   # alias method: create_message_window
  454.   #--------------------------------------------------------------------------
  455.   alias yse_pm_create_message_window create_message_window
  456.   def create_message_window
  457.     yse_pm_create_message_window
  458.     @face_window = Window_Message_Face.new
  459.     @face_window.message_window = @message_window
  460.     if YSE::POP_MESSAGE::EFFECT[:use_bubble_tag]
  461.       @bubble_tag_sprite = Sprite.new
  462.       @bubble_tag_sprite.visible = false
  463.       @bubble_tag_sprite.bitmap = Cache.system(YSE::POP_MESSAGE::EFFECT[:bubble_tag_name])
  464.       @bubble_tag_sprite.src_rect.set(0, 0, @bubble_tag_sprite.width, @bubble_tag_sprite.height / 2)
  465.       @message_window.bubble_tag = @bubble_tag_sprite
  466.     end
  467.     @message_window.face_window = @face_window
  468.   end
  469.   
  470.   #--------------------------------------------------------------------------
  471.   # alias method: dispose_spriteset
  472.   #--------------------------------------------------------------------------
  473.   alias pop_message_dispose_spriteset dispose_spriteset
  474.   def dispose_spriteset
  475.     pop_message_dispose_spriteset
  476.     return unless @bubble_tag_sprite
  477.     @bubble_tag_sprite.dispose
  478.   end
  479.   
  480. end # Scene_Map

  481. #==============================================================================
  482. #
  483. # ▼ End of File
  484. #
  485. #==============================================================================
复制代码










  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - 文本系统 v1.05
  4. # -- 最后更新: 2012.01.13
  5. # -- 使用难度: 普通
  6. # -- 需要脚本: 无
  7. #
  8. #==============================================================================

  9. $imported = {} if $imported.nil?
  10. $imported["YEA-MessageSystem"] = true

  11. #==============================================================================
  12. # ▼ Updates
  13. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  14. # 2012.07.21 - Fixed REGEXP error at line 824
  15. # 2012.01.13 - Bug Fixed: Negative tags didn't display other party members.
  16. # 2012.01.12 - Compatibility Update: Message Actor Codes
  17. # 2012.01.10 - Added Feature: \pic[x] text code.
  18. # 2012.01.04 - Bug Fixed: \ic tag was \ii. No longer the case.
  19. #            - Added: Scroll Text window now uses message window font.
  20. # 2011.12.31 - Started Script and Finished.
  21. #
  22. #==============================================================================
  23. # ▼ 介绍
  24. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  25. # 尽管RPG Maker VX Ace已经为文本系统添加各种实用的功能,再加多一点新功能也未尝
  26. # 不可,像新的窗口,转换文本编码,以更快的方式输出物品,武器,护甲等的图标和/或
  27. # 名称。本脚本还为脚本开发人员提供在游戏过程中调整文本窗口大小的功能,使用单
  28. # 独的字体,并为玩家提供文本快进功能。
  29. #
  30. #==============================================================================
  31. # ▼ 安装方式
  32. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  33. # 打开脚本编辑器,将本脚本拷贝/复制到一个在▼ 插件脚本之下▼ Main之上的新
  34. # 脚本页/槽中.记得保存你的工程以使脚本生效.
  35. #
  36. # -----------------------------------------------------------------------------
  37. # 文本代码 - 在文本窗口中可以使用的代码.
  38. # -----------------------------------------------------------------------------
  39. #    代码:       效果:
  40. #    \v[x]     - 显示x号变量的值.
  41. #    \n[x]     - 显示x号角色的名字.
  42. #    \p[x]     - 显示队伍中x号队友的名字.
  43. #    \g        - 显示当前金币名.
  44. #    \c[x]     - 改变字体颜色为x.
  45. #    \i[x]     - 显示index为x的图标.
  46. #    \{        - 文字增大8点.
  47. #    \}        - 文字缩小8点.
  48. #    \$        - 打开金币窗口.
  49. #    \.        - 等待15帧 (1/4秒).
  50. #    \|        - 等待60帧 (1秒).
  51. #    \!        - 等待直到玩家按下确定键.
  52. #    \>        - 立即显示完剩下的文本.
  53. #    \<        - 停止立即显示剩下的文本.
  54. #    \^        - 跳到下一个文本框.
  55. #    \\        - 显示一个"".
  56. #
  57. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  58. #
  59. #    等待:       效果:
  60. #    \w[x]     - 等待x帧 (60 帧 = 1 秒). 仅用于文本窗口.
  61. #
  62. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  63. #
  64. #  名称窗口:     效果:
  65. #    \n<x>     - 创建一个显示"x"的名称窗口. 靠左. *注释
  66. #    \nc<x>    - 创建一个显示"x"的名称窗口. 居中. *注释
  67. #    \nr<x>    - 创建一个显示"x"的名称窗口. 靠右. *注释
  68. #
  69. #              *注释: 仅用于文本窗口.
  70. #
  71. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  72. #
  73. #    位置:       效果:
  74. #    \px[n]    - 将文本的x坐标设定为n.
  75. #    \py[n]    - 将文本的y坐标设定为n.
  76. #
  77. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  78. #
  79. #     图片:       效果:
  80. #    \pic[x]   - 显示图片x,其放在文件夹:Graphics\Pictures .
  81. #
  82. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  83. #
  84. #     轮廓:      效果:
  85. #    \oc[x]    - 设定轮廓颜色为x.
  86. #    \oo[x]    - 设定轮廓不透明度为x.
  87. #
  88. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  89. #
  90. #    字体:       效果:
  91. #    \fr       - 重置全部字体的变化.
  92. #    \fz[x]    - 改变字体大小为x.
  93. #    \fn[x]    - 改变字体名为x.
  94. #    \fb       - 切换字体加粗状态.
  95. #    \fi       - 切换字体斜体状态.
  96. #    \fo       - 切换字体轮廓状态.
  97. #    \fs       - 切换字体阴影状态.
  98. #
  99. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  100. #
  101. #     角色:       效果:
  102. #    \af[x]    - 显示x号角色的脸图. *注释
  103. #    \ac[x]    - 显示x号角色的职业名. *注释
  104. #    \as[x]    - 显示x号角色的副职业名. 需要脚本: Class System. *注释
  105. #    \an[x]    - 显示x号角色的称号. *注释
  106. #
  107. #              *注释: 如果x是0或负数,则视为当前角色(玩家操控的队长)或队友:
  108. #                   0 - 队长
  109. #                  -1 - 第一个非队长角色.
  110. #                  -2 - 第二个非队长角色. 以此类推.
  111. #
  112. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  113. #
  114. #     名字:      效果:
  115. #    \nc[x]    - 显示x号职业的名字.
  116. #    \ni[x]    - 显示x号物品的名字.
  117. #    \nw[x]    - 显示x号武器的名字.
  118. #    \na[x]    - 显示x号防具的名字.
  119. #    \ns[x]    - 显示x号技能的名字.
  120. #    \nt[x]    - 显示x号状态的名字.
  121. #
  122. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  123. #
  124. #  图标+名字:    效果:
  125. #    \ic[x]    - 显示x号职业的名字和图标. *
  126. #    \ii[x]    - 显示x号物品的名字和图标.
  127. #    \iw[x]    - 显示x号武器的名字和图标.
  128. #    \ia[x]    - 显示x号防具的名字和图标.
  129. #    \is[x]    - 显示x号技能的名字和图标.
  130. #    \it[x]    - 显示x号状态的名字和图标.
  131. #
  132. #              *注释: 需要脚本 YEA - Class System
  133. #
  134. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  135. #
  136. # 以上就为本脚本全部可用的文本代码。请记住某些代码仅可用于文本窗口,其他的则可以
  137. # 使用于物品/技能/武器/防具等的描述、角色说明或其他地方。
  138. #
  139. #==============================================================================
  140. # ▼ 兼容性
  141. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  142. # 本脚本仅为RPG Maker VX Ace编写.极不可能在无任何修改的情况下运行于RPG Maker VX.
  143. #
  144. #==============================================================================

  145. module YEA
  146.   module MESSAGE
  147.    
  148.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  149.     # - 通用设置 -
  150.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  151.     # 下面是文本窗口的通用设置.
  152.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  153.     # 快速跳过文本的按钮。按住时将加速显示文本,但是不会跳过等待。按住时会自动
  154.     # 跳到下一个文本窗口
  155.     TEXT_SKIP = :A     #  :A 为键盘上的Shift键.
  156.    
  157.     # 存储文本窗口中最大行数的变量。如果你不想使用这个功能,请设定为0。当
  158.     # 设定为0或以下时,脚本会自动默认为4行
  159.     VARIABLE_ROWS  = 21
  160.    
  161.     # 存储文本窗口中最大列数的变量。如果你不想使用这个功能,请设定为0。当
  162.     # 设定为0或以下时,脚本会自动默认列宽度为游戏窗口的宽度
  163.     VARIABLE_WIDTH = 22
  164.    
  165.     # 这是文本窗口在显示脸图时将缩进的空间量。 默认: 112
  166.     FACE_INDENT_X = 112
  167.    
  168.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  169.     # - 名称窗口设置 -
  170.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  171.     # 名称窗口是区别于文本窗口的另一个窗口,用于显示角色的名字。
  172.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  173.     NAME_WINDOW_X_BUFFER = -20     # 调整名称窗口的x坐标.
  174.     NAME_WINDOW_Y_BUFFER = 0       # 调整名称窗口的y坐标.
  175.     NAME_WINDOW_PADDING  = 20      # 横向增加的宽度.
  176.     NAME_WINDOW_OPACITY  = 255     # 名称窗口的不透明度.
  177.     NAME_WINDOW_COLOUR   = 6       # 默认文本颜色.
  178.    
  179.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  180.     # - 文本字体设置 -
  181.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  182.     # Ace 文本系统将游戏中的系统字体于文本字体中脱离。
  183.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  184.     # 在数组中放置要使用的字体,若在玩家的电脑中第一种字体不存在,则会使用第二
  185.     # 种字体,以此类推。
  186.     MESSAGE_WINDOW_FONT_NAME = ["黑体", "宋体", "微软雅黑"]
  187.    
  188.     # 关于字体的其他设置.
  189.     MESSAGE_WINDOW_FONT_SIZE    = 24       # 字体大小.
  190.     MESSAGE_WINDOW_FONT_BOLD    = false    # 是否默认加粗?
  191.     MESSAGE_WINDOW_FONT_ITALIC  = false    # 是否默认斜体?
  192.     MESSAGE_WINDOW_FONT_OUTLINE = true     # 是否默认显示轮廓?
  193.     MESSAGE_WINDOW_FONT_SHADOW  = false    # 是否默认显示阴影?
  194.    
  195.   end # MESSAGE
  196. end # YEA

  197. #==============================================================================
  198. # ▼ 编辑以下内容可能会出现电脑损坏、死机,电脑主人脑袋爆炸、昏迷、死亡或口臭
  199. # 所以编辑了后果自负。
  200. #==============================================================================

  201. #==============================================================================
  202. # ■ Variable
  203. #==============================================================================

  204. module Variable
  205.   
  206.   #--------------------------------------------------------------------------
  207.   # self.message_rows
  208.   #--------------------------------------------------------------------------
  209.   def self.message_rows
  210.     return 4 if YEA::MESSAGE::VARIABLE_ROWS <= 0
  211.     return 4 if $game_variables[YEA::MESSAGE::VARIABLE_ROWS] <= 0
  212.     return $game_variables[YEA::MESSAGE::VARIABLE_ROWS]
  213.   end
  214.   
  215.   #--------------------------------------------------------------------------
  216.   # self.message_width
  217.   #--------------------------------------------------------------------------
  218.   def self.message_width
  219.     return Graphics.width if YEA::MESSAGE::VARIABLE_WIDTH <= 0
  220.     return Graphics.width if $game_variables[YEA::MESSAGE::VARIABLE_WIDTH] <= 0
  221.     return $game_variables[YEA::MESSAGE::VARIABLE_WIDTH]
  222.   end
  223.   
  224. end # Variable

  225. #==============================================================================
  226. # ■ Game_Interpreter
  227. #==============================================================================

  228. class Game_Interpreter
  229.   
  230.   #--------------------------------------------------------------------------
  231.   # overwrite method: command_101
  232.   #--------------------------------------------------------------------------
  233.   def command_101
  234.     wait_for_message
  235.     $game_message.face_name = @params[0]
  236.     $game_message.face_index = @params[1]
  237.     $game_message.background = @params[2]
  238.     $game_message.position = @params[3]
  239.     while continue_message_string?
  240.       @index += 1
  241.       if @list[@index].code == 401
  242.         $game_message.add(@list[@index].parameters[0])
  243.       end
  244.       break if $game_message.texts.size >= Variable.message_rows
  245.     end
  246.     case next_event_code
  247.     when 102
  248.       @index += 1
  249.       setup_choices(@list[@index].parameters)
  250.     when 103
  251.       @index += 1
  252.       setup_num_input(@list[@index].parameters)
  253.     when 104
  254.       @index += 1
  255.       setup_item_choice(@list[@index].parameters)
  256.     end
  257.     wait_for_message
  258.   end
  259.   
  260.   #--------------------------------------------------------------------------
  261.   # new method: continue_message_string?
  262.   #--------------------------------------------------------------------------
  263.   def continue_message_string?
  264.     return true if next_event_code == 101 && Variable.message_rows > 4
  265.     return next_event_code == 401
  266.   end
  267.   
  268. end # Game_Interpreter

  269. #==============================================================================
  270. # ■ Window_Base
  271. #==============================================================================

  272. class Window_Base < Window
  273.   
  274.   #--------------------------------------------------------------------------
  275.   # new method: setup_message_font
  276.   #--------------------------------------------------------------------------
  277.   def setup_message_font
  278.     @message_font = true
  279.     change_color(normal_color)
  280.     contents.font.out_color = Font.default_out_color
  281.     contents.font.name = YEA::MESSAGE::MESSAGE_WINDOW_FONT_NAME
  282.     contents.font.size = YEA::MESSAGE::MESSAGE_WINDOW_FONT_SIZE
  283.     contents.font.bold = YEA::MESSAGE::MESSAGE_WINDOW_FONT_BOLD
  284.     contents.font.italic = YEA::MESSAGE::MESSAGE_WINDOW_FONT_ITALIC
  285.     contents.font.outline = YEA::MESSAGE::MESSAGE_WINDOW_FONT_OUTLINE
  286.     contents.font.shadow = YEA::MESSAGE::MESSAGE_WINDOW_FONT_SHADOW
  287.   end
  288.   
  289.   #--------------------------------------------------------------------------
  290.   # alias method: reset_font_settings
  291.   #--------------------------------------------------------------------------
  292.   alias window_base_reset_font_settings_ams reset_font_settings
  293.   def reset_font_settings
  294.     if @message_font
  295.       setup_message_font
  296.     else
  297.       window_base_reset_font_settings_ams
  298.       contents.font.out_color = Font.default_out_color
  299.       contents.font.outline = Font.default_outline
  300.       contents.font.shadow = Font.default_shadow
  301.     end
  302.   end
  303.   
  304.   #--------------------------------------------------------------------------
  305.   # alias method: convert_escape_characters
  306.   #--------------------------------------------------------------------------
  307.   alias window_base_convert_escape_characters_ams convert_escape_characters
  308.   def convert_escape_characters(text)
  309.     result = window_base_convert_escape_characters_ams(text)
  310.     result = convert_ace_message_system_new_escape_characters(result)
  311.     return result
  312.   end
  313.   
  314.   #--------------------------------------------------------------------------
  315.   # new method: convert_ace_message_system_new_escape_characters
  316.   #--------------------------------------------------------------------------
  317.   def convert_ace_message_system_new_escape_characters(result)
  318.     #---
  319.     result.gsub!(/\eFR/i) { "\eAMSF[0]" }
  320.     result.gsub!(/\eFB/i) { "\eAMSF[1]" }
  321.     result.gsub!(/\eFI/i) { "\eAMSF[2]" }
  322.     result.gsub!(/\eFO/i) { "\eAMSF[3]" }
  323.     result.gsub!(/\eFS/i) { "\eAMSF[4]" }
  324.     #---
  325.     result.gsub!(/\eAC\[([-+]?\d+)\]/i) { escape_actor_class_name($1.to_i) }
  326.     result.gsub!(/\eAS\[([-+]?\d+)\]/i) { escape_actor_subclass_name($1.to_i) }
  327.     result.gsub!(/\eAN\[([-+]?\d+)\]/i) { escape_actor_nickname($1.to_i) }
  328.     #---
  329.     result.gsub!(/\eNC\[(\d+)\]/i) { $data_classes[$1.to_i].name }
  330.     result.gsub!(/\eNI\[(\d+)\]/i) { $data_items[$1.to_i].name }
  331.     result.gsub!(/\eNW\[(\d+)\]/i) { $data_weapons[$1.to_i].name }
  332.     result.gsub!(/\eNA\[(\d+)\]/i) { $data_armors[$1.to_i].name }
  333.     result.gsub!(/\eNS\[(\d+)\]/i) { $data_skills[$1.to_i].name }
  334.     result.gsub!(/\eNT\[(\d+)\]/i) { $data_states[$1.to_i].name }
  335.     #---
  336.     result.gsub!(/\eIC\[(\d+)\]/i) { escape_icon_item($1.to_i, :class) }
  337.     result.gsub!(/\eII\[(\d+)\]/i) { escape_icon_item($1.to_i, :item) }
  338.     result.gsub!(/\eIW\[(\d+)\]/i) { escape_icon_item($1.to_i, :weapon) }
  339.     result.gsub!(/\eIA\[(\d+)\]/i) { escape_icon_item($1.to_i, :armour) }
  340.     result.gsub!(/\eIS\[(\d+)\]/i) { escape_icon_item($1.to_i, :skill) }
  341.     result.gsub!(/\eIT\[(\d+)\]/i) { escape_icon_item($1.to_i, :state) }
  342.     #---
  343.     return result
  344.   end
  345.   
  346.   #--------------------------------------------------------------------------
  347.   # new method: escape_actor_class_name
  348.   #--------------------------------------------------------------------------
  349.   def escape_actor_class_name(actor_id)
  350.     actor_id = $game_party.members[actor_id.abs].id if actor_id <= 0
  351.     actor = $game_actors[actor_id]
  352.     return "" if actor.nil?
  353.     return actor.class.name
  354.   end
  355.   
  356.   #--------------------------------------------------------------------------
  357.   # new method: actor_subclass_name
  358.   #--------------------------------------------------------------------------
  359.   def escape_actor_subclass_name(actor_id)
  360.     return "" unless $imported["YEA-ClassSystem"]
  361.     actor_id = $game_party.members[actor_id.abs].id if actor_id <= 0
  362.     actor = $game_actors[actor_id]
  363.     return "" if actor.nil?
  364.     return "" if actor.subclass.nil?
  365.     return actor.subclass.name
  366.   end
  367.   
  368.   #--------------------------------------------------------------------------
  369.   # new method: escape_actor_nickname
  370.   #--------------------------------------------------------------------------
  371.   def escape_actor_nickname(actor_id)
  372.     actor_id = $game_party.members[actor_id.abs].id if actor_id <= 0
  373.     actor = $game_actors[actor_id]
  374.     return "" if actor.nil?
  375.     return actor.nickname
  376.   end
  377.   
  378.   #--------------------------------------------------------------------------
  379.   # new method: escape_icon_item
  380.   #--------------------------------------------------------------------------
  381.   def escape_icon_item(data_id, type)
  382.     case type
  383.     when :class
  384.       return "" unless $imported["YEA-ClassSystem"]
  385.       icon = $data_classes[data_id].icon_index
  386.       name = $data_items[data_id].name
  387.     when :item
  388.       icon = $data_items[data_id].icon_index
  389.       name = $data_items[data_id].name
  390.     when :weapon
  391.       icon = $data_weapons[data_id].icon_index
  392.       name = $data_weapons[data_id].name
  393.     when :armour
  394.       icon = $data_armors[data_id].icon_index
  395.       name = $data_armors[data_id].name
  396.     when :skill
  397.       icon = $data_skills[data_id].icon_index
  398.       name = $data_skills[data_id].name
  399.     when :state
  400.       icon = $data_states[data_id].icon_index
  401.       name = $data_states[data_id].name
  402.     else; return ""
  403.     end
  404.     text = "\eI[#{icon}]" + name
  405.     return text
  406.   end
  407.   
  408.   #--------------------------------------------------------------------------
  409.   # alias method: process_escape_character
  410.   #--------------------------------------------------------------------------
  411.   alias window_base_process_escape_character_ams process_escape_character
  412.   def process_escape_character(code, text, pos)
  413.     case code.upcase
  414.     #---
  415.     when 'FZ'
  416.       contents.font.size = obtain_escape_param(text)
  417.     when 'FN'
  418.       text.sub!(/\[(.*?)\]/, "")
  419.       font_name = $1.to_s
  420.       font_name = Font.default_name if font_name.nil?
  421.       contents.font.name = font_name.to_s
  422.     #---
  423.     when 'OC'
  424.       colour = text_color(obtain_escape_param(text))
  425.       contents.font.out_color = colour
  426.     when 'OO'
  427.       contents.font.out_color.alpha = obtain_escape_param(text)
  428.     #---
  429.     when 'AMSF'
  430.       case obtain_escape_param(text)
  431.       when 0; reset_font_settings
  432.       when 1; contents.font.bold = !contents.font.bold
  433.       when 2; contents.font.italic = !contents.font.italic
  434.       when 3; contents.font.outline = !contents.font.outline
  435.       when 4; contents.font.shadow = !contents.font.shadow
  436.       end
  437.     #---
  438.     when 'PX'
  439.       pos[:x] = obtain_escape_param(text)
  440.     when 'PY'
  441.       pos[:y] = obtain_escape_param(text)
  442.     #---
  443.     when 'PIC'
  444.       text.sub!(/\[(.*?)\]/, "")
  445.       bmp = Cache.picture($1.to_s)
  446.       rect = Rect.new(0, 0, bmp.width, bmp.height)
  447.       contents.blt(pos[:x], pos[:y], bmp, rect)
  448.     #---
  449.     else
  450.       window_base_process_escape_character_ams(code, text, pos)
  451.     end
  452.   end
  453.   
  454. end # Window_Base

  455. #==============================================================================
  456. # ■ Window_ChoiceList
  457. #==============================================================================

  458. class Window_ChoiceList < Window_Command
  459.   
  460.   #--------------------------------------------------------------------------
  461.   # alias method: initialize
  462.   #--------------------------------------------------------------------------
  463.   alias window_choicelist_initialize_ams initialize
  464.   def initialize(message_window)
  465.     window_choicelist_initialize_ams(message_window)
  466.     setup_message_font
  467.   end
  468.   
  469. end # Window_ChoiceList

  470. #==============================================================================
  471. # ■ Window_ScrollText
  472. #==============================================================================

  473. class Window_ScrollText < Window_Base
  474.   
  475.   #--------------------------------------------------------------------------
  476.   # alias method: initialize
  477.   #--------------------------------------------------------------------------
  478.   alias window_scrolltext_initialize_ams initialize
  479.   def initialize
  480.     window_scrolltext_initialize_ams
  481.     setup_message_font
  482.   end
  483.   
  484. end # Window_ScrollText

  485. #==============================================================================
  486. # ■ Window_NameMessage
  487. #==============================================================================

  488. class Window_NameMessage < Window_Base
  489.   
  490.   #--------------------------------------------------------------------------
  491.   # initialize
  492.   #--------------------------------------------------------------------------
  493.   def initialize(message_window)
  494.     @message_window = message_window
  495.     super(0, 0, Graphics.width, fitting_height(1))
  496.     self.opacity = YEA::MESSAGE::NAME_WINDOW_OPACITY
  497.     self.z = @message_window.z + 1
  498.     self.openness = 0
  499.     setup_message_font
  500.     @close_counter = 0
  501.     deactivate
  502.   end
  503.   
  504.   #--------------------------------------------------------------------------
  505.   # update
  506.   #--------------------------------------------------------------------------
  507.   def update
  508.     super
  509.     return if self.active
  510.     return if self.openness == 0
  511.     return if @closing
  512.     @close_counter -= 1
  513.     return if @close_counter > 0
  514.     close
  515.   end
  516.   
  517.   #--------------------------------------------------------------------------
  518.   # start_close
  519.   #--------------------------------------------------------------------------
  520.   def start_close
  521.     @close_counter = 4
  522.     deactivate
  523.   end
  524.   
  525.   #--------------------------------------------------------------------------
  526.   # force_close
  527.   #--------------------------------------------------------------------------
  528.   def force_close
  529.     @close_counter = 0
  530.     deactivate
  531.     close
  532.   end
  533.   
  534.   #--------------------------------------------------------------------------
  535.   # start
  536.   #--------------------------------------------------------------------------
  537.   def start(text, x_position)
  538.     @text = text.clone
  539.     set_width
  540.     create_contents
  541.     set_x_position(x_position)
  542.     set_y_position
  543.     refresh
  544.     activate
  545.     open
  546.   end
  547.   
  548.   #--------------------------------------------------------------------------
  549.   # set_width
  550.   #--------------------------------------------------------------------------
  551.   def set_width
  552.     text = @text.clone
  553.     dw = standard_padding * 2 + text_size(text).width
  554.     dw += YEA::MESSAGE::NAME_WINDOW_PADDING * 2
  555.     dw += calculate_size(text.slice!(0, 1), text) until text.empty?
  556.     self.width = dw
  557.   end
  558.   
  559.   #--------------------------------------------------------------------------
  560.   # calculate_size
  561.   #--------------------------------------------------------------------------
  562.   def calculate_size(code, text)
  563.     case code
  564.     when "\e"
  565.       return calculate_escape_code_width(obtain_escape_code(text), text)
  566.     else
  567.       return 0
  568.     end
  569.   end
  570.   
  571.   #--------------------------------------------------------------------------
  572.   # calculate_escape_code_width
  573.   #--------------------------------------------------------------------------
  574.   def calculate_escape_code_width(code, text)
  575.     dw = -text_size("\e").width - text_size(code).width
  576.     case code.upcase
  577.     when 'C', 'OC', 'OO'
  578.       dw += -text_size("[" + obtain_escape_param(text).to_s + "]").width
  579.       return dw
  580.     when 'I'
  581.       dw += -text_size("[" + obtain_escape_param(text).to_s + "]").width
  582.       dw += 24
  583.       return dw
  584.     when '{'
  585.       make_font_bigger
  586.     when '}'
  587.       make_font_smaller
  588.     when 'FZ'
  589.       contents.font.size = obtain_escape_param(text)
  590.     when 'FN'
  591.       text.sub!(/\[(.*?)\]/, "")
  592.       font_name = $1.to_s
  593.       font_name = Font.default_name if font_name.nil?
  594.       contents.font.name = font_name.to_s
  595.     when 'AMSF'
  596.       case obtain_escape_param(text)
  597.       when 0; reset_font_settings
  598.       when 1; contents.font.bold = !contents.font.bold
  599.       when 2; contents.font.italic = !contents.font.italic
  600.       when 3; contents.font.outline = !contents.font.outline
  601.       when 4; contents.font.shadow = !contents.font.shadow
  602.       end
  603.     else
  604.       return dw
  605.     end
  606.   end
  607.   
  608.   #--------------------------------------------------------------------------
  609.   # set_y_position
  610.   #--------------------------------------------------------------------------
  611.   def set_x_position(x_position)
  612.     case x_position
  613.     when 1 # Left
  614.       self.x = @message_window.x
  615.       self.x += YEA::MESSAGE::NAME_WINDOW_X_BUFFER
  616.     when 2 # 3/10
  617.       self.x = @message_window.x
  618.       self.x += @message_window.width * 3 / 10
  619.       self.x -= self.width / 2
  620.     when 3 # Center
  621.       self.x = @message_window.x
  622.       self.x += @message_window.width / 2
  623.       self.x -= self.width / 2
  624.     when 4 # 7/10
  625.       self.x = @message_window.x
  626.       self.x += @message_window.width * 7 / 10
  627.       self.x -= self.width / 2
  628.     when 5 # Right
  629.       self.x = @message_window.x + @message_window.width
  630.       self.x -= self.width
  631.       self.x -= YEA::MESSAGE::NAME_WINDOW_X_BUFFER
  632.     end
  633.     self.x = [[self.x, Graphics.width - self.width].min, 0].max
  634.   end
  635.   
  636.   #--------------------------------------------------------------------------
  637.   # set_y_position
  638.   #--------------------------------------------------------------------------
  639.   def set_y_position
  640.     case $game_message.position
  641.     when 0
  642.       self.y = @message_window.height
  643.       self.y -= YEA::MESSAGE::NAME_WINDOW_Y_BUFFER
  644.     else
  645.       self.y = @message_window.y - self.height
  646.       self.y += YEA::MESSAGE::NAME_WINDOW_Y_BUFFER
  647.     end
  648.   end
  649.   
  650.   #--------------------------------------------------------------------------
  651.   # refresh
  652.   #--------------------------------------------------------------------------
  653.   def refresh
  654.     contents.clear
  655.     reset_font_settings
  656.     @text = sprintf("\eC[%d]%s", YEA::MESSAGE::NAME_WINDOW_COLOUR, @text)
  657.     draw_text_ex(YEA::MESSAGE::NAME_WINDOW_PADDING, 0, @text)
  658.   end
  659.   
  660. end # Window_NameMessage

  661. #==============================================================================
  662. # ■ Window_Message
  663. #==============================================================================

  664. class Window_Message < Window_Base
  665.   
  666.   #--------------------------------------------------------------------------
  667.   # alias method: initialize
  668.   #--------------------------------------------------------------------------
  669.   alias window_message_initialize_ams initialize
  670.   def initialize
  671.     window_message_initialize_ams
  672.     setup_message_font
  673.   end
  674.   
  675.   #--------------------------------------------------------------------------
  676.   # overwrite method: window_width
  677.   #--------------------------------------------------------------------------
  678.   def window_width
  679.     return Variable.message_width
  680.   end
  681.   
  682.   #--------------------------------------------------------------------------
  683.   # overwrite method: window_height
  684.   #--------------------------------------------------------------------------
  685.   def window_height
  686.     return fitting_height(Variable.message_rows)
  687.   end
  688.   
  689.   #--------------------------------------------------------------------------
  690.   # alias method: create_all_windows
  691.   #--------------------------------------------------------------------------
  692.   alias window_message_create_all_windows_ams create_all_windows
  693.   def create_all_windows
  694.     window_message_create_all_windows_ams
  695.     @name_window = Window_NameMessage.new(self)
  696.   end
  697.   
  698.   #--------------------------------------------------------------------------
  699.   # overwrite method: create_back_bitmap
  700.   #--------------------------------------------------------------------------
  701.   def create_back_bitmap
  702.     @back_bitmap = Bitmap.new(width, height)
  703.     rect1 = Rect.new(0, 0, Graphics.width, 12)
  704.     rect2 = Rect.new(0, 12, Graphics.width, fitting_height(4) - 24)
  705.     rect3 = Rect.new(0, fitting_height(4) - 12, Graphics.width, 12)
  706.     @back_bitmap.gradient_fill_rect(rect1, back_color2, back_color1, true)
  707.     @back_bitmap.fill_rect(rect2, back_color1)
  708.     @back_bitmap.gradient_fill_rect(rect3, back_color1, back_color2, true)
  709.   end
  710.   
  711.   #--------------------------------------------------------------------------
  712.   # alias method: dispose_all_windows
  713.   #--------------------------------------------------------------------------
  714.   alias window_message_dispose_all_windows_ams dispose_all_windows
  715.   def dispose_all_windows
  716.     window_message_dispose_all_windows_ams
  717.     @name_window.dispose
  718.   end
  719.   
  720.   #--------------------------------------------------------------------------
  721.   # alias method: update_all_windows
  722.   #--------------------------------------------------------------------------
  723.   alias window_message_update_all_windows_ams update_all_windows
  724.   def update_all_windows
  725.     window_message_update_all_windows_ams
  726.     @name_window.update
  727.     @name_window.back_opacity = self.back_opacity
  728.     @name_window.opacity = self.opacity
  729.   end
  730.   
  731.   #--------------------------------------------------------------------------
  732.   # alias method: update_show_fast
  733.   #--------------------------------------------------------------------------
  734.   alias window_message_update_show_fast_ams update_show_fast
  735.   def update_show_fast
  736.     @show_fast = true if Input.press?(YEA::MESSAGE::TEXT_SKIP)
  737.     window_message_update_show_fast_ams
  738.   end
  739.   
  740.   #--------------------------------------------------------------------------
  741.   # overwrite method: input_pause
  742.   #--------------------------------------------------------------------------
  743.   def input_pause
  744.     self.pause = true
  745.     wait(10)
  746.     Fiber.yield until Input.trigger?(:B) || Input.trigger?(:C) ||
  747.       Input.press?(YEA::MESSAGE::TEXT_SKIP)
  748.     Input.update
  749.     self.pause = false
  750.   end
  751.   
  752.   #--------------------------------------------------------------------------
  753.   # overwrite method: convert_escape_characters
  754.   #--------------------------------------------------------------------------
  755.   def convert_escape_characters(text)
  756.     result = super(text.to_s.clone)
  757.     result = namebox_escape_characters(result)
  758.     result = message_escape_characters(result)
  759.     return result
  760.   end
  761.   
  762.   #--------------------------------------------------------------------------
  763.   # new method: namebox_escape_characters
  764.   #--------------------------------------------------------------------------
  765.   def namebox_escape_characters(result)
  766.     result.gsub!(/\eN\<(.+?)\>/i)  { namewindow($1, 1) }
  767.     result.gsub!(/\eN1\<(.+?)\>/i) { namewindow($1, 1) }
  768.     result.gsub!(/\eN2\<(.+?)\>/i) { namewindow($1, 2) }
  769.     result.gsub!(/\eNC\<(.+?)\>/i) { namewindow($1, 3) }
  770.     result.gsub!(/\eN3\<(.+?)\>/i) { namewindow($1, 3) }
  771.     result.gsub!(/\eN4\<(.+?)\>/i) { namewindow($1, 4) }
  772.     result.gsub!(/\eN5\<(.+?)\>/i) { namewindow($1, 5) }
  773.     result.gsub!(/\eNR\<(.+?)\>/i) { namewindow($1, 5) }
  774.     return result
  775.   end
  776.   
  777.   #--------------------------------------------------------------------------
  778.   # new method: namebox
  779.   #--------------------------------------------------------------------------
  780.   def namewindow(text, position)
  781.     @name_text = text
  782.     @name_position = position
  783.     return ""
  784.   end
  785.   
  786.   #--------------------------------------------------------------------------
  787.   # new method: message_escape_characters
  788.   #--------------------------------------------------------------------------
  789.   def message_escape_characters(result)
  790.     result.gsub!(/\eAF\[(-?\d+)]/i) { change_face($1.to_i) }
  791.     return result
  792.   end
  793.   
  794.   #--------------------------------------------------------------------------
  795.   # new method: change_face
  796.   #--------------------------------------------------------------------------
  797.   def change_face(actor_id)
  798.     actor_id = $game_party.members[actor_id.abs].id if actor_id <= 0
  799.     actor = $game_actors[actor_id]
  800.     return "" if actor.nil?
  801.     $game_message.face_name = actor.face_name
  802.     $game_message.face_index = actor.face_index
  803.     return ""
  804.   end
  805.   
  806.   #--------------------------------------------------------------------------
  807.   # alias method: new_page
  808.   #--------------------------------------------------------------------------
  809.   alias window_message_new_page_ams new_page
  810.   def new_page(text, pos)
  811.     adjust_message_window_size
  812.     window_message_new_page_ams(text, pos)
  813.   end
  814.   
  815.   #--------------------------------------------------------------------------
  816.   # overwrite method: new_line_x
  817.   #--------------------------------------------------------------------------
  818.   def new_line_x
  819.     return $game_message.face_name.empty? ? 0 : YEA::MESSAGE::FACE_INDENT_X
  820.   end
  821.   
  822.   #--------------------------------------------------------------------------
  823.   # new method: adjust_message_window_size
  824.   #--------------------------------------------------------------------------
  825.   def adjust_message_window_size
  826.     self.height = window_height
  827.     self.width = window_width
  828.     create_contents
  829.     update_placement
  830.     self.x = (Graphics.width - self.width) / 2
  831.     start_name_window
  832.   end
  833.   
  834.   #--------------------------------------------------------------------------
  835.   # new method: clear_name_window
  836.   #--------------------------------------------------------------------------
  837.   def clear_name_window
  838.     @name_text = ""
  839.     @name_position = 0
  840.   end
  841.   
  842.   #--------------------------------------------------------------------------
  843.   # new method: start_name_window
  844.   #--------------------------------------------------------------------------
  845.   def start_name_window
  846.     return if @name_text == ""
  847.     @name_window.start(@name_text, @name_position)
  848.   end
  849.   
  850.   #--------------------------------------------------------------------------
  851.   # overwrite method: fiber_main
  852.   #--------------------------------------------------------------------------
  853.   def fiber_main
  854.     $game_message.visible = true
  855.     update_background
  856.     update_placement
  857.     loop do
  858.       process_all_text if $game_message.has_text?
  859.       process_input
  860.       $game_message.clear
  861.       @gold_window.close
  862.       @name_window.start_close
  863.       Fiber.yield
  864.       break unless text_continue?
  865.     end
  866.     close_and_wait
  867.     $game_message.visible = false
  868.     @fiber = nil
  869.   end
  870.   
  871.   #--------------------------------------------------------------------------
  872.   # alias method: open_and_wait
  873.   #--------------------------------------------------------------------------
  874.   alias window_message_open_and_wait_ams open_and_wait
  875.   def open_and_wait
  876.     clear_name_window
  877.     adjust_message_window_size
  878.     window_message_open_and_wait_ams
  879.   end
  880.   
  881.   #--------------------------------------------------------------------------
  882.   # alias method: close_and_wait
  883.   #--------------------------------------------------------------------------
  884.   alias window_message_close_and_wait_ams close_and_wait
  885.   def close_and_wait
  886.     @name_window.force_close
  887.     window_message_close_and_wait_ams
  888.   end
  889.   
  890.   #--------------------------------------------------------------------------
  891.   # alias method: all_close?
  892.   #--------------------------------------------------------------------------
  893.   alias window_message_all_close_ams all_close?
  894.   def all_close?
  895.     return window_message_all_close_ams && @name_window.close?
  896.   end
  897.   
  898.   #--------------------------------------------------------------------------
  899.   # alias method: process_escape_character
  900.   #--------------------------------------------------------------------------
  901.   alias window_message_process_escape_character_ams process_escape_character
  902.   def process_escape_character(code, text, pos)
  903.     case code.upcase
  904.     when 'W' # Wait
  905.       wait(obtain_escape_param(text))
  906.     else
  907.       window_message_process_escape_character_ams(code, text, pos)
  908.     end
  909.   end
  910.   
  911. end # Window_Message

  912. #==============================================================================
  913. #
  914. # ▼ End of File
  915. #
  916. #==============================================================================
复制代码








=begin
#==============================================================================
* 闲谈对话框 (Yami 气泡对话框 的插件) - v1.3c
  作者: Quack
  翻译:nil2018(○┰○)
#==============================================================================
效果:
1-允许你使用"闲谈对话框。和默认对话框区别为,闲谈对话框不会暂停游戏,也不会因为
  玩家按下任何按键而关闭,取而代之的是为对话框设定一个计时器,时间到了会自动将
  其关闭。还有一个特点是:可以同时显示多个闲谈对话框(有最大显示数量限制,默认
  为7,你可以在下面的"MAX_MSGS"中调整最大数)
  
  将普通对话框“变成”闲谈对话框的方法为:在对话框中填入标志:'<cm:X>'
  其中X为显示的时间,单位为秒(注意:这个标志必须放在对话框的第一行!!)
  将X设定为负值时,对话框就不会消失了。你可以使用脚本来关闭所有闲谈对话框:
  clear_chatter
  
2-说话的气泡标志(bubble message)和原来一样,都是: \bm[x]
  新添加了思考(bubble message thought)的气泡标志:  \bmt[x]
  
3-气泡对话框可以在战斗中使用了。可以使用 \bm[x] 或 \bmt[x] 来显示气泡对话框。to show a pop message.
  如果你要在敌人头上显示气泡对话框,请将x替换为负值.
  在战斗中:    \bm[1] 显示在1号敌人头上
                \bm[-1] 显示在1号角色头上
  对于1号敌人,使用 \bm[1] ,4号敌人则使用 \bm[4]
  同时,对于角色: 1号角色 = \bm[-1]
  
  然而,要想在战斗中在角色头上显示气泡对话框,需要你使用“显示角色战斗图”的
  脚本。我不能保证我的脚本适用于所有该功能的脚本。但我可以保证和Jet's sideview
  battlers 相兼容。
  
  有一个问题是,当战斗图的大小过大或过小时,对话框窗口会有些移位。
  使用以下标志来调整对话框的位置:
  \ox[X] - 调整气泡对话框的x坐标
  \oy[X] - 调整气泡对话框的y坐标
  
  有一点需要注意的是,如果你还使用了Yanfly的核心脚本&Yanfly的文本系统,你需要将
  核心脚本中的 FONT_NAME 和文本系统的i MESSAGE_WINDOW_FONT_NAME 设定相匹配(两
  个地方都要设定相同的字体)否则两个脚本的设定结合起来,有时会使文本的宽度计算
  错误。这个问题不大,可是在气泡对话框中,会改变气泡对话框的窗口宽度,这就是个
  大问题了(yanfly两个脚本中,关于字体的其他设定例如是否加粗是否斜体等,也最好
  设定得一模一样)
  
版本 1.1 更新功能:

1-添加文本打字音效,你可以在 TEXT_SOUNDS 的哈希表中设定(在下面查看更多地介绍)
  使用标志:
  <ts:x>   文章打字音x,x为存在于 TEXT_SOUNDS 哈希表中的打字音效名字.
  
2-添加对话框背景色调的功能。你可以在 WINDOW_TONES 哈希表中预设色调种类
  使用标志: <bc:x> ,其中x为存在于 WINDOW_TONES 哈希表中的色调名字.

3-有时,你需要在同一个对话框中显示不同的字体,可能会使对话框变得过大或过小。Sometimes you might want to change font size in your message, multiple times,
  使用标志: <pms:x,y> 可以调整气泡对话框的大小.x为宽度变化,y为高度变化
  例如,你使用了标志<pms:20,-10> ,则对话框的宽度会增加20,高度会减少10.
  
4-如果你和我一样,被记忆事件id、书写一大堆标志而困扰,以下功能会帮到你。
  
  仅使用一个标志<bt:x> (对于谈话气泡) 或 <btt:x> (对于思考气泡)
  就可以让该事件使用你设定的背景颜色和文本打字音效。
  
  那原理是什么?
  举个例子,我有一个作为队伍角色的事件,她叫Emil.在事件名中填入了标志: <emil>.
  然后,当我使用了标志: <bt:emil> 或 <btt:emil> 气泡对话框会自动显示到该事件的
  头上(如果有多个事件名为<emil>的事件,也会只显示一个对话框),且使用
  WINDOW_TONES 中的'emil'作为窗口色调,使用TEXT_SOUNDS中的'emil'作为文本打字音效
  但不能用于btt,因为思考中还会有打字音效不是太奇怪了吗?
  
  
  这也会在你检查事件时,更清楚地明白哪个事件是'emil',而不是去找哪个事件是某某id
  
  如果你想指定用于角色(player) 的话,使用标志'pl',例如:
  <bt:pl>
  这样就可以使设定窗口色调和打字音效的"打包"设定同时应用于角色了。
  或许在队员变化大的情况下不怎么实用,但是我仍然添加了此功能。
  
  如果你很好奇为什么我新添加的标志和以前的不一样...因为!Consistence is overrated
  anyway, who needs it?  (0.0)
  
  使用标志(<bt:x> & <btt:x>) 需要你安装脚本 Qonvenience (你也许会叫它做
  我的'核心' 脚本,类似其他人的 (Yanfly,
  Victor, Yami, etc).
  你可以在下面的'使用条件'部分找到下载地址.
  
版本 1.2 更新功能:

- 显示选项时,会根据你使用的是气泡对话框还是普通的对话框而显示不同的样子。
  使用默认对话框时,选项的外貌不变。使用气泡对话框时选项会变得更大,且显示在对
  话框窗口中.
  
版本 1.3更新功能:

- 修复了一些肖像图和名称窗口的问题。问题并没有完全解决,因为我自己的工程里并
没有使用名称窗口或肖像图,所以本人并不是很感兴趣去花时间到这些地方。
  
-和窗口色调、打字音效一样,你现在可以使用标志来显示名称窗口了。
  
==============================================================================
安装注释:
需要脚本 Yami气泡对话框.
将本脚本放在其之下.

==============================================================================
使用条件:
需要Yami气泡对话框脚本,你可以在这里下载:
​https://github.com/suppayami/rmvxa-collection/blob/master/yami-script-ace/10%20-%20Pop%20Message.txt
同时还需要我的 Qonvenience脚本 ,如果你想使用:<bt:x> 和 <btt:x>的话
在这里下载:
http://pastebin.com/J6haUy5T

==============================================================================
Credits:
Yami 为 气泡对话框的作者.

==============================================================================
使用条款:
随意使用(没错,包括商业游戏),只要你不声明这个脚本是你自己写的。
同时我也希望你能在使用此脚本时,属名我为脚本的作者。
请记住本脚本必须和Yami的气泡对话框同时使用,其也有自己的使用条款.

==============================================================================
Bugs:
不懂

==============================================================================
History:
11/10/2016 - Fixed some problems added some minor feature.
19/01/2016 - Fixed some bugs, changes to choices when a pop message is used.
14/01/2016 - Chatter messages now last forever if you set the duration to a
             negative number. Also added method for clearing all chatter
             to use in script calls. Also squashed some bugs.
13/01/2016 - Pretty big update. Added more functionality.
10/01/2016 - Proper release since Absurdiness found the original script so I
             could separate the addon from the original.
08/01/2016 - Initial release

=end

$imported = {} if $imported.nil?
$imported["Chatter_Messages"] = true

#==============================================================================
# * 设定
#==============================================================================

module YSE
  module POP_MESSAGE
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - 视觉设定 -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
   
    EFFECT2 = { # 开始.
      :bubble_tag_name => "BubbleTag_Speech",
      :thought_bubble_tag_name => "BubbleTag_Thought",
    } # 结束.
  end
end

module QUACK
  module MSG
   
    # 闲谈窗口同时显示的最大数量。
    # 太少会限制了你的选择,太多会使画面杂乱。
    MAX_MSGS = 7
   
    # 在这里设定窗口颜色。
    # 格式:
    # '名称' => Tone.new(红,绿,蓝,灰度)
    # 名称为字符,红绿蓝为数字,范围是 -255~255
    # 灰度的范围是 0 到 255. 灰度为可选值,不一定非要写。
    WINDOW_TONES = {
      #在下面手动添加设定
      '偏红' => Tone.new(85,44,51),
      '杰克' => Tone.new(-34,85,102),
      '狂人' => Tone.new(68,68,68,10),
      '普尔' => Tone.new(102,34,-34),
      '爱丽丝' => Tone.new(102,34,51),
      # 自己设定更多的
    }
   
    # 在这里设定文本打字音效
    # 格式:
    # '名称' => ["文件名",音量, 最低音调, 最高音调],
    # 名称为字符,文件名为音效文件名where Key is a string. Sound is the name of your sound,
    # 音量音调为数字,范围是 0-100.
    TEXT_SOUNDS = {
      #在下面手动添加设定
      '0' => nil, # 无任何打字音效的默认值!
      '1' => ["Cursor1", 80, 70, 100],
      '2' => ["Cursor1", 80, 90, 120],
      '3' => ["Knock", 80, 50, 75],
      '杰克' => ["Cursor1", 80, 90, 120],
      '狂人' => ["Cursor1", 80, 45, 70],
      '普尔' => ["Cursor1", 80, 70, 100],
      '爱丽丝' => ["Cursor1", 70, 110, 140],
      # And above this line
    }
   
    NAMES = {
      # 设定名称
      '1' => "冒险家杰克",
      '2' => "疯狂实验员"
    }
   
    # 每X个字符播放一次打字音效.
    SOUND_PLAY_FREQUENCY = 3
   
    # 气泡对话框是否在使用选项时随着文本显示而逐渐增大,还是立刻显示为最大尺寸
    POP_CHOICE_GROW = true
   
  end
end

#==============================================================================
# * SCRIPT START
#==============================================================================

#==============================================================================
# ?! DataManager
#==============================================================================
module DataManager
  class << self
    alias quack_msg_create_game_objects create_game_objects
    def create_game_objects
      quack_msg_create_game_objects
      if !$imported["YSE-PopMessage"]
        msgbox(sprintf("This script(Chatter Messages) requires Yami's Pop Messages to function", "ChatterMessages", 1))
        exit
      end
      $game_message.quack_msg_make
    end
  end
end

#==============================================================================
# ?! Game_Message
#==============================================================================
class Game_Message
  attr_accessor :quack_msgs
  attr_accessor :ev_id
  
  # new
  def quack_msg_make
    @quack_msgs = []
    QUACK::MSG::MAX_MSGS.times {@quack_msgs.push(Game_Message.new)}
    @quack_msg_ttl = 0
    @c_msg = 0
  end
  # new
  def set_ttl(ttl)
    @quack_msg_ttl = ttl
  end
  # new
  def ttl_sub
    @quack_msg_ttl -= 1 if @quack_msg_ttl > 0
  end
  # new
  def expire?
    return false if @quack_msg_ttl < 0
    @quack_msg_ttl == 0
  end
  # new
  def prepare_msg(duration)
    @quack_msg_ttl = (duration * 60).to_i
  end
  # new
  def fin_msg
    @quack_msg_ttl = 0
    @c_msg = (@c_msg + 1) % QUACK::MSG::MAX_MSGS
  end
  # new
  def add_chatter(text)
    m = @quack_msgs[@c_msg]
    m.add(text)
    m.face_name = face_name
    m.face_index = face_index
    m.set_ttl(@quack_msg_ttl)
  end
  # new
  def clear_chatter
    @quack_msgs.each {|m| m.set_ttl(0) }
  end
  
  # new
  def clear_chatter_event(e)
    # Find any chatter attached to certain event id and close the chatter
    @quack_msgs.each {|m| m.set_ttl(0) if m.ev_id == e }
  end
end

#==============================================================================
# ?! Window_Message
#==============================================================================

class Window_Message < Window_Base
  
  # new
  def chatter?
    false
  end
  # new
  def source
    $game_message
  end
  # overwrite
  def standard_padding
    return 8
  end
  # alias
  alias quack_chatter_init initialize
  def initialize
    @msg_tone = $game_system.window_tone
    @snd_f = 0
    #@name_text = ""
    quack_chatter_init
  end
  # new
  def speech_bubble_tag=(sprite)
    @speech_bubble_tag = sprite
  end
  # new
  def thought_bubble_tag=(sprite)
    @thought_bubble_tag = sprite
  end
  # new
  def set_offset_x(x)
    @ox = x
    return ""
  end
  # new
  def set_offset_y(y)
    @oy = y
    return ""
  end
  # overwrite
  def cal_width_line(text)
    result = 0
    text.each_line { |line|
      result = text_size(line).width if result < text_size(line).width
    }
    return result
  end
  # alias
  alias quack_chatter_process_character process_character
  def process_character(c, text, pos)
    if @snd_f == 0 && !@show_fast && !@text_sound.nil?
      Audio.se_play("Audio/SE/"+@text_sound[0],@text_sound[1],@text_sound[2]+rand(@text_sound[3]-@text_sound[2]))
    end
    @snd_f += 1
    @snd_f = 0 if @snd_f == QUACK::MSG::SOUND_PLAY_FREQUENCY
    quack_chatter_process_character(c,text,pos)
  end
  # overwrite
  def update_tone
    self.tone.set(@msg_tone)
  end
  # overwrite
  def message_escape_characters_pop_message(result)
    @msg_tone = $game_system.window_tone
    @event_pop_id = nil
    set_offset_x(0)
    set_offset_y(0)
    @text_sound = QUACK::MSG::TEXT_SOUNDS['0']
    @msg_size_x = 0
    @msg_size_y = 0
    reset_font_settings
   
    result.gsub!(/<BT:([^<>]*)>/i) { event_pop_message_setup2($1, false) }
    result.gsub!(/<BTT:([^<>]*)>/i) { event_pop_message_setup2($1, true) }
    result.gsub!(/\eOX\[([-+]?\d+)\]/i) { set_offset_x($1.to_i) }
    result.gsub!(/\eOY\[([-+]?\d+)\]/i) { set_offset_y($1.to_i) }
    result.gsub!(/\eBM\[([-+]?\d+)\]/i) { event_pop_message_setup($1.to_i, false) }
    result.gsub!(/\eBMT\[([-+]?\d+)\]/i) { event_pop_message_setup($1.to_i, true) }
    result.gsub!(/\eBMF\[(\d+)\]/i) { event_pop_message_setup($1.to_i, false, true) }
    result.gsub!(/\eCBM/i) { event_pop_message_setup(nil, false) }
    result.gsub!(/<BC:([^<>]*)>/i) { @msg_tone = QUACK::MSG::WINDOW_TONES[$1] ;""}
    result.gsub!(/<TS:([^<>]*)>/i) { @text_sound = QUACK::MSG::TEXT_SOUNDS[$1]; ""}
    result.gsub!(/<PMS:([-+]?\d+),([-+]?\d+)>/i) { @msg_size_x = $1.to_i ;@msg_size_y = $2.to_i; ""}
    result
  end
  # new
  def event_pop_message_setup2(tag, thought = false)
    if SceneManager.scene_is?(Scene_Battle)
      if tag.include?('act')
        ev_id = tag[3].to_i
        ev_id = (1+$game_party.members.index($game_actors[ev_id])) * -1
        @msg_tone = QUACK::MSG::WINDOW_TONES[tag] if QUACK::MSG::WINDOW_TONES.has_key?(tag)
        @text_sound = QUACK::MSG::TEXT_SOUNDS[tag] if !thought && QUACK::MSG::TEXT_SOUNDS.has_key?(tag)
      else
        msgbox(sprintf("无任何事件使用标志: '" + tag + "'.","Chatter Messages",1))
      end
      return event_pop_message_setup(ev_id, thought)
    end
    msgbox(sprintf("使用此标志需要你安装Qonvenience.","Chatter Messages",1)) if !$imported["Qonvenience"]
    if tag == 'pl'
      ev_id = 0
    else
      ev_id = $game_map.first_event_tag(tag).id
      msgbox(sprintf("无任何事件使用标志: '" + tag + "'.","Chatter Messages",1)) if ev_id.nil?
    end
    @msg_tone = QUACK::MSG::WINDOW_TONES[tag] if QUACK::MSG::WINDOW_TONES.has_key?(tag)
    @text_sound = QUACK::MSG::TEXT_SOUNDS[tag] if !thought && QUACK::MSG::TEXT_SOUNDS.has_key?(tag)
    namewindow(QUACK::MSG::NAMES[tag], 1) if $imported["YEA-MessageSystem"] && QUACK::MSG::NAMES.has_key?(tag) && @name_text == ""
    return event_pop_message_setup(ev_id, thought)
  end
  # overwrite
  def event_pop_message_setup(event_id, thought = false, follower = false)
    start_name_window if $imported["YEA-MessageSystem"]
    if follower && $game_player.followers[event_id].nil?
      @event_pop_id = nil
      @event_pop_follower = false
      return ""
    end
    if thought # THOUGHT
      @speech_bubble_tag.visible = false
      @bubble_tag = @thought_bubble_tag
    else # SPEECH
      @thought_bubble_tag.visible = false
      @bubble_tag = @speech_bubble_tag
    end
    @event_pop_follower = follower
    @event_pop_id = event_id
    # close any chatter message currently attached to this event
    $game_message.clear_chatter_event(event_id)
    source.ev_id = event_id
    return ""
  end
  # overwrite
  def set_face_position
    #return unless SceneManager.scene_is?(Scene_Map)
    return unless @event_pop_id
    return unless @face_window
    contents.clear
    @face_window.set_face
    return unless $imported["YEA-MessageSystem"]
    return if @face_window.close?
    #@name_window.x = self.x + YSE::POP_MESSAGE::POSITION[:face_x_buffer] + YSE::POP_MESSAGE::POSITION[:name_x_buffer] if (@name_position == 1 || @name_position == 2)
  end
  # overwrite
  def close
    pop_message_close
    #return unless SceneManager.scene_is?(Scene_Map)
    return unless @event_pop_id
    @event_pop_follower = false
    @face_window.hide_face
    return unless YSE::POP_MESSAGE::EFFECT[:use_bubble_tag]
    @speech_bubble_tag.visible = false if @speech_bubble_tag
    @thought_bubble_tag.visible = false if @thought_bubble_tag
    source.ev_id = nil
  end
  # overwrite
  def process_all_text
    @event_pop_id = nil
    @name_text = ""
    txt = convert_escape_characters($game_message.all_text)
    update_placement
    adjust_pop_message(txt)#$game_message.all_text)
    pop_message_process_all_text
  end
  # overwrite
  def update_placement
    if SceneManager.scene_is?(Scene_Map)
      if @event_pop_id.nil?
        fix_default_message
        event_pop_message_update_placement
      elsif @event_pop_id == 0
        character = $game_player
        self.y = character.screen_y + @oy - self.height + YSE::POP_MESSAGE::POSITION[:y_buffer]
        self.x = character.screen_x + @ox - self.width / 2 + YSE::POP_MESSAGE::POSITION[:x_buffer]
        fix_position_bubble(character)
        set_bubble_tag(character)
        @name_window.update_pos if $imported["YEA-MessageSystem"] && @name_window.open?
        @face_window.set_position if !chatter? && @face_window.open?
      elsif @event_pop_id > 0
        hash = @event_pop_follower ? $game_player.followers : $game_map.events
        character = hash[@event_pop_id]
        self.y = character.screen_y + @oy - self.height + YSE::POP_MESSAGE::POSITION[:y_buffer]
        self.x = character.screen_x + @ox - self.width / 2 + YSE::POP_MESSAGE::POSITION[:x_buffer]
        fix_position_bubble(character)
        set_bubble_tag(character)
        @name_window.update_pos if $imported["YEA-MessageSystem"] && @name_window.open?
        @face_window.set_position if !chatter? && @face_window.open?
      end
    else
      # IF IN BATTLE
      #event_pop_message_update_placement
      if @event_pop_id.nil?
        fix_default_message
        event_pop_message_update_placement
      elsif @event_pop_id < 0
        battler = $game_party.members[(@event_pop_id * -1)-1]
        self.y = battler.screen_y + @oy - self.height + YSE::POP_MESSAGE::POSITION[:y_buffer]
        self.x = battler.screen_x + @ox - self.width / 2 + YSE::POP_MESSAGE::POSITION[:x_buffer]
        fix_position_bubble(battler)
        set_bubble_tag(battler)
        @name_window.update_pos if $imported["YEA-MessageSystem"] && @name_window.open?
        @face_window.set_position if !chatter? && @face_window.open?
      elsif @event_pop_id > 0
        battler = $game_troop.members[@event_pop_id-1]
        self.y = battler.screen_y + @oy - self.height + YSE::POP_MESSAGE::POSITION[:y_buffer]
        self.x = battler.screen_x + @ox - self.width / 2 + YSE::POP_MESSAGE::POSITION[:x_buffer]
        fix_position_bubble(battler)
        set_bubble_tag(battler)
        @name_window.update_pos if $imported["YEA-MessageSystem"] && @name_window.open?
        @face_window.set_position if !chatter? && @face_window.open?
      end
    end
  end
  # overwrite
  def fix_default_message
    self.width = window_width
    self.height = window_height
    self.x = 0
    @face_window.hide_face if @face_window
    #create_contents
    return unless YSE::POP_MESSAGE::EFFECT[:use_bubble_tag]
    @speech_bubble_tag.visible = false if @speech_bubble_tag
    @thought_bubble_tag.visible = false if @thought_bubble_tag
  end
  # overwrite
  def fix_position_bubble(character)
    end_x = self.x + self.width
    end_y = self.y + self.height
    self.x = 0 if self.x < 0
    self.y = character.screen_y + @oy if self.y < 0
    self.y = -99 if self.y < 0
    self.x = Graphics.width - self.width if end_x > Graphics.width
    self.y = Graphics.height - self.height if end_y > Graphics.height
  end
  # overwrite
  def set_bubble_tag(character)
    return unless YSE::POP_MESSAGE::EFFECT[:use_bubble_tag]
    return unless @bubble_tag
    up = self.y == character.screen_y + @oy
    if self.y == -99
      self.y = 0
      up = true
    end
    self.y += up ? @bubble_tag.height / 2 : -@bubble_tag.height / 2
    @bubble_tag.x = character.screen_x + @ox - @bubble_tag.width / 2
    if up
      @bubble_tag.src_rect.set(0, @bubble_tag.height, @bubble_tag.width, @bubble_tag.height)
      @bubble_tag.y = self.y - @bubble_tag.height - YSE::POP_MESSAGE::POSITION[:tag_y_buffer]
    else
      @bubble_tag.src_rect.set(0, 0, @bubble_tag.width, @bubble_tag.height)
      @bubble_tag.y = self.y + self.height + YSE::POP_MESSAGE::POSITION[:tag_y_buffer]
    end
    @bubble_tag.z = self.z + 1000
  end
  # overwrite
  def adjust_pop_message(text = " ")
    #return unless SceneManager.scene_is?(Scene_Map)
    unless @event_pop_id
      if $imported["YEA-MessageSystem"]
        #adjust_message_window_size
      end
      return
    end
    n_line = cal_number_line(text)
    n_line = YSE::POP_MESSAGE::LIMIT[:limit_line] if YSE::POP_MESSAGE::LIMIT[:limit_line] > 0 && cal_number_line(text) > YSE::POP_MESSAGE::LIMIT[:limit_line]
    @real_lines = n_line
    self.height = fitting_height(n_line)
    self.height += @msg_size_y
    self.width = cal_width_line(text) + 10
    self.width += @msg_size_x
    self.width += new_line_x
    if self.width > YSE::POP_MESSAGE::LIMIT[:limit_width] && YSE::POP_MESSAGE::LIMIT[:limit_width] > 0
      self.width = YSE::POP_MESSAGE::LIMIT[:limit_width]
    end
    if $game_message.choice? && !QUACK::MSG::POP_CHOICE_GROW
      dy = fitting_height($game_message.choices.size) - 16
      self.y -= dy - 16
      self.height += dy - 16
      @face_window.y -= dy - 16
      @name_window.y -= dy - 16 if $imported["YEA-MessageSystem"]
    end
    # If a chatter message with face graphic, force height to be at least big enough to show the face.
    if chatter? && !source.face_name.empty?
      self.height = [self.height, 86].max
    end
   
    create_contents
    update_placement
  end
  # alias
  alias yse_pop_dispose dispose
  def dispose
    @speech_bubble_tag.visible = false if @speech_bubble_tag
    @thought_bubble_tag.visible = false if @thought_bubble_tag
    yse_pop_dispose
  end
  # alias
  alias chatter_msg_input_choice input_choice
  def input_choice
    if !close? && pop_message? && QUACK::MSG::POP_CHOICE_GROW
      f = Fiber.new { add_room_for_choices }
      @choice_window.visible = false
      @choice_window.set_fiber(f)
      f.resume
    end
    chatter_msg_input_choice
  end
  # new
  def add_room_for_choices
    q = fitting_height($game_message.choices.size) - 16
    i = 0
    while true
      i += 4
      self.y -= 4
      self.height += 4
      @face_window.y -= 4
      @name_window.y -= 4 if $imported["YEA-MessageSystem"]
      break if i >= q
      Fiber.yield
    end
    @choice_window.visible = true
    @choice_window.set_fiber(nil)
  end
  # new
  def pop_message?
    @event_pop_id
  end
end

#==============================================================================
# ?! Window_ChoiceList
#==============================================================================
class Window_ChoiceList < Window_Command
  # alias
  alias chatter_msg_init initialize
  def initialize(message_window)
    chatter_msg_init(message_window)
    self.opacity = 0
    self.z = 20070
  end
  # new
  def set_fiber(fiber)
    @fiber = fiber
  end
  # alias
  alias chatter_msg_update update
  def update
    chatter_msg_update
    @fiber.resume if @fiber
  end
  # alias
  alias chatter_msg_update_placement update_placement
  def update_placement
    if @message_window.pop_message?
      self.opacity = 0
      self.width = @message_window.width-26 + padding * 2
      self.width = [width, Graphics.width].min
      self.height = fitting_height($game_message.choices.size)
      self.x = @message_window.x
      self.y = @message_window.y+@message_window.height-self.height+6
    else
      self.opacity = 255
      chatter_msg_update_placement
    end
  end
end

class Window_NameMessage < Window_Base
  #def hide_me
  #  self.x = 99999
  #  self.y = 99999
  #end
end

#==============================================================================
# ■ Window_NameMessage
#==============================================================================
class Window_NameMessage < Window_Base
  # alias
  alias quack_msg_name_init initialize
  def initialize(message_window)
    quack_msg_name_init(message_window)
    self.z += 2
  end
  # new
  def update_pos
    set_x_position(1)
    #set_y_position
    self.y = @message_window.y - self.height / 1.25
    self.y = 0 if self.y < 0
  end
  # overwrite
      #  self.y = @message_window.height
      #  self.y -= YEA::MESSAGE::NAME_WINDOW_Y_BUFFER
      #else
      #  self.y = @message_window.y - self.height / 1.25
      #  self.y += YEA::MESSAGE::NAME_WINDOW_Y_BUFFER
      #end
end
  
#==============================================================================
# ¡ Window_Message_Face
#==============================================================================

class Window_Message_Face < Window_Base
  alias quack_msg_face_pos set_position
  def set_position
    quack_msg_face_pos
    self.y -= 4
  end
end

#==============================================================================
# ?! Window_Quack_Message
#==============================================================================
class Window_Quack_Message < Window_Message
  attr_accessor :active
  
  # overwrite
  def initialize(msg_source, zz)
    super()
    self.z = zz
    @quack_msg_source = msg_source
    @active = false
    @background = 0
    self.opacity = 255
    self.visible = false
    clear_name_window if $imported["YEA-MessageSystem"]
  end
  # overwrite
  def chatter?
    true
  end
  # overwrite
  def source
    @quack_msg_source
  end
  # overwrite
  def update
    if @quack_msg_source.busy?
      if @quack_msg_source.expire?
        close
      else
        self.visible = true if !self.visible
        @quack_msg_source.ttl_sub
      end
    end
    self.visible = false if self.visible && close?
    super
  end
  # overwrite
  def update_placement
    return if @closing
    super
  end
  # overwrite
  def update_show_fast
    return false
  end
  # overwrite
  def process_all_text
    @event_pop_id = nil
    text = convert_escape_characters(@quack_msg_source.all_text)
    update_placement
    adjust_pop_message(text)
    open_and_wait
    #text = convert_escape_characters(@quack_msg_source.all_text)
    pos = {}
    new_page(text, pos)
    process_character(text.slice!(0, 1), text, pos) until text.empty? || close?
  end
  # overwrite
  def close
    pop_message_close #super
    return unless @event_pop_id
    return unless YSE::POP_MESSAGE::EFFECT[:use_bubble_tag]
    @speech_bubble_tag.visible = false if @speech_bubble_tag
    @thought_bubble_tag.visible = false if @thought_bubble_tag
    source.ev_id = nil
    @name_text = ""
  end
  # overwrite
  def input_pause
    self.pause = true
    wait(10)
    Fiber.yield until close?
    self.pause = false
  end
  # overwrite
  def update_fiber
    if @fiber
      @fiber.resume
    elsif @quack_msg_source.busy?
      @fiber = Fiber.new { fiber_main }
      @fiber.resume
    else
      @quack_msg_source.visible = false
    end
  end
  def fiber_main
    @quack_msg_source.visible = true
    #update_background
    update_placement
    loop do
      process_all_text if @quack_msg_source.has_text?
      process_input
      @quack_msg_source.clear
      @name_window.start_close if $imported["YEA-MessageSystem"]
      Fiber.yield
      break unless text_continue?
    end
    close_and_wait
    @quack_msg_source.visible = false
    @fiber = nil
  end
  #def update_background
  #  @background = @quack_msg_source.background
  #  self.opacity = @background == 0 ? 255 : 0
  #end
  def process_input
    input_pause unless @pause_skip
  end
  def text_continue?
    @quack_msg_source.has_text?# && !settings_changed?
  end
  def settings_changed?
    #@background != $game_message.background ||
    #@position != @quack_msg_source.position
    false
  end
  def new_page(text, pos)
    contents.clear
    draw_face(@quack_msg_source.face_name, @quack_msg_source.face_index, 0, 0)
    reset_font_settings
    pos[:x] = new_line_x
    pos[:y] = 0
    pos[:new_x] = new_line_x
    pos[:height] = calc_line_height(text)
    clear_flags
  end
  def new_line_x
    @quack_msg_source.face_name.empty? ? 0 : 112
  end
  # overwrite
  def input_pause
    #self.pause = true
    wait(10)
    Fiber.yield until @quack_msg_source.expire? #Input.trigger?(:B) || Input.trigger?(:C)
    #Input.update
    #self.pause = false
  end
  
  # overwrite
  def create_all_windows
    @name_window = Window_NameMessage.new(self) if $imported["YEA-MessageSystem"]
  end
  # overwrite
  def dispose_all_windows
    @name_window.dispose if $imported["YEA-MessageSystem"]
  end
  # overwrite
  def update_all_windows
    if $imported["YEA-MessageSystem"]
      @name_window.update
      @name_window.back_opacity = self.back_opacity
      @name_window.opacity = self.opacity
    end
  end
  # overwrite
  def event_pop_message_update_placement
  end
  # overwrite
  def all_close?
    close? && (!$imported["YEA-MessageSystem"] || @name_window.close?)
  end
  
  if $imported["YEA-MessageSystem"]
    def close_and_wait
      @name_window.force_close
      window_message_close_and_wait_ams
    end
  end
end

#==============================================================================
# ?! Scene_Map
#==============================================================================

class Scene_Map < Scene_Base
  # alias
  alias quack_msg_update update
  def update
    @quack_msgs.each {|m|
      m.update
      if m.open?
        m.update_placement
      end
    }
    @message_window.update_placement if @message_window.open?
    quack_msg_update
  end
  # overwrite
  def create_message_window
    yse_pm_create_message_window
    @face_window = Window_Message_Face.new
    @face_window.message_window = @message_window
    if @bubble_tag_sprite || @thought_bubble_tag_sprite
    @bubble_tag_sprite.dispose
    @thought_bubble_tag_sprite.dispose
    end
    if YSE::POP_MESSAGE::EFFECT[:use_bubble_tag]
      @bubble_tag_sprite = Sprite.new
      @bubble_tag_sprite.visible = false
      @bubble_tag_sprite.bitmap = Cache.system(YSE::POP_MESSAGE::EFFECT2[:bubble_tag_name])
      @bubble_tag_sprite.src_rect.set(0, 0, @bubble_tag_sprite.width, @bubble_tag_sprite.height / 2)
      @message_window.speech_bubble_tag = @bubble_tag_sprite
      
      @thought_bubble_tag_sprite = Sprite.new
      @thought_bubble_tag_sprite.visible = false
      @thought_bubble_tag_sprite.bitmap = Cache.system(YSE::POP_MESSAGE::EFFECT2[:thought_bubble_tag_name])
      @thought_bubble_tag_sprite.src_rect.set(0, 0, @thought_bubble_tag_sprite.width, @thought_bubble_tag_sprite.height / 2)
      @message_window.thought_bubble_tag = @thought_bubble_tag_sprite
    end
    @message_window.face_window = @face_window
   
    quack_msg_create_msg
  end
  # new
  def quack_msg_create_msg
    unless @quack_msgs.nil?
      @quack_msgs.each {|m| m.dispose}
      @quack_msg_speech_bubble_sprites.each {|s| s.dispose}
      @quack_msg_thought_bubble_sprites.each {|s| s.dispose}
    end
    @quack_msgs = []
    @quack_faces = []
    @quack_msg_speech_bubble_sprites = []
    @quack_msg_thought_bubble_sprites = []
    QUACK::MSG::MAX_MSGS.times do |i|
      qm = Window_Quack_Message.new($game_message.quack_msgs, 200-QUACK::MSG::MAX_MSGS+i)
      @quack_msgs.push(qm)
      ss = Sprite.new
      ss.visible = false
      ss.bitmap = Cache.system(YSE::POP_MESSAGE::EFFECT2[:bubble_tag_name])
      ss.src_rect.set(0, 0, ss.width, ss.height / 2)
      qm.speech_bubble_tag = ss
      ts = Sprite.new
      ts.visible = false
      ts.bitmap = Cache.system(YSE::POP_MESSAGE::EFFECT2[:thought_bubble_tag_name])
      ts.src_rect.set(0, 0, ts.width, ts.height / 2)
      qm.thought_bubble_tag = ts
    end
  end
  # overwrite
  def dispose_spriteset
    pop_message_dispose_spriteset
    #@quack_msg_speech_bubble_sprites.each {|s| s.dispose}
    #@quack_msg_thought_bubble_sprites.each {|s| s.dispose}
    #return unless @bubble_tag_sprite || @thought_bubble_tag_sprite
    #@bubble_tag_sprite.dispose
    #@thought_bubble_tag_sprite.dispose
  end
  # alias
  #alias quack_msg_dispose_all_windows dispose_all_windows
  #def dispose_all_windows
  #  @quack_msgs.each {|m| m.dispose}
  #  quack_msg_dispose_all_windows
  #end
end

#==============================================================================
# ?! Scene_Battle
#==============================================================================
class Scene_Battle
  alias quack_update_basic update_basic
  def update_basic
    quack_update_basic
    @quack_msgs.each {|m|
      m.update
      if m.open?
        m.update_placement
      end
    }
  end
  
  alias yse_pop_create_message_window create_message_window
  def create_message_window
    yse_pop_create_message_window
    @face_window = Window_Message_Face.new
    @face_window.message_window = @message_window
    if YSE::POP_MESSAGE::EFFECT[:use_bubble_tag]
      @bubble_tag_sprite = Sprite.new
      @bubble_tag_sprite.visible = false
      @bubble_tag_sprite.bitmap = Cache.system(YSE::POP_MESSAGE::EFFECT2[:bubble_tag_name])
      @bubble_tag_sprite.src_rect.set(0, 0, @bubble_tag_sprite.width, @bubble_tag_sprite.height / 2)
      @message_window.speech_bubble_tag = @bubble_tag_sprite
      
      @thought_bubble_tag_sprite = Sprite.new
      @thought_bubble_tag_sprite.visible = false
      @thought_bubble_tag_sprite.bitmap = Cache.system(YSE::POP_MESSAGE::EFFECT2[:thought_bubble_tag_name])
      @thought_bubble_tag_sprite.src_rect.set(0, 0, @thought_bubble_tag_sprite.width, @thought_bubble_tag_sprite.height / 2)
      @message_window.thought_bubble_tag = @thought_bubble_tag_sprite

    end
    @message_window.face_window = @face_window
   
    quack_create_message_window
  end
  
  def quack_create_message_window
    @quack_msgs = []
    @quack_msg_speech_bubble_sprites = []
    @quack_msg_thought_bubble_sprites = []
    QUACK::MSG::MAX_MSGS.times do |i|
      qm = Window_Quack_Message.new($game_message.quack_msgs, 200-QUACK::MSG::MAX_MSGS+i)
      @quack_msgs.push(qm)
      ss = Sprite.new
      ss.visible = false
      ss.bitmap = Cache.system(YSE::POP_MESSAGE::EFFECT2[:bubble_tag_name])
      ss.src_rect.set(0, 0, ss.width, ss.height / 2)
      qm.speech_bubble_tag = ss
      ts = Sprite.new
      ts.visible = false
      ts.bitmap = Cache.system(YSE::POP_MESSAGE::EFFECT2[:thought_bubble_tag_name])
      ts.src_rect.set(0, 0, ts.width, ts.height / 2)
      qm.thought_bubble_tag = ts
    end
  end
  
  alias yse_pop_dispose_spriteset dispose_spriteset
  def dispose_spriteset
    yse_pop_dispose_spriteset
    @quack_msg_speech_bubble_sprites.each {|s| s.dispose}
    @quack_msg_thought_bubble_sprites.each {|s| s.dispose}
    return unless @bubble_tag_sprite || @thought_bubble_tag_sprite
    @bubble_tag_sprite.dispose
    @thought_bubble_tag_sprite.dispose
  end
  
  alias quack_msg_dispose_all_windows dispose_all_windows
  def dispose_all_windows
    @quack_msgs.each {|m| m.dispose}
    quack_msg_dispose_all_windows
  end
end

#==============================================================================
# ?! Game_Interpreter
#==============================================================================
class Game_Interpreter
  def command_101
    item = $data_items[20]
    if $imported["YEA-MessageSystem"]
      wait_for_message
      $game_message.face_name = @params[0]
      $game_message.face_index = @params[1]
      $game_message.background = @params[2]
      $game_message.position = @params[3]
      
      startindex = @index+1
      textline = @list[startindex].parameters[0].dup
      chatdur = 0
      textline.gsub!(/<cm:([^<>]*)>/i) { chatdur = $1.to_i;"" }
      $game_message.prepare_msg(chatdur) if chatdur != 0
      while continue_message_string?
        @index += 1
        if @list[@index].code == 401
          textline = @list[@index].parameters[0] unless @index == startindex
          if chatdur != 0; $game_message.add_chatter(textline)
          else; $game_message.add(textline)
          end
        end
        break if $game_message.texts.size >= Variable.message_rows
      end
      case next_event_code
      when 102
        @index += 1
        setup_choices(@list[@index].parameters)
      when 103
        @index += 1
        setup_num_input(@list[@index].parameters)
      when 104
        @index += 1
        setup_item_choice(@list[@index].parameters)
      end
      $game_message.fin_msg if chatdur != 0
      wait_for_message
    else
      wait_for_message
      $game_message.face_name = @params[0]
      $game_message.face_index = @params[1]
      $game_message.background = @params[2]
      $game_message.position = @params[3]
      
      startindex = @index+1
      textline = @list[startindex].parameters[0].dup
      chatdur = 0
      textline.gsub!(/<cm:([^<>]*)>/i) { chatdur = $1.to_i;"" }
      $game_message.prepare_msg(chatdur) if chatdur != 0
      
      while next_event_code == 401       # Text data
        @index += 1
        textline = @list[@index].parameters[0] unless @index == startindex
        if chatdur != 0; $game_message.add_chatter(textline)
        else; $game_message.add(textline)
        end
      end
      case next_event_code
      when 102  # Show Choices
        @index += 1
        setup_choices(@list[@index].parameters)
      when 103  # Input Number
        @index += 1
        setup_num_input(@list[@index].parameters)
      when 104  # Select Item
        @index += 1
        setup_item_choice(@list[@index].parameters)
      end
      $game_message.fin_msg if chatdur != 0
      wait_for_message
    end
  end
  # new
  def clear_chatter
    $game_message.clear_chatter
  end
end

#==============================================================================
#
# ?\ End of File
#
#==============================================================================








  1. =begin
  2. #==============================================================================
  3. * Qonvenience - v1.0e
  4.   Author: Quack
  5. #==============================================================================

  6. What it is and what does it do?
  7. -------------------------------------------------------------------------------
  8. -Code that I have made for my own conveniece and use for some of my scripts.
  9. Other than needing it if you plan to use certain scripts I've written it
  10. adds some functionality others might be interested in listed below:

  11. -Adds event self variables.
  12. Usage: (event_id should be a number and key can be what you want. Usually a
  13.           number or a string)
  14.   -Set var: L[event_id,key] = "a_value"  OR   event.tset(key,"a_value")
  15.   -Get var: somevar = L[event_id,key]    OR   somevar = event.tget(key)

  16. -Can access event self switches similar to self vars.
  17. Usage:
  18.   -Set switch: SS[event_id,"A"] = true   OR   event.sset("B",false)
  19.   -Get switch: somevar = SS[event_id,"A"] OR  event.sget("C")

  20. -Game variables and game switches can also be accessed with shorter commands
  21. using V[23] = 200, somevar = V[2] for game variables and S[4] = true,
  22. somevar = S[5] for game switches.

  23. -Adds map local variables. That is variables that are unique to that map.
  24. Usage:
  25.   -Set var: M[key] = 123
  26.   -Get var: somevar = M[key]

  27. -Adds Temporary variables that reset on map chage. There exists both map wide
  28. and event self temporary variables.
  29. Usage:
  30. -To set or get a normal temp var you do this:
  31.     TMP["a_key"] = 9999   OR  TMP[7] = "some_value"
  32.     somevar = TMP["another_key"]  OR  somevar = TMP[13]
  33. -To set or get an event self tmp var:
  34.     event.tset("a_key","a_value")
  35.     event.tget("a_key")
  36.     TMP[event.id,"a_key"] = "a_value"  # works too
  37.    
  38. -Adds a functionality for enemy respawning. It doesn't do anything unless you
  39. actually use it. I would have taken it out and put it a separate script but I
  40. didn't feel like it. A bunch of extra methods aliases and waste of time.
  41. If you have no interest in this just skip to the next point instead.
  42. I use visible enemies that chase you in my game. When an enemy dies I set it's
  43. self A switch to ON to make it stay dead. I did this because I didn't want
  44. them to respawn everytime I went into the room. But I didn't want them stay
  45. dead forever either. What I did was add a counter to each map that is set to
  46. a certain value (depends on a game variable, which variable you decide in the
  47. config area below). Whenever you change map that value is reduced by 1 for all
  48. maps. When the value gets to 0 all events with the tag <en> in their name on
  49. that map gets their 'A' self switch set to OFF so they will respawn. So if you
  50. set the variable to 2 you have to walk at least 2 maps away from a certain map
  51. for that maps enemies to respawn. It is also possible you might want all
  52. enemies to stay dead in a dungeon until you leave that dungeon. To do this
  53. you would set the game variable to a really high value so the enemies will
  54. never respawn from you walking to other maps upon entering the dungeon. And
  55. when you leave you set it back and also do this script call:
  56.    $game_respawnVars.clear
  57. So to use this all your respawnable enemies would have to use the self switch
  58. 'A' as ON to make it dead and they also need to have the tag <en> in their
  59. event name.
  60.    
  61. -Some things for Move routes.
  62. -Designate event to move via code evaluation by setting the first command in
  63.   a move route to script call starting with '[v]' followed by code that can
  64.   be evaluated to a number like: '[v]20-5' OR '[v]V[12]'

  65. -Like with move routes you can now using jump to label designate a label to
  66. jump to via code evaluation by setting the label name in the jump to label
  67. command to '[v]' followed by code that can be evaluated to a string.
  68.   Like so: '[v]"my label"' OR '[v]V[34]' OR '[v]"my label" + M[2]'

  69. -Call an event page like you would call a common event using this method in
  70. a script call: call_event(event_id, page_number)

  71. -Support for editor suffixes.
  72.   Have you ever had multiple versions of the same skill, all with same name?
  73.   Or wanted to add a comment to an enemy's name to help you remember exactly
  74.   what that enemy is and/or does just by seeing it in the list rather than
  75.   having to click it and check it's details?
  76.   Then this is it. With this script active any text following and including
  77.   the first '(' in a database object's name will get removed in-game.
  78.   For example let's say I have a couple of key items which are all for a
  79.   certain sidequest, lets call it the "Pink Elephant" quest. Therefore I add
  80.   '(Pink Elephant)' to the name of each of those key items so they are easy to
  81.   spot in the list. So lets say one of these key items is the "Golden Peanut".
  82.   That item now has the name "Golden Peanut(Pink Elephant)" in the editor.
  83.   But in-game it still has the name "Golden Peanut" because the pink elephant
  84.   part gets removed.

  85. Requirements:
  86. None

  87. Instructions/Install notes:
  88. Paste it below Materials like you would any other script.

  89. Terms of Use:
  90. Use it however you wish (yes, that does include commercial projects), as long
  91. as you do not claim it as your own code. I would also prefer you mention me in
  92. your credits if you do decide to use it.

  93. Bugs:
  94. dunno

  95. History:
  96. 13/01/2016 - Added comments, cleaned code and uploaded it since my Chatter
  97.              Messages script requires it.
  98.   
  99. =end

  100. $imported = {} if $imported.nil?
  101. $imported["Qonvenience"] = true

  102. #==============================================================================
  103. # CONFIG
  104. #==============================================================================
  105. module QUACK
  106.   
  107.   # 在切换地图时自动改变BGM的开关
  108.   TURN_OFF_AUTO_BGM_PLAY_SWITCH = 20
  109.   
  110.   # 变量,设定从当前地图离开后,再经过多少地图,敌人会重生。
  111.   RESPAWN_ROOM_COUNT = 12
  112.   
  113. end
  114. #==============================================================================
  115. # SCRIPT START
  116. #==============================================================================

  117. #==============================================================================
  118. # DataManager - Local variables & item names
  119. # -----------------------------------------------------------------------------
  120. # Adds hashes for new variables and removes text from all database item names
  121. # from the first encountered '('. Useful in for example when you have several
  122. # versions of the same skill (a levelable skill perhaps) and want them all to
  123. # have the same name but still be able to easily tell them apart in the editor.
  124. #==============================================================================
  125. module DataManager
  126.   class << self
  127.    
  128.     #--------------------------------------------------------------------------
  129.     # alias: Create Game Objects
  130.     #--------------------------------------------------------------------------
  131.     alias local_create_game_objects create_game_objects
  132.     def create_game_objects
  133.       local_create_game_objects
  134.       $game_selfVars = {}#Simple_Matrix.new
  135.       $game_mapVars = {}
  136.       $game_respawnVars = {}
  137.       $game_tempVars = {}
  138.       #$game_database = Database.finalize
  139.     end
  140.    
  141.     #--------------------------------------------------------------------------
  142.     # alias: Make Save Contents
  143.     #--------------------------------------------------------------------------
  144.     alias local_make_save_contents make_save_contents
  145.     def make_save_contents
  146.       contents = local_make_save_contents
  147.       contents[:self_vars] = $game_selfVars
  148.       contents[:map_vars] = $game_mapVars
  149.       contents[:respawn_vars] = $game_respawnVars
  150.       contents[:tmp_vars] = $game_tempVars
  151.       contents
  152.     end
  153.       
  154.     #--------------------------------------------------------------------------
  155.     # alias: Extract Save Contents
  156.     #--------------------------------------------------------------------------
  157.     alias local_extract_save_contents extract_save_contents
  158.     def extract_save_contents(contents)
  159.       local_extract_save_contents(contents)
  160.       $game_selfVars = contents[:self_vars]
  161.       $game_mapVars = contents[:map_vars]
  162.       $game_tempVars = contents[:tmp_vars]
  163.       $game_respawnVars = contents[:respawn_vars]
  164.       #$game_database = Database.finalize
  165.      end
  166.       
  167.     #--------------------------------------------------------------------------
  168.     # alias: Load database
  169.     #--------------------------------------------------------------------------
  170.     alias load_database_item_names load_database
  171.     def load_database
  172.       load_database_item_names
  173.       load_item_names
  174.       load_notetags_type_tags
  175.     end
  176.    
  177.     #--------------------------------------------------------------------------
  178.     # new: Load Type Tags
  179.     #--------------------------------------------------------------------------
  180.     def load_notetags_type_tags
  181.       for obj in $data_states
  182.         next if obj.nil?
  183.         obj.load_notetags_type_tags
  184.       end
  185.       for obj in $data_skills
  186.         next if obj.nil?
  187.         obj.load_notetags_type_tags
  188.       end
  189.       for obj in $data_items
  190.         next if obj.nil?
  191.         obj.load_notetags_type_tags
  192.       end
  193.       for obj in $data_weapons
  194.         next if obj.nil?
  195.         obj.load_notetags_type_tags
  196.       end
  197.       for obj in $data_armors
  198.         next if obj.nil?
  199.         obj.load_notetags_type_tags
  200.       end
  201.       for obj in $data_actors
  202.         next if obj.nil?
  203.         obj.load_notetags_type_tags
  204.       end
  205.       for obj in $data_enemies
  206.         next if obj.nil?
  207.         obj.load_notetags_type_tags
  208.       end
  209.     end
  210.          
  211.     #--------------------------------------------------------------------------
  212.     # new: Remove Editor suffixes from items
  213.     #--------------------------------------------------------------------------
  214.     def load_item_names
  215.       for actor in $data_actors
  216.         next if actor.nil?
  217.         actor.name = actor.name.partition("(")[0]
  218.       end
  219.       for clas in $data_classes
  220.         next if clas.nil?
  221.         clas.name = clas.name.partition("(")[0]
  222.       end
  223.       for item in $data_items
  224.         next if item.nil?
  225.         item.name = item.name.partition("(")[0]
  226.       end
  227.       for weapon in $data_weapons
  228.         next if weapon.nil?
  229.         weapon.name = weapon.name.partition("(")[0]
  230.       end
  231.       for armor in $data_armors
  232.         next if armor.nil?
  233.         armor.name = armor.name.partition("(")[0]
  234.       end
  235.       for skill in $data_skills
  236.         next if skill.nil?
  237.         skill.name = skill.name.partition("(")[0]
  238.       end
  239.       for state in $data_states
  240.         next if state.nil?
  241.         state.name = state.name.partition("(")[0]
  242.       end
  243.       for enemy in $data_enemies
  244.         next if enemy.nil?
  245.         enemy.name = enemy.name.partition("(")[0]
  246.       end
  247.     end
  248.   end
  249. end

  250. class RPG::BaseItem
  251.   attr_accessor :type_tags

  252.   def has_tag?(tag)
  253.     return @type_tags.include?(tag)
  254.   end
  255.   
  256.   def load_notetags_type_tags
  257.     @type_tags = self.note =~ /<TAGS:([^<>]*)>/i ? $1 : ""
  258.   end
  259. end # RPG::BaseItem

  260. #==============================================================================
  261. # TEMPORARY VARIABLES (reset on map change)
  262. #==============================================================================
  263. class TMP
  264.   class << self
  265.     def [](*arg)#id)
  266.       case arg.length
  267.         when 1
  268.           return 0 if $game_tempVars[[arg[0]]].nil?
  269.           return $game_tempVars[[arg[0]]]
  270.         when 2
  271.           return 0 if $game_tempVars[[arg[0], arg[1]]].nil?
  272.           return $game_tempVars[[arg[0], arg[1]]]
  273.       end
  274.     end
  275.    
  276.     def []=(*arg)#id, val)
  277.       case arg.length
  278.         when 2; $game_tempVars[[arg[0]]] = arg[1]
  279.         when 3; $game_tempVars[[arg[0],arg[1]]] = arg[2]
  280.       end
  281.       $game_map.need_refresh = true
  282.     end  
  283.    
  284.     def clear
  285.       $game_tempVars.clear
  286.     end
  287.   end
  288. end
  289. class T
  290.   class << self
  291.     def [](*arg)
  292.       case arg.length
  293.         when 1
  294.           return 0 if $game_tempVars[[arg[0]]].nil?
  295.           return $game_tempVars[[arg[0]]]
  296.         when 2
  297.           return 0 if $game_tempVars[[arg[0], arg[1]]].nil?
  298.           return $game_tempVars[[arg[0], arg[1]]]
  299.       end
  300.     end
  301.    
  302.     def []=(*arg)
  303.       case arg.length
  304.         when 2; $game_tempVars[[arg[0]]] = arg[1]
  305.         when 3; $game_tempVars[[arg[0],arg[1]]] = arg[2]
  306.       end
  307.       $game_map.need_refresh = true
  308.     end
  309.    
  310.     def clear
  311.       $game_tempVars.clear
  312.     end
  313.   end
  314. end

  315. #==============================================================================
  316. # MAP LOCAL VARIABLES
  317. #==============================================================================
  318. class M
  319.   class << self
  320.     def [](var_id)
  321.       return 0 if $game_mapVars[[$game_map.map_id,var_id]].nil?
  322.       return $game_mapVars[[$game_map.map_id,var_id]]
  323.     end
  324.    
  325.     def []=(var_id, value)
  326.       $game_mapVars[[$game_map.map_id,var_id]] = value
  327.       $game_map.need_refresh = true
  328.     end
  329.   end
  330. end

  331. #==============================================================================
  332. # EVENT LOCAL VARIABLES
  333. #==============================================================================
  334. class L
  335.   class << self
  336.     def [](eid, vid)
  337.       return 0 if $game_selfVars[[$game_map.map_id,eid,vid]].nil?
  338.       return $game_selfVars[[$game_map.map_id,eid,vid]]
  339.     end
  340.    
  341.     def []=(eid, vid, value)
  342.       $game_selfVars[[$game_map.map_id,eid,vid]] = value
  343.       $game_map.need_refresh = true
  344.     end
  345.   end
  346. end

  347. #==============================================================================
  348. # SELF SWITCHES
  349. #==============================================================================
  350. class SS
  351.   class << self
  352.     def [](eid, vid)
  353.       return false if $game_self_switches[[$game_map.map_id, eif, vid]].nil?
  354.       return $game_self_switches[[$game_map.map_id, eif, vid]]
  355.     end
  356.    
  357.     def []=(eid, vid, value)
  358.       $game_self_switches[[$game_map.map_id,eid,vid]] = value
  359.       $game_map.need_refresh = true
  360.     end
  361.   end
  362. end

  363. #==============================================================================
  364. # GLOBAL VARIABLES
  365. #==============================================================================
  366. class V
  367.   class << self
  368.     def [](id)
  369.       return 0 if id < 1
  370.       return $game_variables[id]
  371.     end
  372.    
  373.     def []=(id, value)
  374.       $game_variables[id] = value
  375.     end
  376.   end
  377. end

  378. #==============================================================================
  379. # GLOBAL SWITCHES
  380. #==============================================================================
  381. class S
  382.   class << self
  383.     def [](id)
  384.       return false if id < 1
  385.       return $game_switches[id]
  386.     end
  387.    
  388.     def []=(id, value)
  389.       $game_switches[id] = value
  390.     end
  391.   end
  392. end

  393. #==============================================================================
  394. #==============================================================================

  395. class Game_Battler < Game_BattlerBase
  396.   #--------------------------------------------------------------------------
  397.   # new: Check if battler has that tag
  398.   #--------------------------------------------------------------------------
  399.   def has_tag?(tag)
  400.     return $data_enemies[@enemy_id].has_tag?(tag)
  401.   end
  402.   
  403.   #--------------------------------------------------------------------------
  404.   # new: Check if battler has state with that tag
  405.   #--------------------------------------------------------------------------
  406.   def tagged_state?(tag)
  407.     for state in states
  408.       return true if state.type_tags.include?(tag)
  409.     end
  410.     return false
  411.   end
  412.   
  413.   #--------------------------------------------------------------------------
  414.   # new: Remove states with specified tag
  415.   #--------------------------------------------------------------------------
  416.   def remove_tagged_states(tag)
  417.     rstates = []
  418.     s = states
  419.     for state in s
  420.       if state.type_tags.include?(tag)
  421.         remove_state(state.id)
  422.         rstates.push(state)
  423.       end
  424.     end
  425.     return rstates
  426.   end
  427.   
  428.   #--------------------------------------------------------------------------
  429.   # new: Return all states battler has with specified tag
  430.   #--------------------------------------------------------------------------
  431.   def states_with_tags(tag)
  432.     s = []
  433.     for state in states
  434.       s.push(state.id) if state.type_tags.include?(tag)
  435.     end
  436.     return s
  437.   end
  438. end

  439. class Game_Actor < Game_Battler
  440.   #--------------------------------------------------------------------------
  441.   # new: Check if battler has that tag
  442.   #--------------------------------------------------------------------------
  443.   def has_tag?(tag)
  444.     return actor.has_tag?(tag)
  445.   end
  446. end

  447. class RPG::Troop::Page
  448.   attr_reader :note_tags
  449.   attr_reader :custom_condition
  450.   
  451.   def setup_notetags
  452.     @note_tags = ""
  453.     return if !@list || @list.size <= 0
  454.     # build note tags
  455.     @list.each {|i|
  456.       @note_tags += i.parameters[0] if i && (i.code == 108 || i.code == 408)
  457.     }
  458.     # find page custom condition if there is one
  459.     @custom_condition = @note_tags =~ /<CC>(.*)<\/CC>/i ? $1 : nil
  460.   end
  461. end

  462. class Game_Troop
  463.   # METHODS FOR CUSTOM EVENT CONDITIONS
  464.   alias quack_qon_setup setup
  465.   def setup(troop_id)
  466.     quack_qon_setup(troop_id)
  467.     troop.pages.each{|p| p.setup_notetags }
  468.   end
  469.   
  470.   alias quack_qon_conditions_met conditions_met?
  471.   def conditions_met?(page)
  472.     r = quack_qon_conditions_met(page)
  473.     return false if has_custom_cond?(page) && custom_cond_fail(page)
  474.     return r
  475.   end
  476.   
  477.   def has_custom_cond?(page)
  478.     !page.custom_condition.nil?
  479.   end
  480.   
  481.   def custom_cond_fail(page)
  482.     return !eval(page.custom_condition)
  483.   end
  484. end

  485. class Game_Map
  486.   attr_reader   :map_id
  487.   
  488.   #--------------------------------------------------------------------------
  489.   # alias: Autoplay
  490.   # Switch for turning off bgm auto starting new song when entering map
  491.   #--------------------------------------------------------------------------
  492.   alias quack_qon_autoplay autoplay
  493.   def autoplay
  494.     if S[QUACK::TURN_OFF_AUTO_BGM_PLAY_SWITCH]
  495.       @map.bgs.play if @map.autoplay_bgs
  496.     else
  497.       quack_qon_autoplay
  498.     end
  499.   end
  500.   
  501.   #--------------------------------------------------------------------------
  502.   # alias: Setup
  503.   # Clear TMP vars, clear event name tags & update enemy respawn
  504.   #--------------------------------------------------------------------------
  505.   alias qack_qon_setup setup
  506.   def setup(map_id)
  507.     TMP.clear
  508.     @q_name_tags = {}
  509.     qack_qon_setup(map_id)
  510.     if get_respawn(map_id) == 0
  511.       e = all_event_tag('en')
  512.       e.each {|ev| ev.sset("A",false) } unless e.nil?
  513.     end
  514.     for key in $game_respawnVars.keys
  515.       $game_respawnVars[key] -= 1
  516.     end
  517.     $game_respawnVars[map_id] = V[QUACK::RESPAWN_ROOM_COUNT]
  518.     $game_respawnVars.delete_if {|k,v| v <= 0 }
  519.   end
  520.   
  521.   #--------------------------------------------------------------------------
  522.   # new: Add Event Tags
  523.   # Used for event name tags
  524.   #--------------------------------------------------------------------------
  525.   def add_event_tags(ev, pt)
  526.     u = []
  527.     # name tags
  528.     t = ev.name.scan(/<([^<>]*)>/i)
  529.     return if t.nil? || t.length < 1
  530.     t.each {|s|
  531.       if @q_name_tags.has_key?(s[0])
  532.         @q_name_tags[s[0]].push(ev)
  533.       else
  534.         @q_name_tags[s[0]] = [ev]
  535.       end
  536.       ev.add_name_tag(s[0])
  537.       u.push(s[0])
  538.     }
  539.     # page tags
  540.     pt.each{|p|
  541.       p.each{|pagtag|
  542.         next if u.include?(pagtag)
  543.         u.push(pagtag)
  544.         if @q_name_tags.has_key?(pagtag)
  545.           @q_name_tags[pagtag].push(ev)
  546.         else
  547.           @q_name_tags[pagtag] = [ev]
  548.         end
  549.       }
  550.     }
  551.   end
  552.   
  553.   #--------------------------------------------------------------------------
  554.   # new: Delete Event Tags
  555.   # Used for event name tags
  556.   #--------------------------------------------------------------------------
  557.   def delete_event_tags(ev)
  558.     ev.name_tags.each{|s|
  559.       @q_name_tags[s].delete(ev)
  560.     }
  561.   end
  562.   
  563.   #--------------------------------------------------------------------------
  564.   # new: First Event With Tag
  565.   # First event on map with specified tag
  566.   #--------------------------------------------------------------------------
  567.   def first_event_tag(tag)
  568.     return nil unless @q_name_tags.has_key?(tag)
  569.     #return @q_name_tags[tag][0]
  570.     @q_name_tags[tag].each{|e|
  571.       return e if e.has_name_tag?(tag)
  572.     }
  573.     return nil
  574.   end
  575.   #--------------------------------------------------------------------------
  576.   # new: Last Event With Tag
  577.   # Last event on map with specified tag
  578.   #--------------------------------------------------------------------------
  579.   def last_event_tag(tag)
  580.     return nil unless @q_name_tags.has_key?(tag)
  581.     #return @q_name_tags[tag][@q_name_tags[tag].length-1]
  582.     @q_name_tags[tag].reverse_each{|e|
  583.       return e if e.has_name_tag?(tag)
  584.     }
  585.   end
  586.   #--------------------------------------------------------------------------
  587.   # new: All Events With Tag
  588.   # All events on map with specified tag
  589.   #--------------------------------------------------------------------------
  590.   def all_event_tag(tag)
  591.     return nil unless @q_name_tags.has_key?(tag)
  592.     #return @q_name_tags[tag]
  593.     return @q_name_tags[tag].select{|e| e.has_name_tag?(tag) }
  594.   end
  595.   
  596.   #--------------------------------------------------------------------------
  597.   # new: get respawn
  598.   # get respawn var
  599.   #--------------------------------------------------------------------------
  600.   def get_respawn(id)
  601.     return $game_respawnVars[id] if $game_respawnVars.has_key?(id)
  602.     return 0
  603.   end
  604.   
  605. end


  606. class Game_Character < Game_CharacterBase
  607.   #--------------------------------------------------------------------------
  608.   # alias: process_move_command
  609.   #--------------------------------------------------------------------------
  610.   alias process_move_command_movement_cmds_alias process_move_command
  611.   def process_move_command(command)
  612.     case command.code
  613.       when ROUTE_SCRIPT
  614.         return if command.parameters[0].include? '[v]'
  615.     end
  616.     process_move_command_movement_cmds_alias(command)
  617.   end
  618.   
  619.   MOVE_SYMBOL_CODE = {
  620.   :UP    => ROUTE_MOVE_UP,
  621.   :DOWN  => ROUTE_MOVE_DOWN,
  622.   :LEFT  => ROUTE_MOVE_LEFT,
  623.   :RIGHT => ROUTE_MOVE_RIGHT,
  624.   :FORWARD => ROUTE_MOVE_FORWARD,
  625.   :BACKWARD => ROUTE_MOVE_BACKWARD,
  626.   :TOWARD => ROUTE_MOVE_TOWARD,
  627.   :AWAY => ROUTE_MOVE_AWAY,
  628.   }
  629.   
  630.   #--------------------------------------------------------------------------
  631.   # new method: opacity_tween
  632.   #--------------------------------------------------------------------------
  633.   def opacity_tween(opacity, duration)
  634.     crnt_opacity = @opacity
  635.     i = (opacity - crnt_opacity).to_f / duration
  636.     for x in (0..duration)
  637.       @move_route.list.insert(@move_route_index + x + 1, RPG::MoveCommand.new(ROUTE_CHANGE_OPACITY, [crnt_opacity.to_i]))
  638.       crnt_opacity += i
  639.       crnt_opacity = opacity if x == (duration-1)
  640.     end
  641.     @move_route.list.delete_at(@move_route_index)
  642.   end

  643.   #--------------------------------------------------------------------------
  644.   # new method: move
  645.   #--------------------------------------------------------------------------
  646.   def move(dir, steps)
  647.     dir = MOVE_SYMBOL_CODE[dir] if dir.is_a?(Symbol)
  648.     for x in (1..steps)
  649.       @move_route.list.insert(@move_route_index + x, RPG::MoveCommand.new(dir))
  650.     end
  651.     @move_route.list.delete_at(@move_route_index)
  652.   end
  653.   
  654.   def gotoxy(x,y)
  655.     @x = x
  656.     @y = y
  657.   end
  658.   
  659.   def moveto2(x, y)
  660.     @x = x % $game_map.width
  661.     @y = y % $game_map.height
  662.     @real_x = @x
  663.     @real_y = @y
  664.   end
  665.   
  666.   def moveto2_d(l, d)
  667.     @y -= l if d == 8
  668.     @y += l if d == 2
  669.     @x -= l if d == 4
  670.     @x += l if d == 6
  671.     @real_x = @x
  672.     @real_y = @y
  673.   end
  674.   
  675.   def set_move_speed(val)
  676.     @move_speed = val
  677.   end
  678.   
  679.   def clear_move_route
  680.     @move_route = nil
  681.     @move_route_index = 0
  682.     @wait_count = 0
  683.   end
  684.   
  685.   def turn_left
  686.     set_direction(4)
  687.   end
  688.   def turn_right
  689.     set_direction(6)
  690.   end
  691.   def turn_up
  692.     set_direction(8)
  693.   end
  694.   def turn_down
  695.     set_direction(2)
  696.   end
  697. end

  698. class Game_Player < Game_Character
  699.   alias init_alias initialize
  700.   def initialize
  701.     init_alias
  702.     @move_input_enabled = true
  703.   end
  704.   
  705.   def disable_move_input
  706.     @move_input_enabled = false
  707.   end
  708.   
  709.   def enable_move_input
  710.     @move_input_enabled = true
  711.   end
  712.   
  713.   def in_control?
  714.     return @move_input_enabled
  715.   end
  716.   
  717.   alias qon_movable movable?
  718.   def movable?
  719.     return false if !@move_input_enabled
  720.     qon_movable
  721.   end
  722.   
  723.   #alias move_by_input_alias move_by_input
  724.   #def move_by_input
  725.   #  return if !@move_input_enabled
  726.   #  move_by_input_alias
  727.   #end
  728. end

  729. class RPG::Event::Page
  730.   attr_reader :page_tags
  731.   attr_reader :note_tags
  732.   attr_reader :custom_condition
  733.   
  734.   def setup_notetags
  735.     @note_tags = ""
  736.     @page_tags = []
  737.     return if !@list || @list.size <= 0
  738.     # build note tags
  739.     @list.each {|i|
  740.       @note_tags += i.parameters[0] if i && (i.code == 108 || i.code == 408)
  741.     }
  742.     # find page custom condition if there is one
  743.     @custom_condition = note_tags =~ /<CC>(.*)<\/CC>/i ? $1 : nil
  744.    
  745.     # get page tags from note tags
  746.     t = @note_tags.scan(/<t:([^<>]*)>/i)
  747.     return if t.nil? || t.length < 1
  748.     t.each{|pt|
  749.       @page_tags.push(pt[0])
  750.     }
  751.   end
  752. end

  753. class Game_Event < Game_Character
  754.   
  755.   #--------------------------------------------------------------------------
  756.   # alias: initialize
  757.   # For event name tags.
  758.   #--------------------------------------------------------------------------
  759.   alias quack_qon_init initialize
  760.   def initialize(map_id, event)
  761.     quack_qon_init(map_id, event)
  762.     pt = []
  763.     @event.pages.each {|p|
  764.       p.setup_notetags
  765.       pt.push(p.page_tags)
  766.     }
  767.     $game_map.add_event_tags(self, pt)
  768.   end
  769.   #--------------------------------------------------------------------------
  770.   # new: Add name tag
  771.   # For event name tags.
  772.   #--------------------------------------------------------------------------
  773.   def add_name_tag(tag)
  774.     if @name_tags.nil?
  775.       @name_tags = [tag]
  776.     else
  777.       @name_tags.push(tag)
  778.     end
  779.   end
  780.   def name_tags
  781.     return [] if @name_tags.nil?
  782.     return @name_tags
  783.   end
  784.   def has_name_tag?(tag)
  785.     unless @name_tags.nil?
  786.       return true if @name_tags.include?(tag)
  787.     end
  788.     return false if @page.nil? || @page.page_tags.nil?
  789.     return true if @page.page_tags.include?(tag)
  790.     return false
  791.   end
  792.   #--------------------------------------------------------------------------
  793.   # new: Return event's name
  794.   # For event name tags.
  795.   #--------------------------------------------------------------------------
  796.   def name
  797.     return @event.name
  798.   end
  799.   
  800.   def page_tags
  801.     return @page.page_tags
  802.   end
  803.   
  804.   def notetags_page
  805.     return @page.note_tags
  806.   #  return "" if !@page || !@page.list || @page.list.size <= 0
  807.   #  return @notetags_page if @notetags_page
  808.   #  @notetags_page = ""
  809.   #  l = []
  810.   #  @page.list.each {|i|
  811.   #    @notetags_page += i.parameters[0] if i && (i.code == 108 || i.code == 408)
  812.   #  }
  813.   #  return @notetags_page
  814.   end  
  815.   def notetags
  816.     return @notetags unless @notetags.nil?
  817.     @notetags = ""
  818.     @event.pages.each {|p|
  819.       next if !p || !p.list || p.list.size <= 0
  820.       @notetags += p.note_tags
  821.     }
  822.     return @notetags
  823.   end
  824.   
  825.   # METHODS FOR CUSTOM EVENT CONDITIONS
  826.   
  827.   alias quack_qon_conditions_met conditions_met?
  828.   def conditions_met?(page)
  829.     r = quack_qon_conditions_met(page)
  830.     return false if has_custom_cond?(page) && custom_cond_fail(page)
  831.     return r
  832.   end
  833.   
  834.   def has_custom_cond?(page)
  835.     !page.custom_condition.nil?
  836.   end
  837.   
  838.   def custom_cond_fail(page)
  839.     return !eval(page.custom_condition)
  840.   end
  841.   
  842.   # METHODS FOR ACCESSING THE EVENTS LOCAL VARIABLES AND SWITCHES
  843.   
  844.   #--------------------------------------------------------------------------
  845.   # new: Get self var
  846.   #--------------------------------------------------------------------------
  847.   def lget(id)
  848.     L[@id,id]
  849.   end
  850.   #--------------------------------------------------------------------------
  851.   # new: Set self var
  852.   #--------------------------------------------------------------------------
  853.   def lset(id,val)
  854.     $game_selfVars[[@map_id,@id,id]] = val
  855.     $game_map.need_refresh = true
  856.   end

  857.   #--------------------------------------------------------------------------
  858.   # new: Get self switch
  859.   #--------------------------------------------------------------------------
  860.   def sget(id)
  861.     L[@id,id]
  862.   end
  863.   #--------------------------------------------------------------------------
  864.   # new: Set self switch
  865.   #--------------------------------------------------------------------------
  866.   def sset(id,val)
  867.     $game_self_switches[[@map_id,@id,id]] = val
  868.     $game_map.need_refresh = true
  869.   end
  870.   
  871.   #--------------------------------------------------------------------------
  872.   # new: Get self temp var
  873.   #--------------------------------------------------------------------------
  874.   def tget(id)
  875.     return TMP[@id,id]
  876.   end
  877.   #--------------------------------------------------------------------------
  878.   # new: Set self temp var
  879.   #--------------------------------------------------------------------------
  880.   def tset(id,val)
  881.     $game_tempVars[[@id,id]] = val
  882.     $game_map.need_refresh = true
  883.   end
  884.   
  885.   #--------------------------------------------------------------------------
  886.   # new: Get Page
  887.   # Needed for event page call
  888.   #--------------------------------------------------------------------------
  889.   def get_page(index)
  890.     return @event.pages[index]
  891.   end
  892. end

  893. class Game_Interpreter
  894.   #--------------------------------------------------------------------------
  895.   # * Self Vars
  896.   #--------------------------------------------------------------------------
  897.   
  898.   #--------------------------------------------------------------------------
  899.   # new: lget
  900.   # get self var
  901.   #--------------------------------------------------------------------------
  902.   def lget(*arguments)
  903.     result = 0
  904.     case arguments.length
  905.       when 1; result = $game_selfVars[[@map_id, @event_id, arguments[0]]]
  906.       when 2; result = $game_selfVars[[@map_id, arguments[0], arguments[1]]]
  907.       when 3; result = $game_selfVars[[arguments[0], arguments[1], arguments[2]]]
  908.     end
  909.     return result
  910.   end
  911.   #--------------------------------------------------------------------------
  912.   # new: lset
  913.   # set self var
  914.   #--------------------------------------------------------------------------
  915.   def lset(*arguments)
  916.     case arguments.length
  917.       when 2; $game_selfVars[[@map_id, @event_id, arguments[0]]] = arguments[1]
  918.       when 3; $game_selfVars[[@map_id, arguments[0], arguments[1]]] = arguments[2]
  919.       when 4; $game_selfVars[[arguments[0], arguments[1], arguments[2]]] = arguments[3]
  920.     end
  921.     $game_map.need_refresh = true
  922.   end
  923.   #--------------------------------------------------------------------------
  924.   # * Self Switches
  925.   #--------------------------------------------------------------------------
  926.   
  927.   #--------------------------------------------------------------------------
  928.   # new: sget
  929.   # get self switch
  930.   #--------------------------------------------------------------------------
  931.   def sget(*arguments)
  932.     result = false
  933.     case arguments.length
  934.       when 1; result = $game_self_switches[[@map_id, @event_id, arguments[0]]]
  935.       when 2; result = $game_self_switches[[@map_id, arguments[0], arguments[1]]]
  936.       when 3; result = $game_self_switches[[arguments[0], arguments[1], arguments[2]]]
  937.     end
  938.     return result
  939.   end
  940.   #--------------------------------------------------------------------------
  941.   # new: sset
  942.   # set self switch
  943.   #--------------------------------------------------------------------------
  944.   def sset(*arguments)
  945.     case arguments.length
  946.       when 2; $game_self_switches[[@map_id, @event_id, arguments[0]]] = arguments[1]
  947.       when 3; $game_self_switches[[@map_id, arguments[0], arguments[1]]] = arguments[2]
  948.       when 4; $game_self_switches[[arguments[0], arguments[1], arguments[2]]] = arguments[3]
  949.     end
  950.     $game_map.need_refresh = true
  951.   end
  952.   
  953.   #--------------------------------------------------------------------------
  954.   # * Respawn Vars
  955.   #--------------------------------------------------------------------------
  956.   
  957.   #--------------------------------------------------------------------------
  958.   # new: get respawn
  959.   # get respawn var
  960.   #--------------------------------------------------------------------------
  961.   def get_respawn(id)
  962.     return $game_respawnVars[id] if $game_respawnVars.has_key?(id)
  963.     return 0
  964.   end
  965.   #--------------------------------------------------------------------------
  966.   # new: set respawn
  967.   # set respawn var
  968.   #--------------------------------------------------------------------------
  969.   def set_respawn(id, value)
  970.     $game_respawnVars[id] = value
  971.   end
  972.   
  973.   #--------------------------------------------------------------------------
  974.   # * Easier to remember fade commands
  975.   #--------------------------------------------------------------------------
  976.   def fade_in(duration)
  977.     screen.start_fadein(duration)
  978.   end
  979.   def fade_out(duration)
  980.     screen.start_fadeout(duration)
  981.   end
  982.   
  983.   #--------------------------------------------------------------------------
  984.   # alias: Temporarily Erase Event
  985.   # For event name tags
  986.   #--------------------------------------------------------------------------
  987.   alias quack_qon_command_214 command_214
  988.   def command_214
  989.     $game_map.delete_event_tags($game_map.events[@event_id])
  990.     quack_qon_command_214
  991.   end
  992.   
  993.   #--------------------------------------------------------------------------
  994.   # overwrite method: command_205 (Set Move Route)
  995.   # ---------------------------------------------------
  996.   # By making the first command in a move route a script call which starts
  997.   # with '[v]' the rest of the script call be evaluated to an integer which
  998.   # is used as character id to chose which event the move route pertains to.
  999.   #--------------------------------------------------------------------------
  1000.   def command_205 # COMMAND SET MOVE ROUTE
  1001.     $game_map.refresh if $game_map.need_refresh
  1002.     character = get_character(@params[0])
  1003.     cmd = @params[1].list[0]
  1004.     if cmd.code == 45 # 45 = SCRIPT COMMAND
  1005.       if cmd.parameters[0].include? '[v]'
  1006.         @params[0] = eval(cmd.parameters[0][3..cmd.parameters[0].length])
  1007.         character = get_character(@params[0])
  1008.         #@params[1].list.delete_at(0)
  1009.       end
  1010.     end
  1011.     if character
  1012.       character.force_move_route(@params[1].dup)
  1013.       Fiber.yield while character.move_route_forcing if @params[1].wait
  1014.     end
  1015.   end
  1016.   
  1017.   #==========================================================================
  1018.   # * Jump to Label (edited to allow to jump to a label using a variable)
  1019.   #==========================================================================
  1020.   def command_119
  1021.     label_name = @params[0]
  1022.     if label_name.include? '[v]'
  1023.       label_name = eval(label_name[3..label_name.length])
  1024.     end
  1025.     @list.size.times do |i|
  1026.       if @list[i].code == 118 && @list[i].parameters[0] == label_name
  1027.         @index = i
  1028.         return
  1029.       end
  1030.     end
  1031.   end
  1032.   
  1033.   #==========================================================================
  1034.   # * Call event page
  1035.   #==========================================================================
  1036.   def call_event(event_id, page_id)
  1037.     qq = Game_Interpreter.new(@depth + 1)
  1038.     page = evs[event_id].get_page(page_id)
  1039.     qq.setup(page.list, event_id)
  1040.     qq.run
  1041.   end
  1042.   
  1043.   def ev; @event_id; end
  1044.   def evs; $game_map.events; end
  1045.   def events; $game_map.events; end
  1046.   def me; evs[ev]; end
  1047.   def pl; $game_player; end
  1048.   def player; $game_player; end
  1049.   def char(id); get_character(id); end
  1050.   def map; return $game_map; end
  1051.   def set_move_speed(char_id, val)
  1052.     get_character(char_id).set_move_speed(val)
  1053.   end
  1054.   
  1055.   def move_to_point(id,x,y,wait=false)
  1056.     c = char(id)
  1057.     c.move_to_point(x,y)
  1058.     Fiber.yield while c.move_route_forcing if wait
  1059.   end
  1060.   
  1061.   #--------------------------------------------------------------------------
  1062.   # new: First event with tag
  1063.   #--------------------------------------------------------------------------
  1064.   def first_event_tag(tag)
  1065.     $game_map.first_event_tag(tag)
  1066.   end
  1067.   #--------------------------------------------------------------------------
  1068.   # new: Last event with tag
  1069.   #--------------------------------------------------------------------------
  1070.   def last_event_tag(tag)
  1071.     $game_map.last_event_tag(tag)
  1072.   end
  1073.   #--------------------------------------------------------------------------
  1074.   # new: All events with tag
  1075.   #--------------------------------------------------------------------------
  1076.   def all_event_tag(tag)
  1077.     $game_map.all_event_tag(tag)
  1078.   end
  1079.   #--------------------------------------------------------------------------
  1080.   # new: Find all events with all the specified tags
  1081.   #--------------------------------------------------------------------------
  1082.   def find_events(*args)
  1083.     result = []
  1084.     evs.keys.each {|k|
  1085.       unless evs[k].name_tags.nil?
  1086.         if (args - evs[k].name_tags).empty?
  1087.           result.push(evs[k])
  1088.         end
  1089.       end
  1090.     }
  1091.     return result
  1092.   end
  1093.   
  1094.   def diff(val1, val2)
  1095.     return (val1 - val2).abs
  1096.   end
  1097.   
  1098.   def pos_diff(c1, c2)
  1099.     xd = c1.x - c2.x
  1100.     yd = c1.y - c2.y
  1101.     xd *= xd
  1102.     yd *= yd
  1103.     return Math.sqrt(xd+yd)
  1104.   end
  1105.   
  1106.   #returns true if the distance between char1 and char2 is greater than dist
  1107.   def distance_gt(ev1,ev2,dist)#id1, id2, dist)
  1108.     #xd = char(id1).x - char(id2).x
  1109.     #yd = char(id1).y - char(id2).y
  1110.     xd = ev1.x - ev2.x
  1111.     yd = ev1.y - ev2.y
  1112.     xd *= xd
  1113.     yd *= yd
  1114.     return (xd + yd) > dist * dist
  1115.   end
  1116.   
  1117.   # returns true if the difference between val1 and val2 is greater than i.
  1118.   def diff_gt(val1, val2, i)
  1119.     if val1 < val2 - i; return true; end
  1120.     if val1 > val2 + i; return true; end
  1121.     return false
  1122.   end
  1123.   
  1124.   # returns true if the position1 is equal to position2
  1125.   def pos_is?(*arg)
  1126.     case arg.length
  1127.       when 1
  1128.         c = arg[0]#get_character(arg[0])
  1129.         return c.x == me.x && c.y == me.y
  1130.       when 2
  1131.         c1 = arg[0]#get_character(arg[0])
  1132.         c2 = arg[1]#get_character(arg[1])
  1133.         return c1.x == c2.x && c1.y == c2.y
  1134.       when 3
  1135.         c1 = arg[0]#get_character(arg[0])
  1136.         return c1.x == arg[1] && c2.y == arg[2]
  1137.       when 4
  1138.         return arg[0] == arg[2] && arg[1] == arg[3]
  1139.     end
  1140.     return false
  1141.   end
  1142.   
  1143.   # Returns in which of the 4 directions char2 is related to char1
  1144.   def ev_dir(char1, char2)
  1145.     if diff(char1.x, char2.x) > diff(char1.y,char2.y)
  1146.       if char1.x < char2.x
  1147.         return 6
  1148.       else
  1149.         return 4
  1150.       end
  1151.     else
  1152.       if char1.y < char2.y
  1153.         return 2
  1154.       else
  1155.         return 8
  1156.       end
  1157.     end
  1158.   end
  1159.   
  1160.   def wait_rnd(min_dur, max_dur)
  1161.     duration = min_dur + rnd(max_dur - min_dur).to_i
  1162.     duration.times { Fiber.yield }
  1163.   end
  1164.   
  1165.   def break_loop #becuz who can remember that 113 = break?
  1166.     command_113
  1167.   end
  1168.   
  1169.   # Prepare for cutscene
  1170.   def prep_scene
  1171.     $game_system.menu_disabled = true
  1172.     $game_system.save_disabled = true
  1173.     pl.disable_move_input
  1174.   end
  1175.   
  1176.   #end cutscene
  1177.   def end_scene
  1178.     $game_system.menu_disabled = false
  1179.     $game_system.save_disabled = false
  1180.     pl.enable_move_input
  1181.   end
  1182. end
复制代码







我使用脚本的范例工程

https://rpg.blue/thread-405406-1-1.html
QQ截图20180210120241.png

这是放在新的工程里的

这是放在新的工程里的
梦石
0
星屑
915
在线时间
107 小时
注册时间
2017-12-2
回帖
51
 楼主| 发表于 2018-2-10 12:16:27 | 显示全部楼层
我又重新排除了一下插件脚本里的脚本是否冲突,发现并不是它们的原因,难道是上面的脚本出问题了???。。。。。。。。
会不会是我以前弄过忘记了
回复

使用道具 举报

梦石
0
星屑
915
在线时间
107 小时
注册时间
2017-12-2
回帖
51
 楼主| 发表于 2018-2-10 12:18:06 | 显示全部楼层
总是会这样子。。。。。。。。。。。。。。。。。。。。
QQ截图20180210121517.png
回复

使用道具 举报

梦石
0
星屑
915
在线时间
107 小时
注册时间
2017-12-2
回帖
51
 楼主| 发表于 2018-2-10 13:20:26 | 显示全部楼层
该怎么办怎么办怎么办。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
回复

使用道具 举报

梦石
1
星屑
14389
在线时间
2110 小时
注册时间
2017-9-28
回帖
607
发表于 2018-2-10 15:25:08 | 显示全部楼层
qonvenience是核心脚本,需要放在气泡框插件插件的上面...........
顺序参考帖子里的范例

点评

建议核心脚本/基础模块等脚本放的越上越好....  发表于 2018-2-10 15:26
VA外站脚本汉化群:226308173   |    部分远古文件备份:https://wwzv.lanzoue.com/b02rac5pc  密码:acgm
回复

使用道具 举报

梦石
0
星屑
915
在线时间
107 小时
注册时间
2017-12-2
回帖
51
 楼主| 发表于 2018-2-10 15:58:30 | 显示全部楼层
Nil2018 发表于 2018-2-10 15:25
qonvenience是核心脚本,需要放在气泡框插件插件的上面...........
顺序参考帖子里的范例 ...

放了。。没用。。。。。。。。。。。。。。。

点评

你放在下面了,不是"上面"  发表于 2018-2-10 17:27
回复

使用道具 举报

梦石
0
星屑
915
在线时间
107 小时
注册时间
2017-12-2
回帖
51
 楼主| 发表于 2018-2-10 17:41:59 | 显示全部楼层
Nil2018 发表于 2018-2-10 15:25
qonvenience是核心脚本,需要放在气泡框插件插件的上面...........
顺序参考帖子里的范例 ...

我重新放在下面过了,不是一楼的那个顺序【那是之前的】
可还是没有用。。。。
回复

使用道具 举报

梦石
0
星屑
915
在线时间
107 小时
注册时间
2017-12-2
回帖
51
 楼主| 发表于 2018-2-10 21:38:56 | 显示全部楼层
没有人吗。。。。。。。。。。。。。。。。。。
回复

使用道具 举报

梦石
0
星屑
915
在线时间
107 小时
注册时间
2017-12-2
回帖
51
 楼主| 发表于 2018-2-11 12:14:26 | 显示全部楼层
大家新年快乐。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
回复

使用道具 举报

梦石
0
星屑
915
在线时间
107 小时
注册时间
2017-12-2
回帖
51
 楼主| 发表于 2018-2-13 17:18:01 | 显示全部楼层
没人能回答了吗。。。。。。。。。。。。。。。。。。。。。。。
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部