查看: 2773|回复: 5

[已经过期] 加强对话框 与 多选项脚本 冲突

[复制链接]
梦石
0
星屑
157
在线时间
143 小时
注册时间
2011-6-1
回帖
298
发表于 2017-7-19 13:01:20 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 乐之魂 于 2017-7-20 19:25 编辑

对话框用的是最新的对话框加强脚本,会与搜索道的多选项脚本 有冲突,就是第5项起不显示,而且有效的选项只有1和2项。求助

  1. #==============================================================================
  2. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  3. #------------------------------------------------------------------------------
  4. # 原版:趙雲
  5. # 重制:RyanBern  2015.08.24
  6. #------------------------------------------------------------------------------
  7. # 更新记录:
  8. #     2015.09.06    少许BUG修复,附加战斗场景对话效果
  9. #     2015.11.05    修复临时更改字号功能
  10. #     2015.11.13    增加更改姓名颜色的功能,修复显示 BUG
  11. #     2016.01.19    增加大型半身像对话框设置,快捷方式设置,高级快捷方式设置
  12. #     2016.05.10    增加对话框开关,打开指定开关时暂时屏蔽本对话加强窗口
  13. #                   增加\f[头像]的功能,可以显示正方形的说话者头像
  14. #     2016.08.26    简化代码,增加自动对话功能,高速跳过对话功能
  15. #     2016.11.05    增加自动调节文字位置的功能,当对话框太靠近屏幕上方或者下方
  16. #                   时,脚本会更换成另外一个显示的方向。
  17. #     2017.01.11    增加连行功能和兼容 VA 的头像组功能
  18. #==============================================================================

  19. #——说明

  20. # 使用时,要在Graphics文件夹下新建一个名为Faces的文件夹,用于存储头像
  21. # 对话框的窗口素材可不必和系统窗口相同,请将对话框窗口素材放到
  22. # Graphics/Windowskins文件夹下,并附上两个气泡箭头素材,用于指向说话者,
  23. # 命名规则为“对话框窗口素材名-top”和“对话框窗口素材名-under”
  24. # 然后在本脚本的设置区域修改。

  25. # 默认为一个字一个字的方式,如果需要一次全部显示,
  26. # 请打开特定开关(默认为 21 号)

  27. # 打开开关(默认为 22 号)后,对话时按下[空格键]可以瞬间显示全部对话。

  28. # 打卡开关(默认为 23 号)后,屏蔽加强对话框,将使用 XP 默认对话框。

  29. # 打开开关(默认为 24 号)后,对话框可以在对话显示完毕后自动消失,适合制作
  30. # 场景 CG,需要进行选择或数字输入的情况不会自动消失。此外在文本框中使用\t[数字]
  31. # 也可达到相似效果,不过作用范围仅限本次对话框。

  32. # 打开开关(默认为 25 号)后,按下 CTRL 键可以快速跳过对话,需要进行选择或者数字
  33. # 输入的情况不会跳过。

  34. # 打开开关(默认为 26 号)后,对话框的位置会自动调节,使其不会遮挡说话者
  35. # 默认对话字没有声音,如果需要声音,
  36. # 请在游戏中使用脚本:$game_system.soundname_on_speak = "这里输入文件名"
  37. # 我唯一一个见过“胡乱配音”的游戏是天使帝国2代,该游戏说话的时候每个字符随机发一个外星语音

  38. # 其他在对话中可以使用的功能:

  39. # \n[1]:显示1号角色的姓名

  40. # \name[李逍遥]:显示一个“李逍遥”方框,表示说话人姓名
  41. # \nc[0-7]:更改姓名框颜色

  42. # 非战斗时,\p功能可以自动调整对话框位置
  43. # \p[1] :对话框出现在1号事件的上方
  44. # \p[0] :主人公上方出现对话框
  45. # \p[-1]:对话框出现在屏幕下方,这种特殊类型的对话框在有大型半身像时使用
  46. #——————————————————使用\p功能后可以自动调整对话框大小
  47. # 使用\p功能后,使用事件指令[更改文章选项]可更改对话框的位置
  48. #   [上] :对话框出现在说话者上方
  49. #   [下] :对话框出现在说话者下方
  50. #   [中] :对话框出现在屏幕正中
  51. # 战斗时,\p功能有所变化
  52. # \p[1]:对话框出现在ID为1的角色战斗图附近(这个角色必须是队伍中的成员)
  53. # \p[1001]:对话框出现在Index为1的敌人战斗图附近--也就是说敌人的位置从
  54. #           1001开始算起,1002则是代表Index为2的敌人。
  55. # 战斗时使用\p指令+[更改文章选项]依然是有效的,但是如果不使用\p指令,那么
  56. # 对话框则会一直出现在屏幕正上方。

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

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

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

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

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

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

  63. # \ic[001-Weapon01] : 显示图标"001-Weapon01.png"

  64. # \c[0-7]:更改颜色

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

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

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

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

  70. # \>   :文字不用打字方式
  71. # \<   :文字使用打字方式

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

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

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

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

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

  78. # \t[20]:对话显示完毕后等待 20 帧自动消失

  79. # \L[001]:在左边显示半身像"Graphics/Faces/001.png",并左右镜像反转
  80. # \R[001]:在右边显示半身像"Graphics/Faces/001.png"
  81. # \f[001]:在左边显示正方形头像"Graphics/Faces/001.png"
  82. # 注:不推荐同时使用显示半身像的功能和显示头像的功能。显示的头像图片大小
  83. #     不得超过 120x120,如果图片超过这个大小,图片将会被放缩
  84. # \gf[001, 0]:在左边显示正方形头像组"Graphics/Faces/001.png"的第一个
  85. # 注:头像组排序方式默认如下(先数第一行,再数第二行,可调节每行的头像个数)
  86. #  -----------------
  87. #  | 0 | 1 | 2 | 3 |
  88. #  -----------------
  89. #  | 4 | 5 | 6 | 7 |
  90. #  -----------------

  91. # \+:必须放在每一行的末尾,表示连行,它将合并下一个【显示文章】指令(需要
  92. #     在下面的设置区域调节 Max_Lines 以保证文字能正常显示出来)

  93. #==============================================================================
  94. # 设置区域(其他参数的调节请看这里)
  95. #==============================================================================
  96. module RB
  97. end
  98. module RB::Mes_Config
  99.   # 打开 XX 号开关后,关闭打字效果
  100.   No_Typing = 21
  101.   # 打开 XX 号开关后,按下[空格键]可以瞬间显示全部文字
  102.   Write_Skip = 22
  103.   # 打开 XX 号开关后,屏蔽加强对话框(使用默认对话框)
  104.   Mes_Disabled = 23
  105.   # 主角名字字符缩写
  106.   Regex_Player_Name = /pn(\d+)/
  107.   # 主角姓名框底色(RGBA)
  108.   Name_Bar_Color = Color.new(120, 180, 250, 80)
  109.   # 字体大小
  110.   Size = 18
  111.   # 对话框窗口皮肤(不写为和系统皮肤相同)
  112.   Mes_Windowskin = "001-Blue01"
  113. #######  Mes_Windowskin = "001-Blue011"
  114.   # 最大行数(初值为 4,尽量不要修改,如果考虑合并选择项和连行,可以设置为 6 以上)
  115.   # 此最大行数仅在 \p 指令下有效,如果不使用 \p 指令那么对话框还是 4 行的高度
  116.   Max_Lines = 8
  117.   # 画面宽度和高度(width / height)
  118.   # 此设置一般不需要更改,当使用分辨率扩张脚本时,将如下的值改成你游戏的分辨率即可。
  119.   #Graphics_Width = 640
  120.   Graphics_Width = 590
  121. # Graphics_Height = 480
  122.   Graphics_Height = 446
  123.   # 打开 XX 号开关后,对话自动结束(不用按下 C 键)
  124.   Auto_Terminate = 24
  125.   # 打开 XX 号开关后,按下 CTRL 可以高速跳过对话
  126.   Text_Skip_Fast = 25
  127.   # 打开 XX 号开关后,自动调节对话框使其不会挡住说话者
  128.   Auto_Adjust_Mes_Pos = 26
  129.   # 对话自动结束延迟(单位:帧)
  130.   Auto_Terminate_Frame = 10
  131.   # 头像组:横向单元数
  132.   Face_Group_W = 4
  133.   # 头像组:纵向单元数
  134.   Face_Group_H = 2  
  135.   # 默认姓名文字颜色(和系统默认编号一致)
  136.   Name_Color_Default = 6
  137.   # 快捷指令,定义后,可以直接在文本框中输入快捷指令
  138.   # 定义方式为 快捷指令 => 完整指令 ,使用方式为 \sc[快捷指令]
  139.   # 注意,指令中通常包含反斜线'\',因此需要使用单引号的字符串,
  140.   # 或者用"\"进行转义。下面是一个例子:
  141.   # 这样定义后,输入\sc[pn1]就等效为 \name[pn1]\r[L1]\p[-1]
  142.   Shortcuts = {
  143.     #'pn1' => '\name[pn1]\r[L1]\p[-1]'
  144.   }
  145.   # 高级快捷指令定义,类似于宏展开,需要借助正则表达式(高级用户使用)
  146.   Shortcuts_Regexp = {
  147.     /\\pn1/ => '\name[pn1]\r[L1]\p[-1]',
  148.     /\\[Rr]ed\[(.*?)\]/m => '\c[2]\1\c[0]',
  149.     /\\[Cc]ol\[(\d+)\]\{(.*?)\}/m => '\c[\1]\2\c[0]',
  150.   }
  151. end
  152. #==============================================================================
  153. # RPG::Cache
  154. #------------------------------------------------------------------------------
  155. # RPG::Cache 追加定义
  156. #==============================================================================
  157. module RPG::Cache
  158.   def self.face(filename)
  159.     self.load_bitmap("Graphics/Faces/", filename)
  160.   end
  161. end

  162. #==============================================================================
  163. # ■ Game_System
  164. #------------------------------------------------------------------------------
  165. #  处理系统附属数据的类。也可执行诸如 BGM 管理之类的功能。本类的实例请参考
  166. # $game_system 。
  167. #==============================================================================

  168. class Game_System
  169.   attr_accessor :soundname_on_speak
  170.   alias carol3_ini initialize
  171.   def initialize
  172.     carol3_ini
  173.     @soundname_on_speak = nil
  174.   end
  175. end

  176. #==============================================================================
  177. # ■ Window_Message
  178. #------------------------------------------------------------------------------
  179. #   修改的对话框类。
  180. #==============================================================================
  181. class Window_Message_RB < Window_Selectable
  182.   include RB::Mes_Config
  183.   #--------------------------------------------------------------------------
  184.   # ● 初始化状态
  185.   #--------------------------------------------------------------------------
  186.   def initialize
  187.     super(80, 304, 480, 160)
  188. #    super(180, 304, 180, 160)
  189.     self.contents = Bitmap.new(1, 1)
  190.     self.visible = false
  191.     self.z = 9998
  192.     @fade_in = false
  193.     @fade_out = false
  194.     @contents_showing = false
  195.     @write_skip = false
  196.     @text_skip = false
  197.     @cursor_width = 0
  198.     @face_h = 0
  199.     self.active = false
  200.     self.index = -1
  201.     if $game_system.soundname_on_speak == nil then
  202.       $game_system.soundname_on_speak = ""
  203.     end
  204.     self.windowskin = RPG::Cache.windowskin(Mes_Windowskin) if Mes_Windowskin != ""
  205.     @opacity_text_buf = Bitmap.new(32, 32)
  206.   end
  207.   #--------------------------------------------------------------------------
  208.   # ● 释放
  209.   #--------------------------------------------------------------------------
  210.   def dispose
  211.     terminate_message
  212.     $game_temp.message_window_showing = false
  213.     if @input_number_window != nil
  214.       @input_number_window.dispose
  215.     end
  216.     super
  217.   end
  218.   #--------------------------------------------------------------------------
  219.   # ● 处理信息结束
  220.   #--------------------------------------------------------------------------
  221.   def terminate_message
  222.     self.active = false
  223.     self.pause = false
  224.     self.index = -1
  225.     self.contents.clear
  226.     # 清除显示中标志
  227.     @contents_showing = false
  228.     # 呼叫信息调用
  229.     if $game_temp.message_proc != nil
  230.       $game_temp.message_proc.call
  231.     end
  232.     # 清除文章、选择项、输入数值的相关变量
  233.     $game_temp.message_text = nil
  234.     $game_temp.message_proc = nil
  235.     $game_temp.choice_start = 99
  236.     $game_temp.choice_max = 0
  237.     $game_temp.choice_cancel_type = 0
  238.     $game_temp.choice_proc = nil
  239.     $game_temp.num_input_start = 99
  240.     $game_temp.num_input_variable_id = 0
  241.     $game_temp.num_input_digits_max = 0
  242.     # 清除头像(由于是 RPG::Cache 所以无需释放)
  243.     @face_bitmap = nil
  244.     @face_group_bitmap = nil
  245.     @face_ok = false
  246.     # 清除跳过标志
  247.     @write_skip = false
  248.     @text_skip = false
  249.     # 释放金钱窗口
  250.     if @gold_window != nil
  251.       @gold_window.dispose
  252.       @gold_window = nil
  253.     end
  254.     # 释放姓名窗口
  255.     if @name_window_text != nil
  256.       @name_window_text.dispose
  257.       @name_window_text = nil
  258.     end
  259.     # 释放右侧立绘
  260.     if @right_picture != nil
  261.       @right_picture.dispose
  262.       @right_picture = nil
  263.     end   
  264.     # 释放左侧立绘
  265.     if @left_picture != nil
  266.       @left_picture.dispose
  267.       @left_picture = nil
  268.     end
  269.     # 释放姓名蓝条
  270.     if @bar != nil
  271.       @bar.bitmap.dispose
  272.       @bar.dispose
  273.       @bar = nil
  274.     end
  275.     # 释放气泡图标
  276.     if @k_tale != nil
  277.       @k_tale.dispose
  278.       @k_tale = nil
  279.     end
  280.   end
  281.   #--------------------------------------------------------------------------
  282.   # ● 刷新
  283.   #--------------------------------------------------------------------------
  284.   def refresh
  285.     # 初期化
  286.     @x = @y = @max_x = @max_y = @indent = @lines = 0
  287.     @face_indent = 0
  288.     @opacity = 255
  289.     @cursor_width = 0
  290.     @write_speed = 0
  291.     @write_wait = 0
  292.     @mid_stop = false
  293.     @popchar = -2
  294.     @auto_terminate = -1
  295.     if $game_temp.choice_start == 0
  296.       @x = 8
  297.     end
  298.     if $game_temp.message_text != nil
  299.       @now_text = $game_temp.message_text
  300.       # Shortcuts 预处理
  301.       @now_text.gsub!(/\\sc\[(.*?)\]/) { Shortcuts[$1] || "" }
  302.       # Shortcuts_Regexp 预处理
  303.       Shortcuts_Regexp.each_pair do |regex, str|
  304.         @now_text.gsub!(regex, str)
  305.       end
  306.       # 头像设置
  307.       if (/\\[Ff]\[(.+?)\]/.match(@now_text)) != nil
  308.         @face_bitmap = RPG::Cache.face($1)
  309.         @x = @face_indent = [128, @face_bitmap.width + 4].min
  310.         @now_text.gsub!(/\\[Ff]\[(.+?)\]/) { "" }
  311.       end
  312.       # 头像组设置
  313.       if (/\\[Gg]f\[(.+?)\s*,\s*(\d+)\]/).match(@now_text) != nil
  314.         @face_group_bitmap = RPG::Cache.face($1)
  315.         idx = $2.to_i
  316.         ix, iy = idx % Face_Group_W, idx / Face_Group_W
  317.         w, h = @face_group_bitmap.width / Face_Group_W, @face_group_bitmap.height / Face_Group_H
  318.         @face_bitmap = Bitmap.new(w, h)
  319.         @face_bitmap.blt(0, 0, @face_group_bitmap, Rect.new(ix * w, iy * h, w, h))
  320.         @x = @face_indent = [128, @face_bitmap.width + 4].min
  321.         @now_text.gsub!(/\\[Gg]f\[(.+?)\s*,\s*(\d+)\]/) { "" }
  322.       end
  323.       #——左半身像设置
  324.       if (/\\[Ll]\[(.+?)\]/.match(@now_text)) != nil then
  325.         @face = $1
  326.         if @left_picture != nil
  327.           @left_picture.dispose
  328.         end
  329.         @left_picture = Sprite.new
  330.         @left_picture.bitmap = RPG::Cache.face(@face)
  331.         @left_picture.mirror = true
  332.         @x = @face_indent = @left_picture.bitmap.width
  333.         @now_text.gsub!(/\\[Ll]\[(.*?)\]/) { "" }
  334.       end
  335.       #——右半身像设置
  336.       if (/\\[Rr]\[(.+?)\]/.match(@now_text)) != nil then
  337.         @face = $1
  338.         if @right_picture != nil
  339.           @right_picture.dispose
  340.         end
  341.         @right_picture = Sprite.new
  342.         @right_picture.bitmap = RPG::Cache.face(@face)
  343.         @now_text.gsub!(/\\[Rr]\[(.*?)\]/) { "" }
  344.       end
  345.       # 显示人物姓名
  346.       name_window_set = false
  347.       if (/\\[Nn]ame\[(.+?)\]/.match(@now_text)) != nil
  348.         name_window_set = true
  349.         name_text = $1
  350.         if Regex_Player_Name =~ name_text
  351.           name_text = $game_actors[$1.to_i].name
  352.         end
  353.         @now_text.sub!(/\\[Nn]ame\[(.*?)\]/) { "" }
  354.       end
  355.       # 人物姓名颜色
  356.       name_color = text_color(Name_Color_Default)
  357.       if (/\\[Nn]c\[(\d+)\]/.match(@now_text)) != nil
  358.         name_color = text_color($1.to_i)
  359.         @now_text.sub!(/\\[Nn]c\[(\d+)\]/) { "" }
  360.       end
  361.       # 文字位置的判定
  362.       if (/\\[Pp]\[([-1,0-9]+)\]/.match(@now_text)) != nil then
  363.         @popchar = $1.to_i
  364.         @now_text.gsub!(/\\[Pp]\[([-1,0-9]+)\]/) { "" }
  365.       end
  366.       # 自动结束判定
  367.       @auto_terminate = Auto_Terminate_Frame if $game_switches[Auto_Terminate]
  368.       if (/\\[Tt]\[(\d+)\]/).match(@now_text)
  369.         @auto_terminate = $1.to_i
  370.         @now_text.gsub!(/\\[Tt]\[(\d+)\]/) { "" }
  371.       end
  372.       # 开始替换文字(\v)
  373.       begin
  374.         last_text = @now_text.clone
  375.         @now_text.gsub!(/\\[Vv]\[([IiWwAaSs]?)([0-9]+)\]/) { convart_value($1, $2.to_i) }
  376.       end until @now_text == last_text
  377.       # 替换控制码
  378.       @now_text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  379.         $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  380.       end
  381.       @now_text.gsub!(/\\\\/) { "\000" }
  382.       @now_text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
  383.       @now_text.gsub!(/\\[Gg]/) { "\002" }
  384.       @now_text.gsub!(/\\[Ss]\[([0-9]+)\]/) { "\003[#{$1}]" }
  385.       @now_text.gsub!(/\\[Aa]\[(.*?)\]/) { "\004[#{$1}]" }
  386.       @now_text.gsub!(/\\[.]/) { "\005" }
  387.       @now_text.gsub!(/\\[|]/) { "\006" }
  388.       @now_text.gsub!(/\\[Ii]c\[(.*?)\]/) { "\030[#{$1}] "}
  389.       @now_text.gsub!(/\\[>]/) { "\016" }
  390.       @now_text.gsub!(/\\[<]/) { "\017" }
  391.       @now_text.gsub!(/\\[!]/) { "\020" }
  392.       @now_text.gsub!(/\\[~]/) { "\021" }
  393.       @now_text.gsub!(/\\[Ii]/) { "\023" }
  394.       @now_text.gsub!(/\\[Oo]\[([0-9]+)\]/) { "\024[#{$1}]" }
  395.       @now_text.gsub!(/\\[Hh]\[([0-9]+)\]/) { "\025[#{$1}]" }
  396.       @now_text.gsub!(/\\[Bb]\[([0-9]+)\]/) { "\026[#{$1}]" }
  397.       # 根据 \p 的不同设置对话框大小
  398.       if @popchar >= 0 # \p 的情况下自动调节
  399.         @text_save = @now_text.clone
  400.         process_real_text
  401.         @max_x = name_window_set ? contents.text_size(name_text).width : 0
  402.         @max_y = Max_Lines
  403.         for i in 0...Max_Lines
  404.           line = @text_save.split(/\n/)[Max_Lines-i-1]
  405.           @max_y -= 1 if line == nil && @max_y <= Max_Lines - i
  406.           next if line == nil
  407.           contents.font.size = Size
  408.           cx = contents.text_size(line).width
  409.           @max_x = cx if cx > @max_x
  410.         end
  411.         if @right_picture != nil && !@right_picture.disposed?
  412.           self.width = @max_x + 48 + @face_indent + @right_picture.bitmap.width
  413.         else
  414.           self.width = @max_x + 48 + @face_indent
  415.         end
  416.         @face_h = @face_bitmap == nil ? 0 : [120, @face_bitmap.height].min
  417.         if $game_temp.num_input_variable_id > 0
  418.           self.height = [(@max_y - 1) * line_height + 96, @face_h + 32].max
  419.         else
  420.           self.height = [(@max_y - 1) * line_height + 64, @face_h + 32].max
  421.       end

  422.         # 生成气泡图标
  423.         @k_tale = Sprite.new
  424.       elsif @popchar == -1
  425.         line_count = @now_text.split(/\n/).size
  426.         line_count = [Max_Lines , [line_count, 4].max].min
  427.         self.width = Graphics_Width
  428.         self.height = [64 + line_height * (line_count - 1), @face_h + 32].max
  429.         @max_x = self.width - 32 - @face_indent
  430.       else
  431.         self.width = Graphics_Width * 0.6
  432.         self.height = 64 + line_height * 3
  433.         @max_x = self.width - 32 - @face_indent
  434.       end
  435.       # 如果设置了姓名框
  436.       if name_window_set
  437.         off_x = 0
  438.         off_y = -40
  439.         space = 2
  440.         x = self.x + off_x - space / 2
  441.         y = self.y + off_y - space / 2
  442.         w = self.contents.text_size(name_text).width + 26 + space
  443.         h = 40 + space
  444.         x = self.x + off_x + 4
  445.         y = self.y + off_y
  446.         @name_window_text = Air_Text.new(self.x + @face_indent+4+8, self.y+16, name_text, name_color)
  447.         @name_window_text.z = self.z + 2
  448.         @bar = Sprite.new
  449.         @bar.bitmap = Bitmap.new(self.width, 24)
  450.         face_cut = @face_bitmap == nil ? 0 : @face_indent + 2
  451.         @bar.x = self.x + 8 + face_cut
  452.         @bar.y = self.y + 16
  453.         @bar.z = self.z + 2
  454.         @bar.bitmap.fill_rect(0,0,self.width-16-face_cut,24, Name_Bar_Color)
  455.       end
  456.       # 一切设置完毕后,创建 contents
  457.       if self.contents != nil
  458.         self.contents.dispose
  459.         self.contents = nil
  460.       end
  461.       self.contents = Bitmap.new(width - 32, height - 32)
  462.       self.contents.font.color = normal_color
  463.       self.contents.font.size = Size
  464.     end
  465.     # 如果选择项被设置
  466.     if $game_temp.choice_max > 0
  467.       @item_max = $game_temp.choice_max
  468.       self.active = true
  469.       self.index = 0
  470.     end
  471.     # 如果数值输入被设置
  472.     if $game_temp.num_input_variable_id > 0
  473.       digits_max = $game_temp.num_input_digits_max
  474.       number = $game_variables[$game_temp.num_input_variable_id]
  475.       @input_number_window = Window_InputNumber.new(digits_max)
  476.       @input_number_window.number = number
  477.     end
  478.     # 更新窗口位置
  479.     update_window_pos
  480.   end
  481.   #--------------------------------------------------------------------------
  482.   # ● 更新
  483.   #--------------------------------------------------------------------------
  484.   def update
  485.     super
  486.     # 使用默认窗口外观的情况下,如果窗口的外关被变更了、再设置
  487.     if $game_system.windowskin_name != @windowskin_name && Mes_Windowskin == ""
  488.       @windowskin_name = $game_system.windowskin_name
  489.       self.windowskin = RPG::Cache.windowskin(@windowskin_name)
  490.     end
  491.     # 地图中实时更新位置
  492.     if @k_tale != nil && @k_tale.visible && !$game_temp.in_battle
  493.       update_window_pos
  494.     end
  495.     # [空格键]跳过描绘
  496.     if $game_switches[Write_Skip] && Input.trigger?(Input::C)
  497.       @write_skip = true
  498.     end
  499.     # CTRL 高速跳过对话
  500.     if $game_switches[Text_Skip_Fast] && Input.trigger?(Input::CTRL)
  501.       # 选择项或数字输入时无法高速跳过
  502.       if $game_temp.choice_max > 0 || @input_number_window != nil
  503.         @write_skip = true
  504.       else
  505.         @text_skip = true
  506.       end
  507.     end
  508.     # 描绘头像
  509.     if @face_bitmap != nil && !@face_ok
  510.       face_real_w = [120, @face_bitmap.width].min
  511.       face_real_h = [120, @face_bitmap.height].min
  512.       self.contents.stretch_blt(Rect.new(0, 0, face_real_w, face_real_h), @face_bitmap, Rect.new(0, 0, @face_bitmap.width, @face_bitmap.height))
  513.       @face_ok = true
  514.     end
  515.     # 淡入中的情况下
  516.     if @fade_in
  517.       self.contents_opacity += 24
  518.       if @input_number_window != nil
  519.         @input_number_window.contents_opacity += 24
  520.       end
  521.       if self.contents_opacity == 255
  522.         @fade_in = false
  523.       end
  524.       return
  525.     end
  526.     @now_text = nil if @now_text == ""
  527.     # 逐个描绘文字
  528.     if @now_text != nil && @mid_stop == false && !@text_skip
  529.       if @write_wait > 0
  530.         @write_wait -= 1
  531.         return
  532.       end
  533.       while true
  534.         @max_x = @x if @max_x < @x
  535.         @max_y = @y if @max_y < @y
  536.         # 处理字符
  537.         if (c = @now_text.slice!(/./m)) != nil
  538.           # \\的情况下
  539.           if c == "\000"
  540.             c = "\"
  541.           end
  542.           # \c的情况下
  543.           if c == "\001"
  544.             @now_text.sub!(/\[([0-9]+)\]/, "")
  545.             color = $1.to_i
  546.             if color >= 0 and color <= 7
  547.               self.contents.font.color = text_color(color)
  548.             end
  549.             c = ""
  550.           end
  551.           # \g的情况下
  552.           if c == "\002"
  553.             if @gold_window == nil && @popchar <= 0
  554.               @gold_window = Window_Gold.new
  555.               @gold_window.x = 560 - @gold_window.width
  556.               if $game_temp.in_battle
  557.                 @gold_window.y = 192
  558.               else
  559.                 @gold_window.y = self.y >= 128 ? 32 : 384
  560.               end
  561.               @gold_window.opacity = self.opacity
  562.               @gold_window.back_opacity = self.back_opacity
  563.             end
  564.             c = ""
  565.           end
  566.           # \s的情况下
  567.           if c == "\003"
  568.             @now_text.sub!(/\[([0-9]+)\]/, "")
  569.             speed = $1.to_i
  570.             if speed >= 0 and speed <= 19
  571.               @write_speed = speed
  572.             end
  573.             c = ""
  574.           end
  575.           # \a的情况下
  576.           if c == "\004"
  577.             @now_text.sub!(/\[(.*?)\]/, "")
  578.             se_filename = "Audio/SE/#{$1}"
  579.             if FileTest.exist?(se_filename)
  580.               Audio.se_play(se_filename)
  581.             end
  582.             c = ""
  583.           end
  584.           # \.的情况下
  585.           if c == "\005"
  586.             @write_wait += 5
  587.             c = ""
  588.           end
  589.           # \|的情况下
  590.           if c == "\006"
  591.             @write_wait += 20
  592.             c = ""
  593.           end
  594.           # \>的情况下
  595.           if c == "\016"
  596.             text_not_skip = false
  597.             c = ""
  598.           end
  599.           # \<的情况下
  600.           if c == "\017"
  601.             text_not_skip = true
  602.             c = ""
  603.           end
  604.           # \!的情况下
  605.           if c == "\020"
  606.             @mid_stop = true
  607.             c = ""
  608.           end
  609.           # \~的情况下
  610.           if c == "\021"
  611.             terminate_message
  612.             return
  613.           end
  614.           # \i的情况下
  615.           if c == "\023"
  616.             @indent = @x
  617.             c = ""
  618.           end
  619.           # \o的情况下
  620.           if c == "\024"
  621.             @now_text.sub!(/\[([0-9]+)\]/, "")
  622.             @opacity = $1.to_i
  623.             c = ""
  624.           end
  625.           # \h的情况下
  626.           if c == "\025"
  627.             @now_text.sub!(/\[([0-9]+)\]/, "")
  628.             self.contents.font.size = [[$1.to_i, 6].max, 32].min
  629.             c = ""
  630.           end
  631.           # \b的情况下
  632.           if c == "\026"
  633.             @now_text.sub!(/\[([0-9]+)\]/, "")
  634.             @x += $1.to_i
  635.             c = ""
  636.           end
  637.           # 图标的情况
  638.           if c == "\030"
  639.             @now_text.sub!(/\[(.*?)\]/, "")
  640.             self.contents.blt(@x , @y * line_height + (line_height - 24) / 2, RPG::Cache.icon($1), Rect.new(0, 0, 24, 24))
  641.             if $game_system.soundname_on_speak != ""
  642.               Audio.se_play($game_system.soundname_on_speak)
  643.             end
  644.             @x += 24
  645.             c = ""
  646.           end
  647.           # 另起一行的情况下
  648.           if c == "\n"
  649.             if @lines >= $game_temp.choice_start
  650.               @cursor_width = [@cursor_width, @max_x - @face_indent].max
  651.             end
  652.             @lines += 1
  653.             @y += 1
  654.             @x = 0 + @indent + @face_indent
  655.             if @lines >= $game_temp.choice_start
  656.               @x = 8 + @indent + @face_indent
  657.             end
  658.             c = ""
  659.           end
  660.           if c != ""
  661.             # 文字描画
  662.             @x += opacity_draw_text(self.contents, @x, @y * line_height + (line_height - self.contents.font.size) / 2, c, @opacity)
  663.             if $game_system.soundname_on_speak != "" then
  664.               Audio.se_play($game_system.soundname_on_speak)
  665.             end
  666.           end
  667.         else
  668.           break
  669.         end
  670.         if !$game_switches[No_Typing] && !@write_skip
  671.           break
  672.         end
  673.       end
  674.       @write_wait += @write_speed
  675.       return
  676.     end
  677.     # 数值输入的处理
  678.     if @input_number_window != nil
  679.       @input_number_window.update
  680.       # 确认
  681.       if Input.trigger?(Input::C)
  682.         $game_system.se_play($data_system.decision_se)
  683.         $game_variables[$game_temp.num_input_variable_id] =
  684.           @input_number_window.number
  685.         $game_map.need_refresh = true
  686.         @input_number_window.dispose
  687.         @input_number_window = nil
  688.         terminate_message
  689.       end
  690.       return
  691.     end
  692.     # 跳过对话
  693.     if @text_skip
  694.       @now_text = nil
  695.       terminate_message
  696.       return
  697.     end
  698.     # 文章显示中的情况下
  699.     if @contents_showing
  700.       if $game_temp.choice_max == 0
  701.         self.pause = true
  702.       end
  703.       # auto terminate
  704.       if $game_temp.choice_max == 0 && @auto_terminate > 0
  705.         @auto_terminate -= 1
  706.         if @auto_terminate == 0
  707.           terminate_message
  708.         end
  709.         return
  710.       end
  711.       # 取消
  712.       if Input.trigger?(Input::B)
  713.         if $game_temp.choice_max > 0 && $game_temp.choice_cancel_type > 0
  714.           $game_system.se_play($data_system.cancel_se)
  715.           $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)
  716.           terminate_message
  717.         end
  718.       end
  719.       # 确定
  720.       if Input.trigger?(Input::C)
  721.         if @mid_stop
  722.           @mid_stop = false
  723.           return
  724.         else
  725.           if $game_temp.choice_max > 0
  726.             $game_system.se_play($data_system.decision_se)
  727.             $game_temp.choice_proc.call(self.index)
  728.           end
  729.           terminate_message
  730.         end
  731.       end
  732.       return
  733.     end
  734.     if @fade_out == false and $game_temp.message_text != nil
  735.       @contents_showing = true
  736.       $game_temp.message_window_showing = true
  737.       refresh
  738.       Graphics.frame_reset
  739.       self.visible = true
  740.       self.contents_opacity = 0
  741.       if @input_number_window != nil
  742.         @input_number_window.contents_opacity = 0
  743.       end
  744.       @fade_in = true
  745.       return
  746.     end
  747.     if self.visible
  748.       @fade_out = true
  749.       self.opacity -= 48
  750.       if self.opacity == 0
  751.         self.visible = false
  752.         @fade_out = false
  753.         $game_temp.message_window_showing = false
  754.       end
  755.       return
  756.     end
  757.   end
  758.   #--------------------------------------------------------------------------
  759.   # ● 预览实际描绘内容(计算窗口宽用)
  760.   #--------------------------------------------------------------------------
  761.   #    实际对 @text_save 进行操作
  762.   #    此方法用于去除某些控制码引起窗口过长的影响
  763.   #--------------------------------------------------------------------------
  764.   def process_real_text
  765.     return if @text_save.nil?
  766.     regex = /[\001-\006\016\017\020\021\024](\[.*?\]){0,1}/
  767.     regex30 = /\030\[.*?\]/
  768.     @text_save.gsub!(regex, "")
  769.     @text_save.gsub!(regex30, "   ")
  770.   end
  771.   #--------------------------------------------------------------------------
  772.   # ● 获得角色(\p功能)
  773.   #--------------------------------------------------------------------------
  774.   def get_character(parameter)
  775.     case parameter
  776.     when 0
  777.       return $game_player
  778.     else
  779.       events = $game_map.events
  780.       return events == nil ? nil : events[parameter]
  781.     end
  782.   end
  783.   #--------------------------------------------------------------------------
  784.   # ● 获得战斗者(\p功能,此功能仅在战斗中有效)
  785.   #--------------------------------------------------------------------------
  786.   #    parameter : 1-999 表示主角 ID,1001-1008 表示索引为1-8的各个敌人
  787.   #--------------------------------------------------------------------------
  788.   def get_battler(parameter)
  789.     if parameter < 1000
  790.       return $game_actors[parameter]
  791.     else
  792.       return $game_troop.enemies[parameter - 1001]
  793.     end
  794.   end
  795.   #--------------------------------------------------------------------------
  796.   # ● 计算 y 偏移量(\p功能,这是考虑到不同战斗图/行走图的高度不同)
  797.   #--------------------------------------------------------------------------
  798.   #    character : 角色/战斗者
  799.   #--------------------------------------------------------------------------
  800.   def process_y_shift(character)
  801.     rate = character.is_a?(Game_Battler) ? 1 : 4
  802.     bmp = character.is_a?(Game_Battler) ?
  803.       RPG::Cache.battler(character.battler_name, character.battler_hue) :
  804.       RPG::Cache.character(character.character_name, character.character_hue)
  805.     return bmp.height / rate + 16
  806.   end
  807.   #--------------------------------------------------------------------------
  808.   # ● 更新窗口位置(所有组件)
  809.   #--------------------------------------------------------------------------
  810.   def update_window_pos
  811.     # 如果使用了 \p 设置位置
  812.     if @popchar >= 0
  813.       character = $game_temp.in_battle ? get_battler(@popchar) : get_character(@popchar)
  814.       final_pos = $game_system.message_position
  815.       if character != nil
  816.         x = [[character.screen_x - self.width / 2, 4].max, Graphics_Width - 4 - self.width].min
  817.         # adjust final_pos automatically when it is enabled
  818.         # ignore the case when pos == 1
  819.         if $game_switches[Auto_Adjust_Mes_Pos] && final_pos != 1
  820.           # try default mes_pos first
  821.           temp_y = final_pos == 2 ? [character.screen_y + 16, 4].max :
  822.             character.screen_y - process_y_shift(character) - self.height
  823.          
  824.           # set pos == 0 if temp_y exceeds the boundary of the screen
  825.           final_pos = 0 if temp_y > Graphics_Height - 4 - self.height && final_pos == 2
  826.           final_pos = 2 if temp_y < 4 && final_pos == 0
  827.         end
  828.         if final_pos == 2
  829.           y = [[character.screen_y + 16, 4].max, Graphics_Height - 4 - self.height].min
  830.         elsif final_pos == 0
  831.           y = [[character.screen_y - process_y_shift(character) - self.height, 4].max, Graphics_Height - 4 - self.height].min
  832.         else
  833.           x = (Graphics_Width - self.width) / 2
  834.           y = (Graphics_Height - self.height) / 2
  835.         end
  836.         self.x = x
  837.         self.y = y
  838.         # 设置气泡图标
  839.         if @k_tale != nil
  840.           @k_tale.x = character.is_a?(Game_Character) ?
  841.             ( character.real_x - $game_map.display_x + 64 ) * 32 / 128 - 16 :
  842.             character.screen_x
  843.           k_tale_filename = Mes_Windowskin == "" ? $game_system.windowskin_name : Mes_Windowskin
  844.           suffix = final_pos == 2 ? "-under" : "-top"
  845.           # reload @k_tale's bitmap
  846.           @k_tale.bitmap = RPG::Cache.windowskin(k_tale_filename + suffix)
  847.           if final_pos == 2
  848.             @k_tale.y = self.y - 16
  849.           elsif final_pos == 0
  850.             @k_tale.y = self.y + self.height - 16
  851.           else
  852.             @k_tale.visible = false
  853.           end
  854.           @k_tale.z = 9999
  855.         end
  856.       end
  857.     elsif @popchar == -1
  858.      # self.x = 0
  859.      # self.y = Graphics_Height - self.height
  860.       self.x = 26
  861.       self.y = Graphics_Height - self.height
  862.       self.width = 590

  863.     else # 无 \p 的情况下
  864.       self.x = (Graphics_Width - self.width) / 2
  865.       # 处于战斗中时
  866.       if $game_temp.in_battle
  867.         self.y = 16
  868.       else
  869.         # 显示文章位置的分支
  870.         case $game_system.message_position
  871.         when 0 # 上
  872.           self.y = 16
  873.         when 1 # 中
  874.           self.y = (Graphics_Height - self.height) / 2
  875.         when 2 # 下
  876.           self.y = (Graphics_Height - self.height - 16)
  877.         end
  878.       end
  879.     end # of @popchar >= 0
  880.     # 设置左侧立绘
  881.     if @left_picture != nil and !@left_picture.disposed?
  882.       @left_picture.x = self.x + 8
  883.       @left_picture.y = self.y - @left_picture.bitmap.height + self.height - 8
  884.       @left_picture.z = self.z + 4
  885.     end
  886.     # 设置右侧立绘
  887.     if @right_picture != nil and !@right_picture.disposed?
  888.       @right_picture.x = self.x + self.width - @right_picture.bitmap.width - 8
  889.       @right_picture.y = self.y - @right_picture.bitmap.height + self.height - 8
  890.       @right_picture.z = self.z + 4
  891.     end
  892.     # 设置姓名空气文字坐标
  893.     if @name_window_text != nil
  894.       @name_window_text.x = self.x + @face_indent - 4
  895.       @name_window_text.y = self.y
  896.     end
  897.     # 设置姓名蓝条坐标
  898.     if @bar != nil
  899.       face_cut = @face_bitmap == nil ? 0 : @face_indent + 2
  900.       @bar.x = self.x + 8 + face_cut
  901.       @bar.y = self.y + 16
  902.     end
  903.     # 设置数字处理
  904.     if @input_number_window != nil
  905.       @input_number_window.x = self.x + @face_indent
  906.       @input_number_window.y = self.y + 8 + $game_temp.num_input_start * line_height
  907.     end
  908.     # 设置不透明度
  909.     if $game_system.message_frame == 0
  910.       self.opacity = 255
  911.       self.back_opacity = 200
  912.     else
  913.       self.opacity = 0
  914.       self.back_opacity = 200
  915.     end
  916.   end
  917.   #--------------------------------------------------------------------------
  918.   # ● line_height
  919.   #--------------------------------------------------------------------------
  920.   # 返回值 : 行高
  921.   #--------------------------------------------------------------------------
  922.   def line_height
  923.     return [[Size * 15 / 10, 18].max, 32].min
  924.   end
  925.   #--------------------------------------------------------------------------
  926.   # ● 文字描画
  927.   #--------------------------------------------------------------------------
  928.   # target :描绘的目标 bitmap 对象
  929.   # x      :x 坐标
  930.   # y      :y 坐标
  931.   # str   :描绘的文字
  932.   # opacity:不透明度(0~255)
  933.   # 返回值 :文字宽度(@x 的增加值)。
  934.   #--------------------------------------------------------------------------
  935.   def opacity_draw_text(target, x, y, str,opacity)
  936.     height = target.font.size
  937.     width = target.text_size(str).width
  938.     opacity = [[opacity, 0].max, 255].min
  939.     if opacity == 255
  940.       target.draw_text(x, y, width, height, str)
  941.       return width
  942.     else
  943.       if @opacity_text_buf.width < width or @opacity_text_buf.height < height
  944.         @opacity_text_buf.dispose
  945.         @opacity_text_buf = Bitmap.new(width, height)
  946.       else
  947.         @opacity_text_buf.clear
  948.       end
  949.       @opacity_text_buf.font.size = target.font.size
  950.       @opacity_text_buf.draw_text(0, 0, width, height, str)
  951.       target.blt(x, y, @opacity_text_buf, Rect.new(0, 0, width, height), opacity)
  952.     return width
  953.     end
  954.   end
  955.   #--------------------------------------------------------------------------
  956.   # ● \V 变换
  957.   #--------------------------------------------------------------------------
  958.   # option : 选项,'i'物品,'w'武器,'a'防具,'s'技能
  959.   # index  : 数据库的索引
  960.   #--------------------------------------------------------------------------
  961.   def convart_value(option, index)
  962.     option == nil ? option = "" : nil
  963.     option.downcase!
  964.     case option
  965.       when "i"
  966.         unless $data_items[index].name == nil
  967.           r = sprintf("\030[%s]%s", $data_items[index].icon_name, $data_items[index].name)
  968.         end
  969.       when "w"
  970.         unless $data_weapons[index].name == nil
  971.           r = sprintf("\030[%s]%s", $data_weapons[index].icon_name, $data_weapons[index].name)
  972.         end
  973.       when "a"
  974.         unless $data_armors[index].name == nil
  975.           r = sprintf("\030[%s]%s", $data_armors[index].icon_name, $data_armors[index].name)
  976.         end
  977.       when "s"
  978.         unless $data_skills[index].name == nil
  979.           r = sprintf("\030[%s]%s", $data_skills[index].icon_name, $data_skills[index].name)
  980.         end
  981.       else
  982.       r = $game_variables[index]
  983.     end
  984.     r == nil ? r = "" : nil
  985.     return r
  986.   end
  987.   #--------------------------------------------------------------------------
  988.   # ● 释放
  989.   #--------------------------------------------------------------------------
  990.   def dispose
  991.     terminate_message
  992.     unless @opacity_text_buf.disposed?
  993.       @opacity_text_buf.dispose
  994.     end
  995.     $game_temp.message_window_showing = false
  996.     if @input_number_window != nil
  997.       @input_number_window.dispose
  998.     end
  999.     super
  1000.   end
  1001.   #--------------------------------------------------------------------------
  1002.   # ● 刷新光标矩形
  1003.   #--------------------------------------------------------------------------
  1004.   def update_cursor_rect
  1005.     if @index >= 0
  1006.       n = $game_temp.choice_start + @index
  1007.       self.cursor_rect.set(4 + @indent + @face_indent, n * line_height, @cursor_width, line_height)
  1008.     else
  1009.       self.cursor_rect.empty
  1010.     end
  1011.   end
  1012. end
  1013. #==============================================================================
  1014. # ■ Air_Text
  1015. #------------------------------------------------------------------------------
  1016. #   空气文字,借助窗口显示文字,但是不显示窗口载体。
  1017. #==============================================================================
  1018. class Air_Text < Window_Base
  1019.   #--------------------------------------------------------------------------
  1020.   # ● 对象初始化
  1021.   #--------------------------------------------------------------------------
  1022.   def initialize(x, y, designate_text, color)
  1023.     super(x-16, y-16, 32 + designate_text.size * 12, 56)
  1024.     self.opacity = 0
  1025.     self.back_opacity = 0
  1026.     self.contents = Bitmap.new(self.width - 32, self.height - 32)
  1027.     self.contents.font.size = 20
  1028.     self.contents.font.color = color
  1029.     w = self.contents.width
  1030.     h = self.contents.height
  1031.     self.contents.draw_text(0, 0, w, h, designate_text)
  1032.   end
  1033.   #--------------------------------------------------------------------------
  1034.   # ● 释放
  1035.   #--------------------------------------------------------------------------
  1036.   def dispose
  1037.     self.contents.clear
  1038.     super
  1039.   end
  1040. end

  1041. class Interpreter
  1042.   include RB::Mes_Config
  1043.   #--------------------------------------------------------------------------
  1044.   # ● 显示文章
  1045.   #--------------------------------------------------------------------------
  1046.   def command_101
  1047.     # 另外的文章已经设置过 message_text 的情况下
  1048.     if $game_temp.message_text != nil
  1049.       # 结束
  1050.       return false
  1051.     end
  1052.     # 设置信息结束后待机和返回调用标志
  1053.     @message_waiting = true
  1054.     $game_temp.message_proc = Proc.new { @message_waiting = false }
  1055.     # message_text 设置为 1 行
  1056.     # check whether \+ exists
  1057.     append = /\\\+$/ =~ @list[@index].parameters[0]
  1058.     line = @list[@index].parameters[0].sub(/\\\+$/, "")
  1059.     $game_temp.message_text = line + "\n"
  1060.     line_count = 1
  1061.     # 循环
  1062.     loop do
  1063.       # 下一个事件指令为文章两行以上的情况
  1064.       if @list[@index+1].code == 401 || @list[@index+1].code == 101 && append
  1065.         append = /\\\+$/ =~ @list[@index+1].parameters[0]
  1066.         line = @list[@index+1].parameters[0].sub(/\\\+$/, "")
  1067.         # message_text 添加到第 2 行以下
  1068.         $game_temp.message_text += line + "\n"
  1069.         line_count += 1
  1070.       # 事件指令不在文章两行以下的情况
  1071.       else
  1072.         # 下一个事件指令为显示选择项的情况下
  1073.         if @list[@index+1].code == 102
  1074.           # 如果选择项能收纳在画面里
  1075.           if @list[@index+1].parameters[0].size <= Max_Lines - line_count
  1076.             # 推进索引
  1077.             @index += 1
  1078.             # 设置选择项
  1079.             $game_temp.choice_start = line_count
  1080.             setup_choices(@list[@index].parameters)
  1081.           end
  1082.         # 下一个事件指令为处理输入数值的情况下
  1083.         elsif @list[@index+1].code == 103
  1084.           # 如果数值输入窗口能收纳在画面里
  1085.           if line_count < Max_Lines
  1086.             # 推进索引
  1087.             @index += 1
  1088.             # 设置输入数值
  1089.             $game_temp.num_input_start = line_count
  1090.             $game_temp.num_input_variable_id = @list[@index].parameters[0]
  1091.             $game_temp.num_input_digits_max = @list[@index].parameters[1]
  1092.           end
  1093.         end
  1094.         # 继续
  1095.         return true
  1096.       end
  1097.       # 推进索引
  1098.       @index += 1
  1099.     end
  1100.   end
  1101. end

  1102. class Scene_Map
  1103.   include RB::Mes_Config
  1104.   alias rb_update_20160408 update
  1105.   def update
  1106.     if @rb_mes_disabled != $game_switches[Mes_Disabled]
  1107.       @rb_mes_disabled = $game_switches[Mes_Disabled]
  1108.       @message_window.dispose if @message_window != nil
  1109.       @message_window = @rb_mes_disabled ? Window_Message.new : Window_Message_RB.new
  1110.     end
  1111.     rb_update_20160408
  1112.   end
  1113. end

  1114. class Scene_Battle
  1115.   include RB::Mes_Config
  1116.   alias rb_update_20160408 update
  1117.   def update
  1118.     if @rb_mes_disabled != $game_switches[Mes_Disabled]
  1119.       @rb_mes_disabled = $game_switches[Mes_Disabled]
  1120.       @message_window.dispose if @message_window != nil
  1121.       @message_window = @rb_mes_disabled ? Window_Message.new : Window_Message_RB.new
  1122.     end
  1123.     rb_update_20160408
  1124.   end
  1125. end


  1126. #==============================================================================
  1127. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  1128. #==============================================================================
复制代码








然后这是多选项脚本
  1. class Game_Temp
  2.   attr_accessor :need_show_more
  3.   attr_accessor :window_pos_y
  4.   attr_accessor :choices
  5.   
  6.   alias old_ini initialize
  7.   def initialize
  8.     old_ini
  9.     @need_show_more = false
  10.     @window_pos_y = 16
  11.     @choices = nil
  12.   end
  13. end

  14. class Window_Message < Window_Selectable
  15.   alias old_ref refresh
  16.   def refresh
  17.     if $game_temp.need_show_more
  18.       self.y = $game_temp.window_pos_y
  19.       self.height = 160 + 32 * ($game_temp.choice_max - 4)
  20.       self.contents = Bitmap.new(self.width - 32, self.height - 32)
  21.     else
  22.       self.height = 160
  23.       self.contents = Bitmap.new(self.width - 32, self.height - 32)
  24.     end
  25.     old_ref
  26.   end
  27.   #--------------------------------------------------------------------------
  28.   # ● 刷新画面
  29.   #--------------------------------------------------------------------------
  30.   def update
  31.     super
  32.     # 渐变的情况下
  33.     if @fade_in
  34.       self.contents_opacity += 24
  35.       if @input_number_window != nil
  36.         @input_number_window.contents_opacity += 24
  37.       end
  38.       if self.contents_opacity == 255
  39.         @fade_in = false
  40.       end
  41.       return
  42.     end
  43.     # 输入数值的情况下
  44.     if @input_number_window != nil
  45.       @input_number_window.update
  46.       # 确定
  47.       if Input.trigger?(Input::C)
  48.         $game_system.se_play($data_system.decision_se)
  49.         $game_variables[$game_temp.num_input_variable_id] =
  50.           @input_number_window.number
  51.         $game_map.need_refresh = true
  52.         # 释放输入数值窗口
  53.         @input_number_window.dispose
  54.         @input_number_window = nil
  55.         terminate_message
  56.       end
  57.       return
  58.     end
  59.     # 显示信息中的情况下
  60.     if @contents_showing
  61.       # 如果不是在显示选择项中就显示暂停标志
  62.       if $game_temp.choice_max == 0
  63.         self.pause = true
  64.       end
  65.       # 取消
  66.       if Input.trigger?(Input::B)
  67.         if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0
  68.           $game_system.se_play($data_system.cancel_se)
  69.           $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)
  70.           $game_variables[100] = $game_temp.choice_cancel_type - 1
  71.           $game_temp.need_show_more = false
  72.           terminate_message
  73.         end
  74.       end
  75.       # 确定
  76.       if Input.trigger?(Input::C)
  77.         if $game_temp.choice_max > 0
  78.           $game_system.se_play($data_system.decision_se)
  79.           $game_variables[100] = self.index
  80.           $game_temp.choice_proc.call(self.index)
  81.         end
  82.         $game_temp.need_show_more = false
  83.         terminate_message
  84.       end
  85.       return
  86.     end
  87.     # 在渐变以外的状态下有等待显示的信息与选择项的场合
  88.     if @fade_out == false and $game_temp.message_text != nil
  89.       @contents_showing = true
  90.       $game_temp.message_window_showing = true
  91.       reset_window
  92.       refresh
  93.       Graphics.frame_reset
  94.       self.visible = true
  95.       self.contents_opacity = 0
  96.       if @input_number_window != nil
  97.         @input_number_window.contents_opacity = 0
  98.       end
  99.       @fade_in = true
  100.       return
  101.     end
  102.     # 没有可以显示的信息、但是窗口为可见的情况下
  103.     if self.visible
  104.       @fade_out = true
  105.       self.opacity -= 48
  106.       if self.opacity == 0
  107.         self.visible = false
  108.         @fade_out = false
  109.         $game_temp.message_window_showing = false
  110.       end
  111.       return
  112.     end
  113.   end
  114. end

  115. class Interpreter
  116.   def command_102
  117.     # 文章已经设置过 message_text 的情况下
  118.     if $game_temp.message_text != nil
  119.       # 结束
  120.       return false
  121.     end
  122.     # 设置信息结束后待机和返回调用标志
  123.     @message_waiting = true
  124.     $game_temp.message_proc = Proc.new { @message_waiting = false }
  125.     # 设置选择项
  126.     $game_temp.message_text = ""
  127.     $game_temp.choice_start = 0
  128.     if $game_temp.need_show_more
  129.       @parameters = [$game_temp.choices, $game_temp.choice_cancel_type]
  130.     end
  131.     setup_choices(@parameters)
  132.     # 继续
  133.     return true
  134.   end
  135. end
复制代码




这两个脚本加在一起多选项脚本就无效了,求助

Project对话框 多选项.rar

201.92 KB, 下载次数: 103

梦石
1
星屑
24088
在线时间
3339 小时
注册时间
2011-7-8
回帖
3862

开拓者

发表于 2017-7-20 00:57:37 | 显示全部楼层
RB的这个脚本也支持超过4个的选项吧

点评

我感觉RB这脚本应该不支持  发表于 2017-7-20 16:49
熟悉rgss和ruby,xp区版主~
正在填坑:《膜拜组传奇》讲述膜拜组和学霸们的故事。
已上steam:与TXBD合作的Reformers《变革者》
* 战斗调用公共事件 *
* RGSOS 网络脚本 *
回复

使用道具 举报

梦石
0
星屑
157
在线时间
143 小时
注册时间
2011-6-1
回帖
298
 楼主| 发表于 2017-7-20 16:11:33 | 显示全部楼层
guoxiaomi 发表于 2017-7-20 00:57
RB的这个脚本也支持超过4个的选项吧

是支持4个以上啊,但是把对话框脚本一加进去,就无效了……求助
回复

使用道具 举报

梦石
0
星屑
9557
在线时间
5074 小时
注册时间
2013-6-21
回帖
3459

开拓者贵宾剧作品鉴家

发表于 2017-7-21 00:32:04 | 显示全部楼层
大致看了一下。这两个脚本目前来看不可能兼容,整合在一起不如重新做一个。如果有需求,我可以想想怎么把这对话框里加个多项选择。

点评

那最好啦,VX都有恶意多选项脚本,希望这也有,这个多选项脚本应该可以拿来参考吧  发表于 2017-7-23 17:00
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部