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

Project1

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

[已经解决] 如何去掉对话加强脚本中的选择项与合并对话功能

[复制链接]

Lv1.梦旅人

梦石
0
星屑
51
在线时间
454 小时
注册时间
2012-7-31
帖子
579
跳转到指定楼层
1
发表于 2012-12-31 20:39:41 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 abc1999611 于 2012-12-31 20:54 编辑

就是说,怎么把这个效果去掉:

换回原来的这个选择项效果:
对了,顺便去掉这个合并对话的功能
脚本是对话加强脚本:
  1. #==============================================================================
  2. # ■ [VX] 对话框加强版
  3. # [VX] Window_message Plus
  4. #----------------------------------------------------------------------------
  5. # 此脚本可代替官方 Window_Message 全脚本
  6. #----------------------------------------------------------------------------
  7. # 使用说明:
  8. #
  9. # ⑴ 对话框第一行输入引号内文字"名称:",脚本会把名称提取出来美化显示
  10. # 例如"张三:",显示为"【张三】" ,美化符可在参数设定中修改
  11. #
  12. # ⑵ 默认头像在左边显示
  13. # 当您需要右边显示时,在第一行输入的名称时加"\r"(大小写不限)
  14. # 例: "拉尔夫\r:"
  15. # 请注意此时头像将进行左右翻转显示
  16. #
  17. # ⑶ 在对话中更改字体的方法:
  18. # \f[sX]:更改字号为X
  19. # \f[nX]:更改字体名称为"预设字体库"第X号字体(预设字体库请看参数设定)
  20. # 更改字体名称失败(无指定字体或字体损坏)时,启用游戏默认字体
  21. # \f[cX]:更改字色为第X号颜色 (text_color中的定义)
  22. # \f[c#FF0000]:使用16进制指定字体颜色,如本句表示红色
  23. # \f[aX]:更改字体附加效果为第X号效果
  24. # 附加样式列表:
  25. # X=0 :无附加; X=1 :阴影字; X=2 :粗体字;
  26. # X=4 :斜体字; X=8 :描边字; X=16:发光字
  27. # 叠加效果即数字相加,示例: 3:阴影+粗体 14:粗体+斜体+描边
  28. # 注意!此三种效果互斥: 阴影/描边/发光
  29. #
  30. # ⑷ 在对话中显示(技能 物品 武器 防具)图标和名称的方法:
  31. # \s[X]: 显示第X号技能图标和名称
  32. # \i[X]: 显示第X号物品图标和名称
  33. # \w[X]: 显示第X号武器图标和名称
  34. # \a[X]: 显示第X号防具图标和名称
  35. #
  36. # ⑸ 在对话中更改文字不透明度的方法:
  37. # \o[X]: 把文字不透明度更改为X (取值范围在0~255)
  38. #
  39. # ⑹ 指定时间后自动关闭对话框的方法:
  40. # \x[X]: 对话框将在X帧后自动关闭
  41. # \x: 省略参数时,将于AutoClose帧后自动关闭(AutoClose值在参数设定中)
  42. #
  43. # ⑺ 调整文字显示速度的方法:
  44. # \p[X]: 文字在X帧后显示
  45. #
  46. # ⑻ 对话中更换对话框皮肤(或直接使用图片)的方法:
  47. # \b[X]: 更改字体名称为"预设样式库"第X号样式 (预设样式库请看参数设定)
  48. # 注: vx对话框可使用Window皮肤或直接使用图片,请配合事件页设定
  49. #
  50. # 素材格式和命名规则:
  51. # 在对应的Window皮肤或对话框图片的文件名后+"_pause",做为自定义暂停标记
  52. # 的名称,并和对应皮肤或图片文件放在一起.
  53. #
  54. # ⑼ 启用头像动态显示的方法:
  55. # \e[X]: 设定头像动态显示的值为X
  56. # X=0 :关闭动态效果; X=1 :水平趋中; X=2 :渐显
  57. #
  58. # ⑽ 在对话中更换头像:
  59. # \@[X]: 设定头像索引号为X X值范围0-7
  60. # 可更改的仅是索引号,头像文件名称不可改 主要用于对话中换表情
  61. #
  62. # ⑾ 输入文章时设定冻结字符和注释字符:
  63. # #[XX]: 字符串XX被冻结,不受转义等影响直接显示
  64. # #<XX>: 字符串XX被当作注释,显示文章时不出现
  65. #------------------------------------------------------------------------------
  66. # 素材要求:
  67. #
  68. # ① 采用vx默认头像素材(Graphics\Faces)的格式
  69. # 即每个素材文件由2行4列共8格头像组成
  70. #
  71. # ② 要求所有头像朝向一致(默认是正面偏右)
  72. #
  73. # ③ 自定义暂停标记的素材采用横向多帧格式,每帧图片大小一致
  74. # 注意: 帧数在脚本参数中设定.
  75. # 在对应的Window皮肤或对话框图片的文件名后+"_pause",做为自定义暂停标记
  76. # 的名称,并和对应皮肤或图片文件放在一起.
  77. #------------------------------------------------------------------------------
  78. # 合并功能附加说明:
  79. #
  80. # ① 对话框合并
  81. # 头像、背景、位置等相同的上下两段对话都会被合并成一段对话;
  82. # 如果要打断合并,请在两段对话之间加个非对话框的执行项,比如空注释.
  83. #
  84. # ② 选择项合并
  85. # 当前选项组满4项,且取消设定不为"分歧",且下一个执行项也是选择组,就合并;
  86. # 取消键的规定: 如果有"分歧",必须设定在最后一个选项组,其它不限.
  87. # 合并后最多只有一个取消设定,多个设定时,仅最后一个有效.
  88. #----------------------------------------------------------------------------
  89. # 更新作者: 沉影不器
  90. # 许可协议: FSL
  91. # 项目版本: 1.09.1031
  92. # 引用网址: http://rpg.blue/thread-158161-1-1.html
  93. #----------------------------------------------------------------------------
  94. # - *1.09.1031* (2010-10-31) By 沉影不器
  95. # *新增 指定被冻结的字符串
  96. # *新增 允许字符串做为注释
  97. #
  98. # - *1.08.1030* (2010-10-30) By 沉影不器
  99. # *新增 对话中更改头像
  100. # *新增 允许指定16进制颜色为字色
  101. # *修改 取消对话中切换[是否独立显示选项窗体]的开关
  102. #
  103. # - *1.07.1029* (2010-10-29) By 沉影不器
  104. # *优化 重写合并选择项的功能,大幅降低冲突
  105. #
  106. # - *1.06.1026* (2010-10-26) By 沉影不器
  107. # *修改 头像在右的控制符改为"\r"(大小写不限)
  108. # *优化 改变字体失败时使用默认字体
  109. # *新增 允许独立显示选项窗体
  110. # *新增 合并多个事件页选项(突破4选项上限)
  111. #
  112. # - *1.05.1007* (2010-10-07) By 沉影不器
  113. # *修复 冒号被脚本占用而无法显示
  114. # *优化 预处理部分数据
  115. # *新增 自定义暂停标记
  116. # *新增 全局和局部字速调整
  117. # *新增 支持滚动显示多行对话内容
  118. # *新增 显示动画功能(数据库动画/心情动画)
  119. #
  120. # - *1.04.0207* (2009-02-07) By 沉影不器
  121. # *新增 字体附加效果:发光字
  122. # *新增 更换对话皮肤功能
  123. # *新增 头像动态显现功能
  124. #
  125. # - *1.03.1107* (2008-11-07) By 沉影不器
  126. # *优化 字体附加效果的叠加方法
  127. # *新增 字体附加效果:斜体字
  128. #
  129. # - *1.02.1023* (2008-10-23) By 沉影不器
  130. # *修复 自动关闭对话框时可能存在的关闭延后生效
  131. # *新增 字体附加效果:无效果、阴影字、粗体字、描边字
  132. # *新增 更改字体无效时,使用游戏默认字体
  133. #
  134. # - *1.01.0911* (2008-09-11) By 沉影不器
  135. # *新增 更改字体功能
  136. # *新增 显示(技能 物品 武器 防具)图标和名称
  137. # *新增 更改文字不透明度
  138. # *新增 自动关闭对话框
  139. #
  140. # - *1.00.0831* (2008-08-31) By 沉影不器
  141. # *初版
  142. #==============================================================================
  143. $fscript = {} if $fscript == nil
  144. $fscript["Window_message_Plus"] = "1.09.1031"
  145. #----------------------------------------------------------------------------
  146. # ▼ 通用配置模块
  147. #----------------------------------------------------------------------------
  148. module FSL
  149. module Window_message_Plus
  150. ## 对话框的预设样式库(其中"Window"和"MessageBack"是vx默认样式)
  151. Msg_StyleLib = {0=>["Window","Sinicism"], ## Window皮肤
  152. 1=>["MessageBack","Black"]} ## 图片皮肤

  153. ## 字体参数
  154. Font_Lib = ["黑体", "仿宋_GB2312", "幼圆"] ## 预设字体库
  155. Font_Space = 4 ## 字间距
  156. EdgeColor = 15 ## 描边颜色
  157. GlowColor = 10 ## 发光颜色

  158. ## 名称条参数
  159. Name_Symbol = "【】" ## 为名称添加的修饰符(一对)
  160. Name_SpaceX = 6 ## 名称条宽度缩进值
  161. Name_SpaceY = 6 ## 名称与对话内容之间的附加距离
  162. Name_FontIndex = 0 ## 名称文字字体在预设字体库中的序号
  163. Name_FontSize = 18 ## 名称文字字号
  164. Name_FontColor = 16 ## 名称文字颜色
  165. Name_FontAdj = 1 ## 名称文字附加效果
  166. NameBar_Color = 0 ## 名称背景条颜色
  167. NameBar_Opacity = 64 ## 名称背景条透明度

  168. ## 头像参数
  169. Face_Enter = 0 ## 头像显示模式
  170. Face_EnterRate = 12 ## 头像进入画面的时间
  171. Face_AdjX = 10 ## 头像横坐标微调
  172. Face_AdjY = -6 ## 头像纵坐标微调
  173. Face_Align = 2 ## 头像垂直对齐方式
  174. ## 0:顶端对齐; 1:居中对齐; 2:底端对齐

  175. ## 对话框参数
  176. Msg_FontName = 1 ## 对话文字字体在预设字体库中的序号
  177. Msg_FontSize = 16 ## 对话文字字号
  178. Msg_FontColor = 0 ## 对话文字颜色
  179. Msg_FontPlus = 1 ## 对话文字附加效果

  180. ## 全局功能参数
  181. FastShow = true ## 确定键快速显示文字
  182. AutoClose = 80 ## 默认自动关闭时间(以帧计时)
  183. GlobalSpeed = 0 ## 改变全局文字延时(以帧计时)

  184. ## 自定义暂停标记
  185. Pause_Custom = 3 ## 位置(0:不使用 1:底边居中 2:右下角 3:跟随文字)
  186. Pause_AdjX = -2 ## X坐标微调
  187. Pause_AdjY = -2 ## Y坐标微调
  188. Pause_AniCyc = 6 ## 动画周期
  189. Pause_AniFrm = 4 ## 动画帧数

  190. ## 对话和选择项合并
  191. MultiLinesWait = 30 ## 滚动显示对话的等待时间(0表示禁止合并多段对话)
  192. Choice_Strip = true ## 是否单独显示选项窗体
  193. ## 注: 选择项合并功能仅在单独显示的选项窗体生效
  194. Choice_MaxLines = 4 ## 选项窗体的最大行数(0表示禁止合并多段选择项)
  195. ## 注: 本参数仅在单独显示选项窗体时生效
  196. end
  197. end
  198. #==============================================================================
  199. # ■ Window_Message
  200. #==============================================================================
  201. class Window_Message < Window_Selectable
  202. include FSL::Window_message_Plus
  203. #--------------------------------------------------------------------------
  204. # ● 常量
  205. #--------------------------------------------------------------------------
  206. MAX_LINE = 4 # 最大行数
  207. #--------------------------------------------------------------------------
  208. # ◎ 初始化对象
  209. #--------------------------------------------------------------------------
  210. def initialize
  211. h = [Name_FontSize,Msg_FontSize].max + Name_SpaceY +
  212. (Msg_FontSize+Font_Space)*(MAX_LINE-1) + 34
  213. y = Graphics.height - h
  214. super(0, y, Graphics.width, h)
  215. self.z = 200
  216. self.active = false
  217. self.index = -1
  218. self.openness = 0
  219. @opening = false # 窗体正在打开的标志
  220. @closing = false # 窗体正在关闭的标志
  221. @text = nil # 已经没有可显示的文章
  222. @contents_x = 0 # 下一条文字描绘的 X 坐标
  223. @contents_y = 0 # 下一条文字描绘的 Y 坐标
  224. @line_count = 0 # 现在描绘的行数
  225. @wait_count = 0 # 等待计数
  226. @background = 0 # 背景类型
  227. @position = 2 # 显示位置
  228. @show_fast = false # 快速显示标志
  229. @line_show_fast = false # 以行为单位快速显示
  230. @pause_skip = false # 省略等待输入标志
  231. ## 冻结字符池
  232. @frozen_char = []
  233. ## 显示名称
  234. @show_name = false
  235. ## 自定义暂停标记
  236. @custom_pause = false if Pause_Custom > 0
  237. ## 多行对话框标记
  238. @multi_lines = false
  239. ## 字体附加效果
  240. @font_adj = Msg_FontPlus
  241. create_gold_window
  242. create_number_input_window
  243. create_back_sprite
  244. ## 头像左右判断
  245. @show_right = false
  246. ## 头像宽度
  247. @face_width = 0
  248. ## 生成自定义暂停标记
  249. create_custom_pause
  250. ## 生成名称背景条
  251. create_namebar_sprite
  252. ## 生成头像
  253. create_face_sprite
  254. ## 修改默认字体
  255. contents.font = default_font
  256. end
  257. #--------------------------------------------------------------------------
  258. # ● 释放
  259. #--------------------------------------------------------------------------
  260. def dispose
  261. super
  262. dispose_gold_window
  263. dispose_number_input_window
  264. dispose_back_sprite
  265. end
  266. #--------------------------------------------------------------------------
  267. # ◎ 更新画面
  268. #--------------------------------------------------------------------------
  269. def update
  270. super
  271. update_gold_window
  272. update_number_input_window
  273. update_back_sprite
  274. update_show_fast
  275. ## 更新自定义暂停标记
  276. update_custom_pause
  277. unless @opening or @closing # 除窗体关闭以外
  278. if @wait_count > 0 # 文章内等待中
  279. @wait_count -= 1
  280. elsif @multi_lines
  281. scroll_line
  282. elsif custom_pause # 等待文章翻页待机中
  283. input_pause
  284. elsif self.active || @choice ## 正在输入选择项
  285. input_choice
  286. elsif @number_input_window.visible # 正在输入数值
  287. input_number
  288. elsif @text != nil # 还有剩余的文章
  289. update_message # 更新消息
  290. elsif continue? # 继续的情况
  291. start_message # 开始消息
  292. open # 打开窗体
  293. $game_message.visible = true
  294. else # 不继续的情况
  295. close # 关闭窗体
  296. $game_message.visible = @closing
  297. end
  298. end
  299. ## 头像动态显现
  300. if @face_sprite.visible
  301. ## 水平趋中
  302. result = @face_x <=> @face_sprite.x
  303. x_enter = [(@face_x - @face_sprite.x).abs,Face_EnterRate].min
  304. @face_sprite.x += x_enter if result > 0
  305. @face_sprite.x -= x_enter if result < 0
  306. ## 渐显
  307. @face_sprite.opacity += Face_EnterRate if @face_sprite.opacity < 255
  308. end
  309. ## 自动关闭对话框
  310. if @auto_close != nil
  311. if @auto_close > 0
  312. @auto_close -= 1
  313. else
  314. terminate_message
  315. end
  316. end
  317. end
  318. #--------------------------------------------------------------------------
  319. # ◎ 生成所持金窗体
  320. #--------------------------------------------------------------------------
  321. def create_gold_window
  322. @gold_window = Window_Gold.new(384, 0)
  323. @gold_window.openness = 0
  324. ## 统一字体
  325. @gold_window.contents.font = default_font
  326. end
  327. #--------------------------------------------------------------------------
  328. # ◎ 生成数值输入窗体
  329. #--------------------------------------------------------------------------
  330. def create_number_input_window
  331. @number_input_window = Window_NumberInput.new
  332. @number_input_window.visible = false
  333. ## 统一字体
  334. @number_input_window.contents.font = default_font
  335. end
  336. #--------------------------------------------------------------------------
  337. # ● 生成背景活动块
  338. #--------------------------------------------------------------------------
  339. def create_back_sprite
  340. @back_sprite = Sprite.new
  341. @back_sprite.bitmap = Cache.system("MessageBack")
  342. @back_sprite.visible = (@background == 1)
  343. @back_sprite.z = 190
  344. end
  345. #--------------------------------------------------------------------------
  346. # ● 释放所持金窗体
  347. #--------------------------------------------------------------------------
  348. def dispose_gold_window
  349. @gold_window.dispose
  350. end
  351. #--------------------------------------------------------------------------
  352. # ● 释放数值输入窗体
  353. #--------------------------------------------------------------------------
  354. def dispose_number_input_window
  355. @number_input_window.dispose
  356. end
  357. #--------------------------------------------------------------------------
  358. # ● 释放背景活动块
  359. #--------------------------------------------------------------------------
  360. def dispose_back_sprite
  361. @back_sprite.dispose
  362. end
  363. #--------------------------------------------------------------------------
  364. # ● 更新所持金窗体
  365. #--------------------------------------------------------------------------
  366. def update_gold_window
  367. @gold_window.update
  368. end
  369. #--------------------------------------------------------------------------
  370. # ● 更新数值输入窗体
  371. #--------------------------------------------------------------------------
  372. def update_number_input_window
  373. @number_input_window.update
  374. end
  375. #--------------------------------------------------------------------------
  376. # ● 更新背景活动块
  377. #--------------------------------------------------------------------------
  378. def update_back_sprite
  379. @back_sprite.visible = (@background == 1)
  380. @back_sprite.y = y - 16
  381. @back_sprite.opacity = openness
  382. @back_sprite.update
  383. end
  384. #--------------------------------------------------------------------------
  385. # ◎ 更新快速显示标志
  386. #--------------------------------------------------------------------------
  387. def update_show_fast
  388. if custom_pause or self.openness < 255
  389. @show_fast = false
  390. elsif Input.trigger?(Input::C)
  391. if FastShow ## 快速显示文字
  392. @show_fast = true
  393. @wait_count = 0
  394. end
  395. elsif not Input.press?(Input::C)
  396. @show_fast = false
  397. end
  398. if @show_fast and @wait_count > 0
  399. @wait_count -= 1
  400. end
  401. end
  402. #--------------------------------------------------------------------------
  403. # ● 判断下一消息继续显示
  404. #--------------------------------------------------------------------------
  405. def continue?
  406. return true if $game_message.num_input_variable_id > 0
  407. return false if $game_message.texts.empty?
  408. if self.openness > 0 and not $game_temp.in_battle
  409. return false if @background != $game_message.background
  410. return false if @position != $game_message.position
  411. end
  412. return true
  413. end
  414. #--------------------------------------------------------------------------
  415. # ◎ 开始显示消息
  416. #--------------------------------------------------------------------------
  417. def start_message
  418. ## 重设窗体背景与位置
  419. reset_window
  420. ## 还原头像左右判断
  421. @show_right = false
  422. ## 暂存消息
  423. temp_texts = []
  424. $game_message.texts.each do |text|
  425. tmp = text.clone
  426. ## 判断对话框皮肤
  427. if tmp.sub!(/\\B\[(\d+)\]/i) { "" }
  428. filename = Msg_StyleLib[@background][$1.to_i]
  429. if @background == 0
  430. self.windowskin = Cache.system(filename)
  431. if Pause_Custom>0 && !@pause_sprite.nil? && !@pause_sprite.disposed?
  432. @pause_sprite.bitmap = Cache.system(filename + "_pause")
  433. end
  434. else
  435. @back_sprite.bitmap = Cache.system(filename)
  436. if Pause_Custom>0 && !@pause_sprite.nil? && !@pause_sprite.disposed?
  437. @pause_sprite.bitmap = Cache.system(filename + "_pause")
  438. end
  439. end
  440. ## 开始自定义暂停标记动画
  441. @pause_aniindex = -1
  442. end
  443. ## 判断头像显现
  444. @face_enter = $1.to_i if tmp.sub!(/\\E\[(\d+)\]/i) { "" }
  445. temp_texts.push(tmp)
  446. end
  447. ## 判断头像方向
  448. if !temp_texts[0].nil? and temp_texts[0].sub!(/\\R/i){ "" }
  449. @show_right = true
  450. end
  451. ## 判断名称
  452. if temp_texts[0] != nil and temp_texts[0] =~ /[::]/
  453. if temp_texts[0] =~ /\\[::]/
  454. ## 忽略名称的处理
  455. temp_texts[0].sub!(/\\:/) { ":" }
  456. temp_texts[0].sub!(/\\:/) { ":" }
  457. else
  458. ## 去冒号加修饰符(可选)
  459. unless Name_Symbol.empty?
  460. temp_texts[0].sub!(/[::]/) { "" }
  461. temp_texts[0] = Name_Symbol[0,Name_Symbol.size/2] +
  462. temp_texts[0] + Name_Symbol[Name_Symbol.size/2,Name_Symbol.size/2]
  463. end
  464. ## 设定文字颜色
  465. temp_texts[0] = "\\C[#{Name_FontColor}]" +
  466. temp_texts[0] + "\\C[#{Msg_FontColor}]"
  467. ## 设定文字字体
  468. temp_texts[0] = "\\F[N#{Name_FontIndex}]" +
  469. temp_texts[0] + "\\F[N#{Msg_FontName}]"
  470. ## 设定文字大小
  471. temp_texts[0] = "\\F[S#{Name_FontSize}]" +
  472. temp_texts[0] + "\\F[S#{Msg_FontSize}]"
  473. ## 设定文字附加效果
  474. temp_texts[0] = "\\F[A#{Name_FontAdj}]" +
  475. temp_texts[0] + "\\F[A#{Msg_FontPlus}]"
  476. ## 显示名称背景条
  477. show_namebar_sprite
  478. end
  479. end
  480. @text = ""
  481. for i in 0...temp_texts.size
  482. @text += "  " if i >= $game_message.choice_start
  483. @text += temp_texts[i].clone + "\x00"
  484. end
  485. @item_max = $game_message.choice_max
  486. convert_special_characters
  487. new_page
  488. end
  489. #--------------------------------------------------------------------------
  490. # ◎ 更换页面处理
  491. #--------------------------------------------------------------------------
  492. def new_page
  493. contents.clear
  494. ## 初始化文字描绘起点
  495. @contents_x = 0
  496. ## 除名称外文字右移1字符
  497. @contents_x += Msg_FontSize+Font_Space unless @show_name
  498. if $game_message.face_name.empty?
  499. @face_sprite.bitmap.clear
  500. else
  501. name = $game_message.face_name
  502. index = $game_message.face_index
  503. ## 获取头像宽度
  504. set_face_width(name)
  505. ## 计算文字横坐标起始
  506. @contents_x += @face_width-16 unless @show_right
  507. draw_msg_face(name, index)
  508. ## 头像进入画面
  509. face_in
  510. end
  511. @contents_y = 0
  512. @line_count = 0
  513. @show_fast = false
  514. @line_show_fast = false
  515. @pause_skip = false
  516. contents.font.color = text_color(0)
  517. end
  518. #--------------------------------------------------------------------------
  519. # ◎ 换行处理
  520. #--------------------------------------------------------------------------
  521. def new_line
  522. ## 提前处理自定义暂停标记
  523. set_custom_pause_pos
  524. @contents_x = 0
  525. unless $game_message.face_name.empty?
  526. ## 头像显示在左时
  527. @contents_x = @face_width-16 unless @show_right
  528. end
  529. ## 除名称外文字右移1字符
  530. @contents_x += (Msg_FontSize+Font_Space)
  531. ## 显示名称之后,对话内容下移 Name_SpaceY
  532. @contents_y += Name_SpaceY if @line_count == 0 and @show_name
  533. ## 以字号为新间距
  534. @contents_y += (Msg_FontSize+Font_Space)
  535. @line_count += 1
  536. @line_show_fast = false
  537. end
  538. #--------------------------------------------------------------------------
  539. # ◎ 特殊文字变换
  540. #--------------------------------------------------------------------------
  541. def convert_special_characters
  542. ## 特定字符处理
  543. @text.gsub!(/#\[(.*?)\]/) {@frozen_char.push($1); "\xff"}
  544. @text.gsub!(/#\<(.*?)\>/) {""}
  545. ## 默认控制符
  546. @text.gsub!(/\\V\[(\d+)\]/i) {$game_variables[$1.to_i]}
  547. @text.gsub!(/\\V\[(\d+)\]/i) {$game_variables[$1.to_i]}
  548. @text.gsub!(/\\N\[(\d+)\]/i) {$game_actors[$1.to_i].name}
  549. @text.gsub!(/\\C\[(\d+)\]/i) {"\x01[#{$1}]"}
  550. @text.gsub!(/\\G/) {"\x02"}
  551. @text.gsub!(/\\\./) {"\x03"}
  552. @text.gsub!(/\\\|/) {"\x04"}
  553. @text.gsub!(/\\!/) {"\x05"}
  554. @text.gsub!(/\\>/) {"\x06"}
  555. @text.gsub!(/\\</) {"\x07"}
  556. @text.gsub!(/\\\^/) {"\x08"}
  557. @text.gsub!(/\\\\/) {"\\"}
  558. ## 更改不透明度
  559. @text.gsub!(/\\O\[(\d+)\]/i) {"\x09[#{$1}]"}
  560. ## 显示数据库元素
  561. @text.gsub!(/\\S\[(\d+)\]/i) {"\x0a[#{$1}]" + $data_skills[$1.to_i].name}
  562. @text.gsub!(/\\I\[(\d+)\]/i) {"\x0b[#{$1}]" + $data_items[$1.to_i].name}
  563. @text.gsub!(/\\W\[(\d+)\]/i) {"\x0c[#{$1}]" + $data_weapons[$1.to_i].name}
  564. @text.gsub!(/\\A\[(\d+)\]/i) {"\x0d[#{$1}]" + $data_armors[$1.to_i].name}
  565. ## 更改字体
  566. @text.gsub!(/\\F\[S(\d+)\]/i){"\x0e[#{$1}]"}
  567. @text.gsub!(/\\F\[N(\d+)\]/i){"\x0f[#{$1}]"}
  568. @text.gsub!(/\\F\[C(\d+)\]/i){"\x01[#{$1}]"}
  569. ## 16进制颜色
  570. @text.gsub!(/\\F\[C\#([a-f0-9]+)\]/i) {"\x10[#{$1}]"}
  571. ## 字体附加效果
  572. @text.gsub!(/\\F\[A(\d+)\]/i){"\x11[#{$1}]"}
  573. ## 自动关闭
  574. @text.gsub!(/\\X\[(\d+)\]/i) {"\x12[#{$1}]"}
  575. @text.gsub!(/\\X/i) {"\x13"}
  576. ## 字速控制
  577. @text.gsub!(/\\P\[(\d+)\]/i) {"\x14[#{$1}]"}
  578. ## 提取动画对象和 ID
  579. @text.gsub!(/\\A\[(\S+)\,(\d+)\]/i) {"\x15[#{$1},#{$2}]"}
  580. @text.gsub!(/\\B\[(\S+)\,(\d+)\]/i) {"\x16[#{$1},#{$2}]"}
  581. ## 切换头像index
  582. @text.gsub!(/\\@\[(\d+)\]/) {"\x17[#{$1}]"}
  583. end
  584. #--------------------------------------------------------------------------
  585. # ◎ 设置窗体背景与位置
  586. #--------------------------------------------------------------------------
  587. def reset_window
  588. @background = $game_message.background
  589. @position = $game_message.position
  590. if @background == 0 # 普通窗体
  591. self.opacity = 255
  592. else # 背景变暗、透明
  593. self.opacity = 0
  594. end
  595. case @position
  596. when 0 # 上
  597. fh = get_face_height($game_message.face_name)
  598. self.y = fh - self.height - Face_AdjY
  599. self.y = 0 if self.y < 0
  600. @gold_window.y = 360
  601. when 1 # 中
  602. self.y = (Graphics.height-self.height)/2
  603. @gold_window.y = 0
  604. when 2 # 下
  605. self.y = Graphics.height-self.height
  606. @gold_window.y = 0
  607. end
  608. end
  609. #--------------------------------------------------------------------------
  610. # ◎ 消息结束
  611. #--------------------------------------------------------------------------
  612. def terminate_message
  613. ## 选项窗体
  614. Choice_Strip ? @choice = false : self.active = false
  615. self.custom_pause = false
  616. self.index = -1
  617. @gold_window.close
  618. @number_input_window.active = false
  619. @number_input_window.visible = false
  620. $game_message.main_proc.call if $game_message.main_proc != nil
  621. $game_message.clear
  622. ## 还原自动关闭
  623. @auto_close = nil
  624. ## 处理名称背景条和头像
  625. @show_name = false
  626. @namebar_sprite.visible = false
  627. @face_sprite.visible = false
  628. @face_sprite.bitmap.clear
  629. end
  630. #--------------------------------------------------------------------------
  631. # ◎ 更新消息
  632. #--------------------------------------------------------------------------
  633. def update_message
  634. loop do
  635. c = @text.slice!(/./m) # 获取下一条文字
  636. case c
  637. when nil # 没有可以显示的文字
  638. finish_message # 更新结束
  639. break
  640. when "\x00" # 换行
  641. new_line
  642. if @line_count >= MAX_LINE # 行数为最大时
  643. unless @text.empty? # 如果还有增加则继续
  644. ## 等待滚动
  645. @wait_count = MultiLinesWait
  646. @multi_lines = true
  647. break
  648. end
  649. end
  650. when "\x01" # \C[n] (更改文字色)
  651. @text.sub!(/\[([0-9]+)\]/, "")
  652. contents.font.color = text_color($1.to_i)
  653. next
  654. when "\x02" # \G (显示所持金)
  655. @gold_window.refresh
  656. @gold_window.open
  657. when "\x03" # \. (等待 1/4 秒)
  658. @wait_count = 15
  659. break
  660. when "\x04" # \| (等待 1 秒)
  661. @wait_count = 60
  662. break
  663. when "\x05" # \! (等待输入)
  664. self.custom_pause = true
  665. break
  666. when "\x06" # \> (瞬间显示 ON)
  667. @line_show_fast = true
  668. when "\x07" # \< (瞬间显示 OFF)
  669. @line_show_fast = false
  670. when "\x08" # \^ (不等待输入)
  671. @pause_skip = true
  672. ## 更改不透明度的情况下
  673. when "\x09"
  674. @text.sub!(/\[(\d+)\]/, "")
  675. contents.font.color.alpha = $1.to_i
  676. ## 显示技能情况下
  677. when "\x0a"
  678. @text.sub!(/\[(\d+)\]/, "")
  679. draw_icon($data_skills[$1.to_i].icon_index, @contents_x, @contents_y)
  680. ## 横坐标增加图标宽度
  681. @contents_x += 24
  682. ## 显示物品情况下
  683. when "\x0b"
  684. @text.sub!(/\[(\d+)\]/, "")
  685. draw_icon($data_items[$1.to_i].icon_index, @contents_x, @contents_y)
  686. ## 横坐标增加图标宽度
  687. @contents_x += 24
  688. ## 显示武器情况下
  689. when "\x0c"
  690. @text.sub!(/\[(\d+)\]/, "")
  691. draw_icon($data_weapons[$1.to_i].icon_index, @contents_x, @contents_y)
  692. ## 横坐标增加图标宽度
  693. @contents_x += 24
  694. ## 显示防具情况下
  695. when "\x0d"
  696. @text.sub!(/\[(\d+)\]/, "")
  697. draw_icon($data_armors[$1.to_i].icon_index, @contents_x, @contents_y)
  698. ## 横坐标增加图标宽度
  699. @contents_x += 24
  700. ## 更改字体的情况下
  701. when "\x0e"
  702. @text.sub!(/\[(\d+)\]/, "")
  703. contents.font.size = $1.to_i
  704. when "\x0f"
  705. @text.sub!(/\[(\d+)\]/, "")
  706. name = Font_Lib[$1.to_i]
  707. contents.font.name = Font.exist?(name) ? name : Font.default_name
  708. ## 16进制颜色
  709. when "\x10"
  710. @text.sub!(/\[(\w+)\]/, "")
  711. r,g,b = $1.scan(/../)
  712. contents.font.color = Color.new(r.hex, g.hex, b.hex)
  713. ## 字体附加效果
  714. when "\x11"
  715. @text.sub!(/\[(\d+)\]/, "")
  716. ## 获取字体附加效果
  717. @font_adj = $1.to_i
  718. ## 自动关闭对话框的情况下
  719. when "\x12"
  720. @text.sub!(/\[(\d+)\]/, "")
  721. @auto_close = $1.to_i
  722. when "\x13"
  723. @auto_close = AutoClose
  724. ## \P[n] (字速)
  725. when "\x14"
  726. @text.sub!(/\[(\d+)\]/, "")
  727. ## 获取字体显示速度
  728. @speed = $1.to_i
  729. ## 显示角色动画
  730. when "\x15"
  731. @text.sub!(/\[(\S+)\,(\d+)\]/, "")
  732. character = interpreter.get_character($1.to_i)
  733. character.animation_id = $2.to_i unless character.nil?
  734. next
  735. ## 显示心情动画
  736. when "\x16"
  737. @text.sub!(/\[(\S+)\,(\d+)\]/, "")
  738. character = interpreter.get_character($1.to_i)
  739. character.balloon_id = $2.to_i unless character.nil?
  740. next
  741. ## 换头像
  742. when "\x17"
  743. @text.sub!(/\[(\d+)\]/, "")
  744. name = $game_message.face_name
  745. index = $game_message.face_index = $1.to_i
  746. draw_msg_face(name, index)
  747. ## 选择项
  748. when "\x18"
  749. finish_message
  750. break
  751. ## 特定字符处理
  752. when "\xff"
  753. @text.insert(0, @frozen_char.shift)
  754. else
  755. ## 字速控制
  756. @wait_count = GlobalSpeed
  757. @wait_count = @speed if @speed != nil
  758. h = contents.font.size + Font_Space
  759. ## 字体附加效果
  760. if @font_adj & 1 != 0
  761. contents.font.shadow = true
  762. else
  763. contents.font.shadow = false
  764. end
  765. if @font_adj & 2 != 0
  766. contents.font.bold = true
  767. else
  768. contents.font.bold = false
  769. end
  770. if @font_adj & 4 != 0
  771. contents.font.italic = true
  772. else
  773. contents.font.italic = false
  774. end
  775. if @font_adj & 8 != 0 ## 描边字
  776. color = text_color(EdgeColor)
  777. contents.draw_edge_text(@contents_x,@contents_y,h,h,c,0,color)
  778. elsif @font_adj & 16 != 0 ## 发光字
  779. color = text_color(GlowColor)
  780. contents.draw_glow_text(@contents_x,@contents_y,h,h,c,0,color)
  781. else ## 普通字
  782. contents.draw_text(@contents_x, @contents_y, h, h, c)
  783. end
  784. c_width = contents.text_size(c).width
  785. @contents_x += c_width
  786. end
  787. break unless @show_fast or @line_show_fast
  788. end
  789. end
  790. #--------------------------------------------------------------------------
  791. # ◎ 消息更新结束
  792. #--------------------------------------------------------------------------
  793. def finish_message
  794. if $game_message.choice_max > 0
  795. start_choice
  796. elsif $game_message.num_input_variable_id > 0
  797. start_number_input
  798. elsif @pause_skip
  799. terminate_message
  800. else
  801. self.custom_pause = true
  802. end
  803. @wait_count = 10
  804. @text = nil
  805. ## 临时字速还原
  806. @speed = nil
  807. end
  808. #--------------------------------------------------------------------------
  809. # ◎ 开始选择项
  810. #--------------------------------------------------------------------------
  811. def start_choice
  812. if Choice_Strip
  813. @choice = true
  814. width = 0
  815. commands = []
  816. for i in $game_message.choice_start+1 ...$game_message.texts.size
  817. commands.push $game_message.texts[i]
  818. iw = contents.text_size($game_message.texts[i]).width
  819. width = iw if width < iw
  820. end
  821. ## 计算高度
  822. if commands.size > Choice_MaxLines
  823. row_max = Choice_MaxLines
  824. else
  825. row_max = commands.size
  826. end
  827. @choice_window = Window_Command.new(width+42, commands, 1, row_max)
  828. @choice_window.contents.font = default_font
  829. @choice_window.refresh
  830. ## 计算坐标
  831. if @show_right
  832. @choice_window.x = self.x
  833. else
  834. @choice_window.x = self.x + self.width - @choice_window.width
  835. end
  836. if @position == 0
  837. @choice_window.y = self.y + self.height
  838. else
  839. @choice_window.y = self.y - @choice_window.height
  840. end
  841. else
  842. self.active = true
  843. self.index = 0
  844. end
  845. end
  846. #--------------------------------------------------------------------------
  847. # ◎ 开始输入数值
  848. #--------------------------------------------------------------------------
  849. def start_number_input
  850. digits_max = $game_message.num_input_digits_max
  851. number = $game_variables[$game_message.num_input_variable_id]
  852. @number_input_window.digits_max = digits_max
  853. @number_input_window.number = number
  854. if $game_message.face_name.empty?
  855. @number_input_window.x = x
  856. else
  857. ## 代入头像宽度
  858. @number_input_window.x = @show_right ? x : x + @face_width
  859. end
  860. @number_input_window.y = y + @contents_y
  861. @number_input_window.active = true
  862. @number_input_window.visible = true
  863. @number_input_window.update
  864. end
  865. #--------------------------------------------------------------------------
  866. # ◎ 更新光标 ###可能仍须增加判断
  867. #--------------------------------------------------------------------------
  868. def update_cursor
  869. if @index >= 0
  870. if $game_message.face_name.empty?
  871. x = 0
  872. y = ($game_message.choice_start+@index)*(Msg_FontSize+Font_Space)
  873. width = contents.width
  874. else
  875. x = @show_right ? 0 : @face_width
  876. y = ($game_message.choice_start+@index)*(Msg_FontSize+Font_Space) +
  877. Name_SpaceY
  878. width = contents.width - @face_width
  879. end
  880. self.cursor_rect.set(x, y, width, (Msg_FontSize+Font_Space))
  881. else
  882. self.cursor_rect.empty
  883. end
  884. end
  885. #--------------------------------------------------------------------------
  886. # ◎ 文章显示输入处理
  887. #--------------------------------------------------------------------------
  888. def input_pause
  889. if Input.trigger?(Input::C) or Input.trigger?(Input::B)
  890. ## 还原自定义暂停标记
  891. self.custom_pause = false
  892. if @text != nil and not @text.empty?
  893. new_page if @line_count >= MAX_LINE
  894. else
  895. terminate_message
  896. end
  897. end
  898. end
  899. #--------------------------------------------------------------------------
  900. # ◎ 选择项输入处理
  901. #--------------------------------------------------------------------------
  902. def input_choice
  903. if Input.trigger?(Input::B)
  904. if $game_message.choice_cancel_type > 0
  905. Sound.play_cancel
  906. $game_message.choice_proc.call($game_message.choice_cancel_type - 1)
  907. terminate_message
  908. end
  909. elsif Input.trigger?(Input::C)
  910. Sound.play_decision
  911. ## 获取相应index
  912. index = Choice_Strip ? @choice_window.index : self.index
  913. $game_message.choice_proc.call(index)
  914. terminate_message
  915. end
  916. ## 刷新选项窗体
  917. return unless Choice_Strip
  918. if @choice
  919. @choice_window.update
  920. else
  921. @choice_window.dispose
  922. @choice_window = nil
  923. end
  924. end
  925. #--------------------------------------------------------------------------
  926. # ● 数值输入处理
  927. #--------------------------------------------------------------------------
  928. def input_number
  929. if Input.trigger?(Input::C)
  930. Sound.play_decision
  931. $game_variables[$game_message.num_input_variable_id] =
  932. @number_input_window.number
  933. $game_map.need_refresh = true
  934. terminate_message
  935. end
  936. end
  937. #--------------------------------------------------------------------------
  938. # ○ 生成名称背景条
  939. #--------------------------------------------------------------------------
  940. def create_namebar_sprite
  941. @namebar_sprite = Sprite.new
  942. @namebar_sprite.bitmap = Bitmap.new(width-Name_SpaceX, Name_FontSize+4)
  943. ## 可视性
  944. @namebar_sprite.visible = false
  945. ## 准备参数
  946. rect = Rect.new(Name_SpaceX,0,@namebar_sprite.width,@namebar_sprite.height)
  947. color1 = text_color(NameBar_Color)
  948. color2 = text_color(NameBar_Color)
  949. color1.alpha = NameBar_Opacity
  950. color2.alpha = 0
  951. ## 描绘渐变条
  952. @namebar_sprite.bitmap.gradient_fill_rect(rect, color1, color2)
  953. end
  954. #--------------------------------------------------------------------------
  955. # ○ 显示名称背景条
  956. #--------------------------------------------------------------------------
  957. def show_namebar_sprite
  958. @show_name = true
  959. return if @background == 1
  960. ## 坐标跟随
  961. @namebar_sprite.x = self.x
  962. @namebar_sprite.y = self.y + 16 - 1
  963. @namebar_sprite.z = self.z + 1
  964. ## 可视性
  965. @namebar_sprite.visible = true
  966. end
  967. #--------------------------------------------------------------------------
  968. # ○ 生成头像
  969. #--------------------------------------------------------------------------
  970. def create_face_sprite
  971. @face_sprite = Sprite.new
  972. @face_sprite.bitmap = Bitmap.new(1,1)
  973. @face_sprite.z = self.z + 2
  974. @face_sprite.visible = false
  975. @old_name = "" # 判断头像是否改变
  976. @old_index = 0 # 判断头像是否改变
  977. @face_enter = Face_Enter # 头像显示模式
  978. end
  979. #--------------------------------------------------------------------------
  980. # ○ 描绘头像
  981. # face_name : 头像图像文件名
  982. # face_index : 头像图像索引
  983. #--------------------------------------------------------------------------
  984. def draw_msg_face(face_name, face_index)
  985. bitmap = Cache.face(face_name)
  986. width = bitmap.width / 4
  987. height = bitmap.height / 2
  988. rect = Rect.new(0, 0, 0, 0)
  989. rect.x = face_index % 4 * width
  990. rect.y = face_index / 4 * height
  991. rect.width = width
  992. rect.height = height
  993. @face_sprite.bitmap = Bitmap.new(width, height)
  994. @face_sprite.bitmap.blt(0, 0, bitmap, rect)
  995. @face_sprite.mirror = @show_right
  996. end
  997. #--------------------------------------------------------------------------
  998. # ○ 设定头像宽度
  999. # face_name : 头像图像文件名
  1000. #--------------------------------------------------------------------------
  1001. def set_face_width(face_name)
  1002. bitmap = Cache.face(face_name)
  1003. @face_width = bitmap.width / 4
  1004. end
  1005. #--------------------------------------------------------------------------
  1006. # ○ 获取头像高度
  1007. # face_name : 头像图像文件名
  1008. #--------------------------------------------------------------------------
  1009. def get_face_height(face_name)
  1010. bitmap = Cache.face(face_name)
  1011. return bitmap.height / 2
  1012. end
  1013. #--------------------------------------------------------------------------
  1014. # ○ 头像进入画面
  1015. #--------------------------------------------------------------------------
  1016. def face_in
  1017. fw = @face_sprite.width
  1018. fh = @face_sprite.height
  1019. ## 水平坐标
  1020. if @show_right
  1021. @face_x = self.width - fw - Face_AdjX
  1022. else
  1023. @face_x = self.x + Face_AdjX
  1024. end
  1025. @face_sprite.x = @face_x
  1026. ## 垂直坐标
  1027. case Face_Align
  1028. when 0
  1029. @face_sprite.y = self.y + Face_AdjY
  1030. when 1
  1031. @face_sprite.y = self.y + (self.height - fh) / 2
  1032. when 2
  1033. @face_sprite.y = self.y + (self.height - fh) + Face_AdjY
  1034. end
  1035. case @face_enter
  1036. when 1 ## 水平趋中时
  1037. @face_sprite.x += (@show_right ? fw : -fw)
  1038. when 2 ## 渐显时
  1039. @face_sprite.opacity = 0
  1040. end
  1041. ## 可视性
  1042. @face_sprite.visible = true
  1043. end
  1044. #--------------------------------------------------------------------------
  1045. # ○ 生成自定义暂停标记
  1046. #--------------------------------------------------------------------------
  1047. def create_custom_pause
  1048. return if Pause_Custom == 0
  1049. @pause_sprite = Sprite.new
  1050. @pause_sprite.visible = false
  1051. @pause_sprite.z = self.z + 3
  1052. @pause_sprite.bitmap = Cache.system("Window_pause")
  1053. @pause_aniindex = -1
  1054. @pause_anispeed = 0
  1055. end
  1056. #--------------------------------------------------------------------------
  1057. # ○ 获取暂停标记
  1058. #--------------------------------------------------------------------------
  1059. def custom_pause
  1060. return @custom_pause
  1061. end
  1062. #--------------------------------------------------------------------------
  1063. # ○ 更改暂停标记
  1064. #--------------------------------------------------------------------------
  1065. def custom_pause=(val)
  1066. @custom_pause = val
  1067. self.pause = val if Pause_Custom == 0
  1068. end
  1069. #--------------------------------------------------------------------------
  1070. # ○ 更新暂停标记
  1071. #--------------------------------------------------------------------------
  1072. def update_custom_pause
  1073. return if Pause_Custom == 0
  1074. @pause_sprite.visible = @custom_pause
  1075. @pause_sprite.visible = false if @pause_aniindex == -1
  1076. return if !@custom_pause
  1077. if @pause_anispeed > 0
  1078. @pause_anispeed -= 1
  1079. else
  1080. @pause_aniindex = (@pause_aniindex + 1) % Pause_AniFrm
  1081. pw = @pause_sprite.bitmap.width / Pause_AniFrm
  1082. ph = @pause_sprite.bitmap.height
  1083. @pause_sprite.src_rect.set(@pause_aniindex*pw, 0, pw, ph)
  1084. @pause_anispeed = Pause_AniCyc
  1085. end
  1086. end
  1087. #--------------------------------------------------------------------------
  1088. # ○ 设定暂停标记坐标
  1089. #--------------------------------------------------------------------------
  1090. def set_custom_pause_pos
  1091. return if Pause_Custom == 0
  1092. pw = @pause_sprite.bitmap.width / Pause_AniFrm
  1093. ph = @pause_sprite.bitmap.height
  1094. case Pause_Custom
  1095. when 1 ## 底边居中
  1096. @pause_sprite.x = self.x + (self.width - pw)/2
  1097. @pause_sprite.y = self.y + self.height - ph
  1098. when 2 ## 右下角
  1099. @pause_sprite.x = self.x + self.width - pw
  1100. @pause_sprite.y = self.y + self.height - ph
  1101. @pause_sprite.x -= @face_width if @show_right
  1102. when 3 ## 文字后
  1103. @pause_sprite.x = self.x + @contents_x + Msg_FontSize + Font_Space
  1104. @pause_sprite.y = self.y + @contents_y + Msg_FontSize + Font_Space
  1105. end
  1106. @pause_sprite.x += Pause_AdjX
  1107. @pause_sprite.y += Pause_AdjY
  1108. end
  1109. #--------------------------------------------------------------------------
  1110. # ○ 滚动换行
  1111. #--------------------------------------------------------------------------
  1112. def scroll_line
  1113. w = self.width - 32
  1114. hm = Msg_FontSize + Font_Space
  1115. if @show_name
  1116. l = MAX_LINE - 2
  1117. hn = Name_FontSize + Font_Space + Name_SpaceY
  1118. rect = Rect.new(0, hn+hm, w, hm*l)
  1119. else
  1120. l = MAX_LINE - 1
  1121. hn = 0
  1122. rect = Rect.new(0, hm, w, hm*l)
  1123. end
  1124. ## 复制位图
  1125. buff = Bitmap.new(w, hm*l)
  1126. buff.blt(0, 0, contents, rect)
  1127. ## 描绘位图
  1128. contents.clear_rect Rect.new(0, hn, w, hm*l+hm)
  1129. contents.blt 0, hn, buff, Rect.new(0, 0, w, hm*l)
  1130. buff.dispose
  1131. @contents_y -= Msg_FontSize + Font_Space
  1132. @multi_lines = false
  1133. end
  1134. #--------------------------------------------------------------------------
  1135. # ○ 默认字体
  1136. #--------------------------------------------------------------------------
  1137. def default_font
  1138. font = Font.new(Font.default_name, Msg_FontSize)
  1139. font.shadow = Font.default_shadow
  1140. font.italic = Font.default_italic
  1141. font.color = text_color(Msg_FontColor)
  1142. font.bold = Font.default_bold
  1143. return font
  1144. end
  1145. #--------------------------------------------------------------------------
  1146. # ○ 当前解释器
  1147. #--------------------------------------------------------------------------
  1148. def interpreter
  1149. if $game_temp.in_battle
  1150. return $game_troop.interpreter
  1151. else
  1152. return $game_map.interpreter
  1153. end
  1154. end
  1155. end
  1156. #==============================================================================
  1157. # ■ Window_Command
  1158. #==============================================================================
  1159. class Window_Command < Window_Selectable
  1160. #--------------------------------------------------------------------------
  1161. # ◎ 初始化
  1162. # width : 窗口宽
  1163. # commands : 命令字符串列表
  1164. # column_max : 列数 (2 以上横向选择)
  1165. # row_max : 行数 (0:与命令数一致)
  1166. # spacing : 项目横向的空白空间
  1167. #--------------------------------------------------------------------------
  1168. def initialize(width, commands, column_max = 1, row_max = 0, spacing = 32)
  1169. line_max = (commands.size + column_max - 1) / column_max
  1170. row_max = line_max if row_max == 0
  1171. super(0, 0, width, [line_max,row_max].max * WLH + 32, spacing)
  1172. @commands = commands
  1173. @item_max = commands.size
  1174. @column_max = column_max
  1175. refresh
  1176. self.index = 0
  1177. self.height = row_max * WLH + 32
  1178. end
  1179. end
  1180. #==============================================================================
  1181. # ■ Game_Interpreter
  1182. #==============================================================================
  1183. class Game_Interpreter
  1184. #--------------------------------------------------------------------------
  1185. # ◎ 设置事件
  1186. # list : 执行内容
  1187. # event_id : 事件 ID
  1188. #--------------------------------------------------------------------------
  1189. alias msg_plus_setup setup
  1190. def setup(list, event_id = 0)
  1191. msg_plus_setup(list, event_id)
  1192. ## 获取执行列表
  1193. @list = Marshal.load(Marshal.dump list)
  1194. end
  1195. #--------------------------------------------------------------------------
  1196. # ◎ 显示文章
  1197. #--------------------------------------------------------------------------
  1198. def command_101
  1199. unless $game_message.busy
  1200. $game_message.face_name = @params[0]
  1201. $game_message.face_index = @params[1]
  1202. $game_message.background = @params[2]
  1203. $game_message.position = @params[3]
  1204. @index += 1
  1205. loop do
  1206. case @list[@index].code
  1207. when 101 ## 对话设定
  1208. multi_lines? ? @index += 1 : break
  1209. when 401 ## 对话数据
  1210. $game_message.texts.push(@list[@index].parameters[0])
  1211. @index += 1
  1212. else
  1213. break
  1214. end
  1215. end
  1216. if @list[@index].code == 102 # 显示选择项
  1217. setup_choices(@list[@index].parameters)
  1218. elsif @list[@index].code == 103 # 处理数值输入
  1219. setup_num_input(@list[@index].parameters)
  1220. end
  1221. set_message_waiting # 消息待机状态
  1222. end
  1223. return false
  1224. end
  1225. #--------------------------------------------------------------------------
  1226. # ◎ 设置选择项
  1227. #--------------------------------------------------------------------------
  1228. def setup_choices(params)
  1229. if FSL::Window_message_Plus::Choice_Strip &&
  1230. FSL::Window_message_Plus::Choice_MaxLines > 0
  1231. ## 备重建
  1232. @modify = []
  1233. @delete = []
  1234. @cancel = 0
  1235. ## 获取合并后的command
  1236. command = @list[@index].clone
  1237. command.parameters = connect_choice(@index), @cancel
  1238. ## 消息参数
  1239. $game_message.choice_start = $game_message.texts.size
  1240. $game_message.choice_max = command.parameters[0].size
  1241. $game_message.texts.push "\x18"
  1242. command.parameters[0].each{|s| $game_message.texts.push(s)}
  1243. ## 重建数据
  1244. @modify.each_index do |i|
  1245. key,value = @modify[i].is_a?(Array) ? @modify[i] : [@modify[i],i]
  1246. @list[key].parameters[0] = value
  1247. end
  1248. @delete.reverse.each{|i| @list[i,1] = nil}
  1249. @list.insert(@index, command)
  1250. $game_message.choice_cancel_type = @cancel
  1251. $game_message.choice_proc = Proc.new { |n| @branch[@indent] = n }
  1252. ## 推进
  1253. @index += 1
  1254. else
  1255. ## 默认情况
  1256. if $game_message.texts.size <= 4 - params[0].size
  1257. $game_message.choice_start = $game_message.texts.size
  1258. $game_message.choice_max = params[0].size
  1259. for s in params[0]
  1260. $game_message.texts.push(s)
  1261. end
  1262. $game_message.choice_cancel_type = params[1]
  1263. $game_message.choice_proc = Proc.new { |n| @branch[@indent] = n }
  1264. @index += 1
  1265. end
  1266. end
  1267. end
  1268. #--------------------------------------------------------------------------
  1269. # ◎ 取消的情况下
  1270. #--------------------------------------------------------------------------
  1271. alias msg_plus_command_403 command_403
  1272. def command_403
  1273. ## 合并选项时
  1274. if !@params[0].nil? && @branch[@indent] == @params[0] - 1
  1275. @branch.delete(@indent)
  1276. return true
  1277. end
  1278. msg_plus_command_403
  1279. end
  1280. #--------------------------------------------------------------------------
  1281. # ## 合并选项
  1282. #--------------------------------------------------------------------------
  1283. def connect_choice(index, result=[])
  1284. params = @list[index].parameters
  1285. indent = @list[index].indent
  1286. ## 取消项
  1287. @cancel = result.size + params[1] if params[1] > 0
  1288. params[0].each{|s| result.push(s)}
  1289. @delete.push(index) ## 102
  1290. index = next_choice(index)
  1291. ## 判断合并的条件 选项:满4项;取消:非分歧
  1292. if index && params[0].size == 4 && params[1] < 5
  1293. @delete.push(index-1) ## 404
  1294. connect_choice(index, result)
  1295. else
  1296. return result
  1297. end
  1298. end
  1299. #--------------------------------------------------------------------------
  1300. # ## 下个选项
  1301. #--------------------------------------------------------------------------
  1302. def next_choice(index)
  1303. params = @list[index].parameters
  1304. indent = @list[index].indent
  1305. until @list[index+1].nil?
  1306. index += 1
  1307. if indent == @list[index].indent
  1308. case @list[index].code
  1309. when 402
  1310. @modify.push(index)
  1311. when 403
  1312. @modify.push([index,@cancel])
  1313. when 404
  1314. ## 判断合并的条件 下一个同级执行项102
  1315. return @list[index+1].code == 102 ? index+1 : nil
  1316. end
  1317. end
  1318. end
  1319. end
  1320. #--------------------------------------------------------------------------
  1321. # ○ 多行模式?
  1322. #--------------------------------------------------------------------------
  1323. def multi_lines?
  1324. return false if FSL::Window_message_Plus::MultiLinesWait <= 0
  1325. return false if $game_message.face_name != @list[@index].parameters[0]
  1326. return false if $game_message.face_index != @list[@index].parameters[1]
  1327. return false if $game_message.background != @list[@index].parameters[2]
  1328. return false if $game_message.position != @list[@index].parameters[3]
  1329. return true
  1330. end
  1331. #--------------------------------------------------------------------------
  1332. # ○ 心情图标扩展
  1333. # character_id: 角色 ID (-1 为角色、0 为本事件、除此之外为事件 ID)
  1334. # balloon_id : 心情动画 ID (从1开始)
  1335. #--------------------------------------------------------------------------
  1336. def balloon_extend(character_id, balloon_id)
  1337. character = get_character(character_id)
  1338. if character != nil
  1339. character.balloon_id = balloon_id
  1340. end
  1341. return true
  1342. end
  1343. end
  1344. #==============================================================================
  1345. # ■ Bitmap
  1346. #==============================================================================
  1347. class Bitmap
  1348. #--------------------------------------------------------------------------
  1349. # ○ 描边字
  1350. #--------------------------------------------------------------------------
  1351. def draw_edge_text(x, y, width, height, str, align = 0, color = nil)
  1352. font_backup = self.font.clone
  1353. self.font.color.set(color.red,color.green,color.blue) if color
  1354. self.font.shadow = false
  1355. # 描绘边缘
  1356. self.draw_text(x-1, y-1, width, height, str, align)
  1357. self.draw_text(x-1, y+1, width, height, str, align)
  1358. self.draw_text(x+1, y-1, width, height, str, align)
  1359. self.draw_text(x+1, y+1, width, height, str, align)
  1360. self.draw_text(x, y-1, width, height, str, align)
  1361. self.draw_text(x, y+1, width, height, str, align)
  1362. self.draw_text(x-1, y, width, height, str, align)
  1363. self.draw_text(x+1, y, width, height, str, align)
  1364. # 描绘主文字
  1365. self.font.color = font_backup.color
  1366. self.draw_text(x, y, width, height, str, align)
  1367. # 还原默认字体
  1368. self.font = font_backup
  1369. end
  1370. #--------------------------------------------------------------------------
  1371. # ○ 发光字
  1372. #--------------------------------------------------------------------------
  1373. def draw_glow_text(x, y, width, height, str, align = 0, color = nil)
  1374. buff = Bitmap.new(width, height)
  1375. buff.font = self.font.clone
  1376. buff.font.shadow = false
  1377. buff.font.color.set(color.red,color.green,color.blue) if color
  1378. # 描绘边缘
  1379. buff.draw_text(-1, -1, width, height, str, align)
  1380. buff.draw_text(-1, 1, width, height, str, align)
  1381. buff.draw_text(1, -1, width, height, str, align)
  1382. buff.draw_text(1, 1, width, height, str, align)
  1383. buff.draw_text(0, -1, width, height, str, align)
  1384. buff.draw_text(0, 1, width, height, str, align)
  1385. buff.draw_text(0-1, 0, width, height, str, align)
  1386. buff.draw_text(1, 0, width, height, str, align)
  1387. buff.blur
  1388. # 描绘主文字
  1389. buff.font.color = self.font.color
  1390. buff.draw_text(0, 0, width, height, str, align)
  1391. self.blt(x, y, buff, Rect.new(0, 0, width, height))
  1392. buff.dispose
  1393. end
  1394. #--------------------------------------------------------------------------
  1395. # ○ 多层字
  1396. #--------------------------------------------------------------------------
  1397. def draw_sedimentary_text(x, y, width, height, str, align = 0, *color)
  1398. color.unshift font.color
  1399. sheet = (font.size.to_f / color.size).ceil
  1400. buff = Bitmap.new(width, sheet)
  1401. buff.font = font.clone
  1402. max = (height - font.size)/2 > 0 ? (height - font.size)/2 : 0
  1403. min = buff.font.size < height ? buff.font.size : height
  1404. color.each_index do |i|
  1405. buff.clear
  1406. buff.font.color = color[i]
  1407. buff.draw_text(0, -i*sheet, width, min, str, align)
  1408. blt(x, y+i*sheet+max, buff, Rect.new(0, 0, width, sheet))
  1409. break if i*sheet >= height
  1410. end
  1411. end
  1412. end
复制代码
记住啊,我只想知道怎么去掉该功能,不是别的什么避免该功能的办法, 这太麻烦了。
【我是ABC君,也可以叫我“银行君”“字母君”……】
斗罗大陆—火焰篇章》重新起航!!

Lv3.寻梦者

梦石
0
星屑
1428
在线时间
1705 小时
注册时间
2011-8-17
帖子
818
2
发表于 2012-12-31 22:37:15 | 只看该作者
1脚本198行MultiLinesWait = 30改成MultiLinesWait = 0
2脚本199行Choice_Strip = true 改成Choice_Strip= false

话说楼主都没认真看脚本,都有中文说明的

评分

参与人数 1星屑 +120 收起 理由
咕噜 + 120 认可答案

查看全部评分

roguelike求生RPG研发中....
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
51
在线时间
454 小时
注册时间
2012-7-31
帖子
579
3
 楼主| 发表于 2013-1-1 10:36:30 | 只看该作者
黑舞嗜 发表于 2012-12-31 22:37
1脚本198行MultiLinesWait = 30改成MultiLinesWait = 0
2脚本199行Choice_Strip = true 改成Choice_Strip=  ...

好吧,抱歉,我是没仔细看脚本,谢谢啦。
【我是ABC君,也可以叫我“银行君”“字母君”……】
斗罗大陆—火焰篇章》重新起航!!
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-27 20:01

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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