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

Project1

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

[已经解决] 关于存档画面一打开自动报错的问题

 关闭 [复制链接]

Lv4.逐梦者

梦石
0
星屑
5896
在线时间
492 小时
注册时间
2010-8-27
帖子
254
跳转到指定楼层
1
发表于 2011-9-8 16:32:06 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
1星屑
本帖最后由 zxlxp2006 于 2011-9-8 16:32 编辑

不论是手动打开存档页面还是用事件呼出还是存档读档啥的都会弹出脚本Window_SaveFile第37行出错的信息,这个脚本我没动过,还是原来那样啊……
  1.   #--------------------------------------------------------------------------
  2.   # ● 部分游戏数据。
  3.   #    开关和变量默认未使用 (地图名表示等扩张时使用) 。
  4.   #--------------------------------------------------------------------------
  5.   def load_gamedata
  6.     @time_stamp = Time.at(0)
  7.     @file_exist = FileTest.exist?(@filename)
  8.     if @file_exist
  9.       file = File.open(@filename, "r")
  10.       @time_stamp = file.mtime
  11.       begin
  12.         @characters     = Marshal.load(file)
  13.         @frame_count    = Marshal.load(file)
  14.         @last_bgm       = Marshal.load(file)
  15.         @last_bgs       = Marshal.load(file)
  16.         @game_system    = Marshal.load(file)
  17.         @game_message   = Marshal.load(file)
  18.         @game_switches  = Marshal.load(file)
  19.         @game_variables = Marshal.load(file)
  20.         @total_sec = @frame_count / Graphics.frame_rate
  21.       rescue
  22.         @file_exist = false
  23.       ensure
  24.         file.close
  25.       end
  26.     end
  27.   end
复制代码
这是脚本的一段,其中第十行的“@time_stamp = file.mtime”就是报错的那一行,现在测试游戏玩别人的游戏等等啥都做不了,紧急求助!!

P.S.之前下到过完整版的《漠游异世录》(VX的),不含工程文件的,一呼出菜单就会提示显示现实时间脚本出错,可没见别人有这问题啊……?是不是我电脑的问题?如果有玩过的童鞋,求解……

————————————————————————————————————————————————————
之前不会弄悬赏,现在会了~❤

最佳答案

查看完整内容

怀疑不是RM的问题。 file.mtime 是获取存档文件的最后修改时间。所以因该不是RM出问题。 试着把存档移动到别的文件夹让你的游戏的文件夹没有存档,再存一次试试。

Lv1.梦旅人

Mr.Gandum

梦石
0
星屑
226
在线时间
2070 小时
注册时间
2007-1-31
帖子
3039

贵宾

2
发表于 2011-9-8 16:32:07 | 只看该作者
怀疑不是RM的问题。
file.mtime
是获取存档文件的最后修改时间。所以因该不是RM出问题。
试着把存档移动到别的文件夹让你的游戏的文件夹没有存档,再存一次试试。

点评

谢谢,我试试看  发表于 2011-9-9 12:23
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
48
在线时间
678 小时
注册时间
2010-8-11
帖子
1533
3
发表于 2011-9-8 17:01:27 | 只看该作者
应该来说,没有修改脚本
是不会出错的
应该是某脚本冲突或者xx脚本xx地方没搞定= =
如果lz有跟存档窗口有关的脚本
试试把那个脚本注释/删掉
小艾工作室开张= =
回复

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
5896
在线时间
492 小时
注册时间
2010-8-27
帖子
254
4
 楼主| 发表于 2011-9-8 17:14:54 | 只看该作者
RPGmaster 发表于 2011-9-8 17:01
应该来说,没有修改脚本
是不会出错的
应该是某脚本冲突或者xx脚本xx地方没搞定= =

我只加了一个“华丽版显示地图名”,把Window_Message换了一下,之前还是好好的,重装系统之后重安了一次RM,刚安的时候也能用,后来不知怎的就成这样了……


zxlxp2006于2011-9-8 17:25补充以下内容:
  1. #==============================================================================
  2. # 跳转地图时显示地图名 by 沉影不器
  3. #------------------------------------------------------------------------------
  4. # 功能: 在初进地图时,渐显地图名,随后渐隐
  5. #       对于不需要显示地图名的地图,请在地图名里添加字符"@"
  6. #       自定义各个地图名显示动画: 在地图名后加"_数字"
  7. #       例: "戈壁_1"表示此地图显示的地图名为"戈壁",使用1号动画
  8. #==============================================================================
  9. # ■ Spriteset_Map
  10. #==============================================================================
  11. class Spriteset_Map
  12.   #--------------------------------------------------------------------------
  13.   # ● 参数
  14.   #--------------------------------------------------------------------------
  15.   # 基本设定
  16.   MAX_OPACITY = 192                      # 最大不透明度
  17.   SHOW_COUNT = 120                       # 显示时间(均以帧为单位)
  18.   TRANS_COUNT = 60                       # 渐变时间
  19.   NAME_WIN_WIDTH = 192                   # 名称窗体宽度
  20.   NAME_WIN_HEIGHT = 56                   # 名称窗体高度

  21.   # 美化选项
  22.   FONT_SIZE = 20                         # 名称字体大小
  23.   FONT_COLOR = Color.new(255,255,255)    # 名称字体颜色
  24.   FONT_SHADOW = true                     # 名称字体是否描绘阴影
  25.   SKIN = "Booky_Skin"                    # 名称窗体自定义皮肤(空字符时隐藏窗体)
  26.   ANIMATION_ID = 32                      # 显示名称时的动画 ID(0以下为无动画)
  27.   #--------------------------------------------------------------------------
  28.   # ● 初始化对象
  29.   #--------------------------------------------------------------------------
  30.   alias ini initialize
  31.   def initialize
  32.     # 获取地图名
  33.     name = get_map_name($game_map.map_id)
  34.     if $game_temp.old_map_name != name
  35.       $game_temp.old_map_name = name
  36.       unless name.include? "@"
  37.         create_name_window
  38.       end
  39.     end
  40.     ini
  41.   end
  42.   #--------------------------------------------------------------------------
  43.   # ○ 生成名窗体
  44.   #--------------------------------------------------------------------------
  45.   def create_name_window
  46.     # 初始化参数
  47.     @show_count = SHOW_COUNT
  48.     @trans_count_1 = TRANS_COUNT
  49.     @trans_count_2 = TRANS_COUNT
  50.     animation_id = get_animation_id($game_map.map_id)
  51.     animation_id = ANIMATION_ID if animation_id <= 0
  52.     # 显示动画
  53.     @name_animation = Sprite_Base.new(@viewport2)
  54.     @name_animation.x = Graphics.width/2
  55.     @name_animation.y = Graphics.height/2
  56.     if animation_id > 0
  57.       animation = $data_animations[animation_id]
  58.       if animation != nil
  59.         @name_animation.start_animation(animation)
  60.       else
  61.         p '指定动画不存在!'
  62.       end
  63.     end
  64.     x = (Graphics.width - NAME_WIN_WIDTH)/2
  65.     y = (Graphics.height - NAME_WIN_HEIGHT)/2
  66.     # 生成窗体
  67.     @name_window = Window_Base.new(x, y, NAME_WIN_WIDTH, NAME_WIN_HEIGHT)
  68.     @name_window.windowskin = Cache.system(SKIN)
  69.     @name_window.contents.font.size = FONT_SIZE
  70.     @name_window.contents.font.color = FONT_COLOR
  71.     @name_window.contents.font.shadow = FONT_SHADOW
  72.     @name_window.viewport = @viewport3
  73.     @name_window.opacity = 0
  74.     @name_window.contents_opacity = 0
  75.     # 地图名
  76.     text = $game_temp.old_map_name
  77.     @name_window.contents.draw_text(0,0,NAME_WIN_WIDTH-32,FONT_SIZE+4,text,1)
  78.   end
  79.   #--------------------------------------------------------------------------
  80.   # ○ 获取地图名
  81.   #     map_id : 地图 ID
  82.   #--------------------------------------------------------------------------
  83.   def get_map_name(map_id)
  84.     mapinfo = load_data("Data/MapInfos.rvdata")
  85.     result = mapinfo[map_id].name
  86.     return result.split(/,/)[0].split(/_/)[0]
  87.   end
  88.   #--------------------------------------------------------------------------
  89.   # ○ 获取动画 ID
  90.   #     map_id : 地图 ID
  91.   #--------------------------------------------------------------------------
  92.   def get_animation_id(map_id)
  93.     mapinfo = load_data("Data/MapInfos.rvdata")
  94.     result = mapinfo[map_id].name
  95.     return result.split(/,/)[0].split(/_/)[1].to_i
  96.   end
  97.   #--------------------------------------------------------------------------
  98.   # ○ 更新名窗体
  99.   #--------------------------------------------------------------------------
  100.   def update_name_window
  101.     return if @name_window == nil
  102.     # 已关闭时不需更新
  103.     return unless @name_window.visible
  104.     # 更新动画
  105.     @name_animation.update
  106.     # 渐现
  107.     if @trans_count_1 >= 0
  108.       @trans_count_1 -= 1
  109.       @name_window.opacity += MAX_OPACITY/TRANS_COUNT
  110.       @name_window.contents_opacity += MAX_OPACITY/TRANS_COUNT
  111.     end
  112.     # 显示时间计数
  113.     if @show_count >=0
  114.       @show_count -= 1
  115.     end
  116.     # 渐隐
  117.     if @show_count <= 0
  118.       if @trans_count_2 > 0
  119.         @trans_count_2 -= 1
  120.         @name_window.opacity -= MAX_OPACITY/TRANS_COUNT
  121.         @name_window.contents_opacity -= MAX_OPACITY/TRANS_COUNT
  122.       end
  123.       if @trans_count_2 <= 0
  124.         @name_window.visible = false
  125.       end
  126.     end
  127.   end
  128.   #--------------------------------------------------------------------------
  129.   # ● 释放
  130.   #--------------------------------------------------------------------------
  131.   alias old_dispose dispose
  132.   def dispose
  133.     old_dispose
  134.     return if @name_window == nil
  135.     @name_window.dispose
  136.     @name_animation.dispose
  137.   end
  138.   #--------------------------------------------------------------------------
  139.   # ● 刷新画面
  140.   #--------------------------------------------------------------------------
  141.   alias old_update update
  142.   def update
  143.     old_update
  144.     update_name_window
  145.   end
  146. end

  147. #==============================================================================
  148. # ■ Game_Temp
  149. #==============================================================================
  150. class Game_Temp
  151.   #--------------------------------------------------------------------------
  152.   # ● 定义实例变量
  153.   #--------------------------------------------------------------------------
  154.   attr_accessor :old_map_name        # 背景位图
  155.   #--------------------------------------------------------------------------
  156.   # ● 初始化对象
  157.   #--------------------------------------------------------------------------
  158.   alias ini initialize
  159.   def initialize
  160.     ini
  161.     @old_map_name = ""
  162.   end
  163. end
复制代码
  1. #==============================================================================
  2. # ■ [VX] 对话框加强版
  3. #    [VX] Window_message Plus
  4. #----------------------------------------------------------------------------
  5. # 使用说明:
  6. #
  7. #   ① 此脚本可代替默认的 Window_Message 全脚本
  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[aX]:更改字体附加效果为第X号效果
  23. #       附加样式列表:
  24. #         X=0 :无附加; X=1 :阴影字; X=2 :粗体字;
  25. #         X=4 :斜体字; X=8 :描边字; X=16:发光字
  26. #              叠加效果即数字相加,示例: 3:阴影+粗体  14:粗体+斜体+描边
  27. #              注意!此三种效果互斥: 阴影/描边/发光
  28. #
  29. #   ⑤ 在对话中显示(技能 物品 武器 防具)图标和名称的方法:
  30. #       \s[X]: 显示第X号技能图标和名称
  31. #       \i[X]: 显示第X号物品图标和名称
  32. #       \w[X]: 显示第X号武器图标和名称
  33. #       \a[X]: 显示第X号防具图标和名称
  34. #
  35. #   ⑥ 在对话中更改文字不透明度的方法:
  36. #       \o[X]: 把文字不透明度更改为X (取值范围在0~255)
  37. #
  38. #   ⑦ 指定时间后自动关闭对话框的方法:
  39. #       \x[X]: 对话框将在X帧后自动关闭
  40. #       \x:    省略参数时,将在AutoClose帧后自动关闭 (AutoClose在参数设定中)
  41. #
  42. #   ⑧ 调整文字显示速度的方法:
  43. #       \p[X]: 文字在X帧后显示
  44. #
  45. #   ⑨ 对话中更换对话框皮肤(或直接使用图片)的方法:
  46. #       \b[X]: 更改字体名称为"预设样式库"第X号样式 (预设样式库请看参数设定)
  47. #              注: vx对话框可使用Window皮肤或直接使用图片,请配合事件页设定
  48. #      素材格式和命名规则:
  49. #      
  50. #       在对应的Window皮肤或对话框图片的文件名后+"_pause",做为自定义暂停标记
  51. #       的名称,并和对应皮肤或图片文件放在一起.
  52. #
  53. #   ⑩ 启用头像动态显示的方法:
  54. #       \e[X]: 设定头像动态显示的值为X
  55. #       X=0 :关闭动态效果; X=1 :水平趋中; X=2 :渐显
  56. #
  57. # 参数设定在脚本第114~167行
  58. #------------------------------------------------------------------------------
  59. # 素材要求:
  60. #
  61. #   ① 采用vx默认头像素材(Graphics\Faces)的格式
  62. #      即每个素材文件由2行4列共8格头像组成
  63. #
  64. #   ② 要求所有头像朝向一致(默认是正面偏右)
  65. #
  66. #   ③ 自定义暂停标记的素材采用横向多帧格式,每帧图片大小一致
  67. #      注意: 帧数在脚本参数中设定.
  68. #      在对应的Window皮肤或对话框图片的文件名后+"_pause",做为自定义暂停标记
  69. #      的名称,并和对应皮肤或图片文件放在一起.
  70. #----------------------------------------------------------------------------
  71. #    更新作者: 沉影不器
  72. #    许可协议: FSL
  73. #    项目版本: 1.05.1007
  74. #    引用网址: http://rpg.blue/
  75. #----------------------------------------------------------------------------
  76. #    - *1.05.1007* (2010-10-07) By 沉影不器
  77. #      *修复 冒号被脚本占用而无法显示
  78. #      *优化 预处理部分数据
  79. #      *新增 自定义暂停标记
  80. #      *新增 全局和局部字速调整
  81. #      *新增 支持滚动显示多行对话内容
  82. #      *新增 显示动画功能(数据库动画/心情动画)
  83. #
  84. #    - *1.04.0207* (2009-02-07) By 沉影不器
  85. #      *新增 字体附加效果:发光字
  86. #      *新增 更换对话皮肤功能
  87. #      *新增 头像动态显现功能
  88. #
  89. #    - *1.03.1107* (2008-11-07) By 沉影不器
  90. #      *优化 字体附加效果的叠加方法
  91. #      *新增 字体附加效果:斜体字
  92. #
  93. #    - *1.02.1023* (2008-10-23) By 沉影不器
  94. #      *修复 自动关闭对话框时可能存在的关闭延后生效
  95. #      *新增 字体附加效果:无效果、阴影字、粗体字、描边字
  96. #      *新增 更改字体无效时,使用游戏默认字体
  97. #
  98. #    - *1.01.0911* (2008-09-11) By 沉影不器
  99. #      *新增 更改字体功能
  100. #      *新增 显示(技能 物品 武器 防具)图标和名称
  101. #      *新增 更改文字不透明度
  102. #      *新增 自动关闭对话框
  103. #
  104. #    - *1.00.0831* (2008-08-31) By 沉影不器
  105. #      *初版
  106. #==============================================================================
  107. $fscript = {} if $fscript == nil
  108. $fscript["Window_message_Plus"] = "1.05.1007"
  109. #----------------------------------------------------------------------------
  110. # ▼ 通用配置模块
  111. #----------------------------------------------------------------------------
  112. module FSL
  113.   module Window_message_Plus
  114.     # 超4行文字时,滚动显示的等待时间(0表示禁止)
  115.     MultiLinesWait = 30
  116.     # 确定键快速显示文字
  117.     FastShow = true
  118.    
  119.     # 自定义暂停标记
  120.     Pause_Custom = 3 # 暂停标记的位置(0:不使用 1:底边居中 2:右下角 3:跟随文字)
  121.     Pause_AdjX = -2  # 暂停标记的X坐标微调
  122.     Pause_AdjY = -2  # 暂停标记的Y坐标微调
  123.     Pause_AniCyc = 6 # 暂停标记的动画周期
  124.     Pause_AniFrm = 4 # 暂停标记的动画帧数
  125.    
  126.     # 预设字体库
  127.     Font_Lib = ["黑体", "仿宋_GB2312", "幼圆"]
  128.     # 字间距
  129.     Font_Space = 4
  130.    
  131.     # 描边颜色
  132.     EdgingColor = 15
  133.     # 发光颜色
  134.     RadiateColor = 10
  135.    
  136.     # 名称条参数
  137.     Name_Symbol = "【】"         # 为名称添加的修饰符(一对)
  138.     Name_SpaceX = 6              # 名称条宽度缩进值
  139.     Name_SpaceY = 6              # 名称与对话内容之间的附加距离
  140.     Name_FontIndex = 0           # 名称文字字体在预设字体库中的序号
  141.     Name_FontSize = 18           # 名称文字字号
  142.     Name_FontColor = 18          # 名称文字颜色
  143.     Name_FontAdj = 1             # 名称文字附加效果
  144.     NameBar_Color = 0            # 名称背景条颜色
  145.     NameBar_Opacity = 64         # 名称背景条透明度
  146.    
  147.     # 头像参数
  148.     Face_Enter = 1               # 头像显示模式
  149.     Face_EnterRate = 12          # 头像进入画面的时间   
  150.     Face_AdjX = 6                # 头像横坐标微调
  151.     Face_AdjY = -6               # 头像纵坐标微调
  152.     Face_Align = 2               # 头像垂直对齐方式
  153.                                  # 0:顶端对齐; 1:居中对齐; 2:底端对齐
  154.     # 对话框参数
  155.     Msg_FontName = 0             # 对话文字字体在预设字体库中的序号
  156.     Msg_FontSize = 16            # 对话文字字号
  157.     Msg_FontColor = 0            # 对话文字颜色
  158.     Msg_FontPlus = 1             # 对话文字附加效果
  159.    
  160.     # 预设样式库(其中"Window"和"MessageBack"是vx默认样式)
  161.     Msg_StyleLib = { 0=>["Window","Window"],         # Window皮肤
  162.                      1=>["MessageBack","MessageBack"]}       # 图片皮肤

  163.     # 自动关闭
  164.     AutoClose = 80               # 默认自动关闭时间(以帧计时)
  165.     # 全局文字速度
  166.     GlobalSpeed = 0              # 改变全局文字延时(以帧计时)
  167.   end
  168. end
  169. #==============================================================================
  170. # ■ Window_Message
  171. #==============================================================================
  172. class Window_Message < Window_Selectable
  173.   include FSL::Window_message_Plus
  174.   #--------------------------------------------------------------------------
  175.   # ● 常量
  176.   #--------------------------------------------------------------------------
  177.   MAX_LINE = 4                            # 最大行数
  178.   #--------------------------------------------------------------------------
  179.   # ◎ 初始化对象
  180.   #--------------------------------------------------------------------------
  181.   def initialize
  182.     h = [Name_FontSize,Msg_FontSize].max + Name_SpaceY +
  183.          (Msg_FontSize+Font_Space)*(MAX_LINE-1) + 34
  184.     y = Graphics.height - h
  185.     super(0, y, Graphics.width, h)
  186.     self.z = 200
  187.     self.active = false
  188.     self.index = -1
  189.     self.openness = 0
  190.     @opening = false            # 窗口正在打开的标志
  191.     @closing = false            # 窗口正在关闭的标志
  192.     @text = nil                 # 已经没有可显示的文章
  193.     @contents_x = 0             # 下一条文字描绘的 X 坐标
  194.     @contents_y = 0             # 下一条文字描绘的 Y 坐标
  195.     @line_count = 0             # 现在描绘的行数
  196.     @wait_count = 0             # 等待计数
  197.     @background = 0             # 背景类型
  198.     @position = 2               # 显示位置
  199.     @show_fast = false          # 快速显示标志
  200.     @line_show_fast = false     # 以行为单位快速显示
  201.     @pause_skip = false         # 省略等待输入标志
  202.     # 显示名称
  203.     @show_name = false
  204.     # 自定义暂停标记
  205.     @custom_pause = false if Pause_Custom > 0
  206.     # 多行对话框标记
  207.     @multi_lines = false
  208.     # 字体附加效果
  209.     @font_adj = Msg_FontPlus
  210.     # 描边和发光字的自设颜色
  211.     @stroke_color = EdgingColor
  212.     @radiate_color = RadiateColor
  213.     create_gold_window
  214.     create_number_input_window
  215.     create_back_sprite
  216.     # 头像左右判断
  217.     @show_right = false
  218.     # 头像宽度
  219.     @face_width = 0
  220.     # 生成自定义暂停标记
  221.     create_custom_pause
  222.     # 生成名称背景条
  223.     create_namebar_sprite
  224.     # 生成头像
  225.     create_face_sprite
  226.     # 修改默认字体
  227.     contents.font = get_font(1)
  228.   end
  229.   #--------------------------------------------------------------------------
  230.   # ● 释放
  231.   #--------------------------------------------------------------------------
  232.   def dispose
  233.     super
  234.     dispose_gold_window
  235.     dispose_number_input_window
  236.     dispose_back_sprite
  237.   end
  238.   #--------------------------------------------------------------------------
  239.   # ◎ 更新画面
  240.   #--------------------------------------------------------------------------
  241.   def update
  242.     super
  243.     update_gold_window
  244.     update_number_input_window
  245.     update_back_sprite
  246.     update_show_fast
  247.     # 更新自定义暂停标记
  248.     update_custom_pause
  249.     unless @opening or @closing             # 除窗口关闭以外
  250.       if @wait_count > 0                    # 文章内等待中
  251.         @wait_count -= 1
  252.       elsif @multi_lines
  253.         scroll_line
  254.       elsif custom_pause                   # 等待文章翻页待机中
  255.         input_pause
  256.       elsif self.active                     # 正在输入选择项
  257.         input_choice
  258.       elsif @number_input_window.visible    # 正在输入数值
  259.         input_number
  260.       elsif @text != nil                    # 还有剩余的文章
  261.         update_message                        # 更新消息
  262.       elsif continue?                       # 继续的情况
  263.         start_message                         # 开始消息
  264.         open                                  # 打开窗口
  265.         $game_message.visible = true
  266.       else                                  # 不继续的情况
  267.         close                                 # 关闭窗口
  268.         $game_message.visible = @closing
  269.       end
  270.     end
  271.     # 头像动态显现
  272.     if @face_sprite.visible
  273.       # 水平趋中
  274.       result =  @face_x <=> @face_sprite.x
  275.       x_enter = [(@face_x - @face_sprite.x).abs,Face_EnterRate].min
  276.       @face_sprite.x += x_enter if result > 0
  277.       @face_sprite.x -= x_enter if result < 0
  278.       # 渐显
  279.       @face_sprite.opacity += Face_EnterRate if @face_sprite.opacity < 255
  280.     end
  281.     # 自动关闭对话框
  282.     if @auto_close != nil
  283.       if @auto_close > 0
  284.         @auto_close -= 1
  285.       else
  286.         terminate_message
  287.       end
  288.     end
  289.   end
  290.   #--------------------------------------------------------------------------
  291.   # ◎ 生成所持金窗口
  292.   #--------------------------------------------------------------------------
  293.   def create_gold_window
  294.     @gold_window = Window_Gold.new(384, 0)
  295.     @gold_window.openness = 0
  296.     # 统一字体
  297.     @gold_window.contents.font = get_font(1)
  298.   end
  299.   #--------------------------------------------------------------------------
  300.   # ◎ 生成数值输入窗口
  301.   #--------------------------------------------------------------------------
  302.   def create_number_input_window
  303.     @number_input_window = Window_NumberInput.new
  304.     @number_input_window.visible = false
  305.     # 统一字体
  306.     @number_input_window.contents.font = get_font(1)
  307.   end
  308.   #--------------------------------------------------------------------------
  309.   # ● 生成背景活动块
  310.   #--------------------------------------------------------------------------
  311.   def create_back_sprite
  312.     @back_sprite = Sprite.new
  313.     @back_sprite.bitmap = Cache.system("MessageBack")
  314.     @back_sprite.visible = (@background == 1)
  315.     @back_sprite.z = 190
  316.   end
  317.   #--------------------------------------------------------------------------
  318.   # ● 释放所持金窗口
  319.   #--------------------------------------------------------------------------
  320.   def dispose_gold_window
  321.     @gold_window.dispose
  322.   end
  323.   #--------------------------------------------------------------------------
  324.   # ● 释放数值输入窗口
  325.   #--------------------------------------------------------------------------
  326.   def dispose_number_input_window
  327.     @number_input_window.dispose
  328.   end
  329.   #--------------------------------------------------------------------------
  330.   # ● 释放背景活动块
  331.   #--------------------------------------------------------------------------
  332.   def dispose_back_sprite
  333.     @back_sprite.dispose
  334.   end
  335.   #--------------------------------------------------------------------------
  336.   # ● 更新所持金窗口
  337.   #--------------------------------------------------------------------------
  338.   def update_gold_window
  339.     @gold_window.update
  340.   end
  341.   #--------------------------------------------------------------------------
  342.   # ● 更新数值输入窗口
  343.   #--------------------------------------------------------------------------
  344.   def update_number_input_window
  345.     @number_input_window.update
  346.   end
  347.   #--------------------------------------------------------------------------
  348.   # ● 更新背景活动块
  349.   #--------------------------------------------------------------------------
  350.   def update_back_sprite
  351.     @back_sprite.visible = (@background == 1)
  352.     @back_sprite.y = y - 16
  353.     @back_sprite.opacity = openness
  354.     @back_sprite.update
  355.   end
  356.   #--------------------------------------------------------------------------
  357.   # ◎ 更新快速显示标志
  358.   #--------------------------------------------------------------------------
  359.   def update_show_fast
  360.     if custom_pause or self.openness < 255
  361.       @show_fast = false
  362.     elsif Input.trigger?(Input::C)
  363.       if FastShow
  364.         @show_fast = true
  365.         @wait_count = 0
  366.       end
  367.     elsif not Input.press?(Input::C)
  368.       @show_fast = false
  369.     end
  370.     if @show_fast and @wait_count > 0
  371.       @wait_count -= 1
  372.     end
  373.   end
  374.   #--------------------------------------------------------------------------
  375.   # ● 判断下一消息继续显示
  376.   #--------------------------------------------------------------------------
  377.   def continue?
  378.     return true if $game_message.num_input_variable_id > 0
  379.     return false if $game_message.texts.empty?
  380.     if self.openness > 0 and not $game_temp.in_battle
  381.       return false if @background != $game_message.background
  382.       return false if @position != $game_message.position
  383.     end
  384.     return true
  385.   end
  386.   #--------------------------------------------------------------------------
  387.   # ◎ 开始显示消息
  388.   #--------------------------------------------------------------------------
  389.   def start_message
  390.     # 重设窗口背景与位置
  391.     reset_window
  392.     # 还原头像左右判断
  393.     @show_right = false
  394.     # 暂存消息
  395.     temp_texts = []
  396.     $game_message.texts.each do |text|
  397.       tmp = text.clone
  398.       # 判断对话框皮肤
  399.       if tmp.sub!(/\\B\[(\d+)\]/i) { "" }
  400.         filename = Msg_StyleLib[@background][$1.to_i]
  401.         if @background == 0
  402.           self.windowskin = Cache.system(filename)
  403.           if Pause_Custom>0 && !@pause_sprite.nil? && !@pause_sprite.disposed?
  404.             @pause_sprite.bitmap = Cache.system(filename + "_pause")
  405.           end
  406.         else
  407.           @back_sprite.bitmap = Cache.system(filename)
  408.           if Pause_Custom>0 && !@pause_sprite.nil? && !@pause_sprite.disposed?
  409.             @pause_sprite.bitmap = Cache.system(filename + "_pause")
  410.           end
  411.         end
  412.         # 开始自定义暂停标记动画
  413.         @pause_aniindex = -1
  414.       end
  415.       # 判断头像显现
  416.       @face_enter = $1.to_i if tmp.sub!(/\\E\[(\d+)\]/i) { "" }
  417.       temp_texts.push(tmp)
  418.     end
  419.     # 判断头像方向
  420.     if !temp_texts[0].nil? and temp_texts[0].sub!(/@R/i){ "" }
  421.       @show_right = true
  422.     end
  423.     # 判断名称
  424.     if temp_texts[0] != nil and temp_texts[0] =~ /[::]/
  425.       if temp_texts[0] =~ /\\[::]/
  426.         # 忽略名称的处理
  427.         temp_texts[0].sub!(/\\:/)  { ":" }
  428.         temp_texts[0].sub!(/\\:/) { ":" }
  429.       else
  430.         # 去冒号加修饰符(可选)
  431.         unless Name_Symbol.empty?
  432.           temp_texts[0].sub!(/[::]/) { "" }
  433.           temp_texts[0] = Name_Symbol[0,Name_Symbol.size/2] +
  434.           temp_texts[0] + Name_Symbol[Name_Symbol.size/2,Name_Symbol.size/2]
  435.         end
  436.         # 设定文字颜色
  437.         temp_texts[0] = "\\C[#{Name_FontColor}]" +
  438.         temp_texts[0] + "\\C[#{Msg_FontColor}]"
  439.         # 设定文字字体
  440.         temp_texts[0] = "\\F[N#{Name_FontIndex}]" +
  441.         temp_texts[0] + "\\F[N#{Msg_FontName}]"
  442.         # 设定文字大小
  443.         temp_texts[0] = "\\F[S#{Name_FontSize}]" +
  444.         temp_texts[0] + "\\F[S#{Msg_FontSize}]"
  445.         # 设定文字附加效果
  446.         temp_texts[0] = "\\F[A#{Name_FontAdj}]" +
  447.         temp_texts[0] + "\\F[A#{Msg_FontPlus}]"
  448.         # 显示名称背景条
  449.         show_namebar_sprite
  450.       end
  451.     end
  452.     @text = ""
  453.     for i in 0...temp_texts.size
  454.       @text += "  " if i >= $game_message.choice_start
  455.       @text += temp_texts[i].clone + "\x00"
  456.     end
  457.     @item_max = $game_message.choice_max
  458.     convert_special_characters
  459.     new_page
  460.   end
  461.   #--------------------------------------------------------------------------
  462.   # ◎ 更换页面处理
  463.   #--------------------------------------------------------------------------
  464.   def new_page
  465.     contents.clear
  466.     # 初始化文字描绘起点
  467.     @contents_x = 0
  468.     # 除名称外文字右移1字符
  469.     @contents_x += Msg_FontSize+Font_Space unless @show_name
  470.     if $game_message.face_name.empty?
  471.       @face_sprite.bitmap.clear
  472.     else
  473.       name = $game_message.face_name
  474.       index = $game_message.face_index
  475.       # 获取头像宽度
  476.       set_face_width(name)
  477.       # 计算文字横坐标起始
  478.       @contents_x += @face_width-16 unless @show_right
  479.       draw_msg_face(name, index)
  480.       # 设定头像坐标
  481.       set_face_plus
  482.     end
  483.     @contents_y = 0
  484.     @line_count = 0
  485.     @show_fast = false
  486.     @line_show_fast = false
  487.     @pause_skip = false
  488.     contents.font.color = text_color(0)
  489.   end
  490.   #--------------------------------------------------------------------------
  491.   # ◎ 换行处理
  492.   #--------------------------------------------------------------------------
  493.   def new_line
  494.     # 提前处理自定义暂停标记
  495.     set_custom_pause_pos
  496.     @contents_x = 0
  497.     unless $game_message.face_name.empty?
  498.       # 头像显示在左时
  499.       @contents_x = @face_width-16 unless @show_right
  500.     end
  501.     # 除名称外文字右移1字符
  502.     @contents_x += (Msg_FontSize+Font_Space)
  503.     # 显示名称之后,对话内容下移 Name_SpaceY
  504.     @contents_y += Name_SpaceY if @line_count == 0 and @show_name
  505.     # 以字号为新间距
  506.     @contents_y += (Msg_FontSize+Font_Space)
  507.     @line_count += 1
  508.     @line_show_fast = false
  509.   end
  510.   #--------------------------------------------------------------------------
  511.   # ◎ 特殊文字变换
  512.   #--------------------------------------------------------------------------
  513.   def convert_special_characters
  514.    
  515.     @text.gsub!(/\\V\[(\d+)\]/i) {$game_variables[$1.to_i]}
  516.     @text.gsub!(/\\V\[(\d+)\]/i) {$game_variables[$1.to_i]}
  517.     @text.gsub!(/\\N\[(\d+)\]/i) {$game_actors[$1.to_i].name}
  518.     @text.gsub!(/\\C\[(\d+)\]/i) {"\x01[#{$1}]"}
  519.     @text.gsub!(/\\G/)           {"\x02"}
  520.     @text.gsub!(/\\\./)          {"\x03"}
  521.     @text.gsub!(/\\\|/)          {"\x04"}
  522.     @text.gsub!(/\\!/)           {"\x05"}
  523.     @text.gsub!(/\\>/)           {"\x06"}
  524.     @text.gsub!(/\\</)           {"\x07"}
  525.     @text.gsub!(/\\\^/)          {"\x08"}
  526.     @text.gsub!(/\\\\/)          {"\\"}
  527.     # 更改不透明度
  528.     @text.gsub!(/\\O\[(\d+)\]/i) {"\x09[#{$1}]"}
  529.     # 显示数据库元素
  530.     @text.gsub!(/\\S\[(\d+)\]/i) {"\x0a[#{$1}]" + $data_skills[$1.to_i].name}
  531.     @text.gsub!(/\\I\[(\d+)\]/i) {"\x0b[#{$1}]" + $data_items[$1.to_i].name}
  532.     @text.gsub!(/\\W\[(\d+)\]/i) {"\x0c[#{$1}]" + $data_weapons[$1.to_i].name}
  533.     @text.gsub!(/\\A\[(\d+)\]/i) {"\x0d[#{$1}]" + $data_armors[$1.to_i].name}
  534.     # 更改字体
  535.     @text.gsub!(/\\F\[S(\d+)\]/i){"\x0e[#{$1}]"}
  536.     @text.gsub!(/\\F\[N(\d+)\]/i){"\x0f[#{$1}]"}
  537.     @text.gsub!(/\\F\[C(\d+)\]/i){"\x10[#{$1}]"}
  538.     # 字体附加效果
  539.     @text.gsub!(/\\F\[A(\d+)\]/i){"\x11[#{$1}]"}
  540.     # 自动关闭
  541.     @text.gsub!(/\\X\[(\d+)\]/i) {"\x12[#{$1}]"}
  542.     @text.gsub!(/\\X/i)          {"\x13"}
  543.     # 字速控制
  544.     @text.gsub!(/\\P\[(\d+)\]/i) {"\x14[#{$1}]"}
  545.     ## 提取动画对象和 ID
  546.     @text.gsub!(/\\A\[(\S+)\,(\d+)\]/i) {"\x15[#{$1},#{$2}]"}
  547.     @text.gsub!(/\\B\[(\S+)\,(\d+)\]/i) {"\x16[#{$1},#{$2}]"}
  548.   end
  549.   #--------------------------------------------------------------------------
  550.   # ◎ 设置窗口背景与位置
  551.   #--------------------------------------------------------------------------
  552.   def reset_window
  553.     @background = $game_message.background
  554.     @position = $game_message.position
  555.     if @background == 0   # 普通窗口
  556.       self.opacity = 255
  557.     else                  # 背景变暗、透明
  558.       self.opacity = 0
  559.     end
  560.     case @position
  561.     when 0  # 上
  562.       fh = get_face_height($game_message.face_name)
  563.       self.y = fh-self.height-Face_AdjY
  564.       self.y = 0 if self.y < 0
  565.       @gold_window.y = 360
  566.     when 1  # 中
  567.       # 通过计算获取
  568.       self.y = (Graphics.height-self.height)/2
  569.       @gold_window.y = 0
  570.     when 2  # 下
  571.       # 通过计算获取
  572.       self.y = Graphics.height-self.height
  573.       @gold_window.y = 0
  574.     end
  575.   end
  576.   #--------------------------------------------------------------------------
  577.   # ◎ 消息结束
  578.   #--------------------------------------------------------------------------
  579.   def terminate_message
  580.     self.active = false
  581.     self.custom_pause = false
  582.     self.index = -1
  583.     @gold_window.close
  584.     @number_input_window.active = false
  585.     @number_input_window.visible = false
  586.     $game_message.main_proc.call if $game_message.main_proc != nil
  587.     $game_message.clear
  588.     # 还原自动关闭
  589.     @auto_close = nil
  590.     # 处理名称背景条和头像
  591.     @show_name = false
  592.     @namebar_sprite.visible = false
  593.     @face_sprite.visible = false
  594.     @face_sprite.bitmap.clear
  595.   end
  596.   #--------------------------------------------------------------------------
  597.   # ◎ 更新消息
  598.   #--------------------------------------------------------------------------
  599.   def update_message
  600.     loop do
  601.       c = @text.slice!(/./m)            # 获取下一条文字
  602.       case c
  603.       when nil                          # 没有可以显示的文字
  604.         finish_message                  # 更新结束
  605.         break
  606.       when "\x00"                       # 换行
  607.         new_line
  608.         if @line_count >= MAX_LINE      # 行数为最大时
  609.           unless @text.empty?           # 如果还有增加则继续
  610.             @wait_count = MultiLinesWait# 等待滚动
  611.             @multi_lines = true
  612.             break
  613.           end
  614.         end
  615.       when "\x01"                       # \C[n]  (更改文字色)
  616.         @text.sub!(/\[([0-9]+)\]/, "")
  617.         contents.font.color = text_color($1.to_i)
  618.         next
  619.       when "\x02"                       # \G  (显示所持金)
  620.         @gold_window.refresh
  621.         @gold_window.open
  622.       when "\x03"                       # \.  (等待 1/4 秒)
  623.         @wait_count = 15
  624.         break
  625.       when "\x04"                       # \|  (等待 1 秒)
  626.         @wait_count = 60
  627.         break
  628.       when "\x05"                       # \!  (等待输入)
  629.         self.custom_pause = true
  630.         break
  631.       when "\x06"                       # \>  (瞬间显示 ON)
  632.         @line_show_fast = true
  633.       when "\x07"                       # \<  (瞬间显示 OFF)
  634.         @line_show_fast = false
  635.       when "\x08"                       # \^  (不等待输入)
  636.         @pause_skip = true
  637.       # 更改不透明度的情况下
  638.       when "\x09"
  639.         @text.sub!(/\[(\d+)\]/, "")
  640.         contents.font.color.alpha = $1.to_i
  641.       # 显示技能情况下
  642.       when "\x0a"
  643.         @text.sub!(/\[(\d+)\]/, "")
  644.         draw_icon($data_skills[$1.to_i].icon_index, @contents_x, @contents_y)
  645.         # 横坐标增加图标宽度
  646.         @contents_x += 24
  647.       # 显示物品情况下
  648.       when "\x0b"
  649.         @text.sub!(/\[(\d+)\]/, "")
  650.         draw_icon($data_items[$1.to_i].icon_index, @contents_x, @contents_y)
  651.         # 横坐标增加图标宽度
  652.         @contents_x += 24
  653.       # 显示武器情况下
  654.       when "\x0c"
  655.         @text.sub!(/\[(\d+)\]/, "")
  656.         draw_icon($data_weapons[$1.to_i].icon_index, @contents_x, @contents_y)
  657.         # 横坐标增加图标宽度
  658.         @contents_x += 24
  659.       # 显示防具情况下
  660.       when "\x0d"
  661.         @text.sub!(/\[(\d+)\]/, "")
  662.         draw_icon($data_armors[$1.to_i].icon_index, @contents_x, @contents_y)
  663.         # 横坐标增加图标宽度
  664.         @contents_x += 24
  665.       # 更改字体的情况下
  666.       when "\x0e"
  667.         @text.sub!(/\[(\d+)\]/, "")
  668.         contents.font.size = $1.to_i
  669.       when "\x0f"
  670.         @text.sub!(/\[(\d+)\]/, "")
  671.         contents.font.name = Font_Lib[$1.to_i]
  672.       when "\x10"
  673.         @text.sub!(/\[(\d+)\]/, "")
  674.         contents.font.color = text_color($1.to_i)
  675.       # 字体附加效果
  676.       when "\x11"
  677.         @text.sub!(/\[(\d+)\]/, "")
  678.         # 获取字体附加效果
  679.         @font_adj = $1.to_i
  680.       # 自动关闭对话框的情况下
  681.       when "\x12"
  682.         @text.sub!(/\[(\d+)\]/, "")
  683.         @auto_close = $1.to_i
  684.       when "\x13"
  685.         @auto_close = AutoClose
  686.       # \P[n] (字速)
  687.       # 普通文字的情况下
  688.       when "\x14"
  689.         @text.sub!(/\[(\d+)\]/, "")
  690.         # 获取字体显示速度
  691.         @speed = $1.to_i
  692.       # 显示角色动画
  693.       when "\x15"
  694.         @text.sub!(/\[(\S+)\,(\d+)\]/, "")
  695.         character = $game_map.interpreter.get_character($1.to_i)
  696.         character.animation_id = $2.to_i unless character.nil?
  697.         next
  698.       # 显示心情动画
  699.       when "\x16"
  700.         @text.sub!(/\[(\S+)\,(\d+)\]/, "")
  701.         character = $game_map.interpreter.get_character($1.to_i)
  702.         character.balloon_id = $2.to_i unless character.nil?
  703.         next
  704.        else
  705.         # 字速控制
  706.         @wait_count = GlobalSpeed
  707.         @wait_count = @speed if @speed != nil
  708.         h = contents.font.size + Font_Space
  709.         # 字体附加效果
  710.         if @font_adj & 1 != 0
  711.           contents.font.shadow = true
  712.         else
  713.           contents.font.shadow = false
  714.         end
  715.         if @font_adj & 2 != 0
  716.           contents.font.bold = true
  717.         else
  718.           contents.font.bold = false
  719.         end
  720.         if @font_adj & 4 != 0
  721.           contents.font.italic = true
  722.         else
  723.           contents.font.italic = false
  724.         end
  725.         if @font_adj & 8 != 0#draw_stroke_text
  726.           color = text_color(@stroke_color)
  727.           contents.draw_stroke_text(@contents_x,@contents_y,h,h,c,0,color)
  728.         elsif @font_adj & 16 != 0#draw_radiate_text
  729.           color = text_color(@radiate_color)
  730.           contents.draw_radiate_text(@contents_x,@contents_y,h,h,c,0,color)
  731.         else
  732.           contents.draw_text(@contents_x, @contents_y, h, h, c)
  733.         end
  734.         c_width = contents.text_size(c).width
  735.         @contents_x += c_width
  736.       end
  737.       break unless @show_fast or @line_show_fast
  738.     end
  739.   end
  740.   #--------------------------------------------------------------------------
  741.   # ◎ 消息更新结束
  742.   #--------------------------------------------------------------------------
  743.   def finish_message
  744.     if $game_message.choice_max > 0
  745.       start_choice
  746.     elsif $game_message.num_input_variable_id > 0
  747.       start_number_input
  748.     elsif @pause_skip
  749.       terminate_message
  750.     else
  751.       self.custom_pause = true
  752.     end
  753.     @wait_count = 10
  754.     @text = nil
  755.     # 临时字速还原
  756.     @speed = nil
  757.   end
  758.   #--------------------------------------------------------------------------
  759.   # ● 开始选择项
  760.   #--------------------------------------------------------------------------
  761.   def start_choice
  762.     self.active = true
  763.     self.index = 0
  764.   end
  765.   #--------------------------------------------------------------------------
  766.   # ◎ 开始输入数值
  767.   #--------------------------------------------------------------------------
  768.   def start_number_input
  769.     digits_max = $game_message.num_input_digits_max
  770.     number = $game_variables[$game_message.num_input_variable_id]
  771.     @number_input_window.digits_max = digits_max
  772.     @number_input_window.number = number
  773.     if $game_message.face_name.empty?
  774.       @number_input_window.x = x
  775.     else
  776.       # 代入头像宽度
  777.       @number_input_window.x = @show_right ? x : x + @face_width
  778.     end
  779.     @number_input_window.y = y + @contents_y
  780.     @number_input_window.active = true
  781.     @number_input_window.visible = true
  782.     @number_input_window.update
  783.   end
  784.   #--------------------------------------------------------------------------
  785.   # ◎ 更新光标 ###可能仍须增加判断
  786.   #--------------------------------------------------------------------------
  787.   def update_cursor
  788.     if @index >= 0
  789.       if $game_message.face_name.empty?
  790.         x = 0
  791.         y = ($game_message.choice_start+@index)*(Msg_FontSize+Font_Space)
  792.         width = contents.width
  793.       else
  794.         x = @show_right ? 0 : @face_width
  795.         y = ($game_message.choice_start+@index)*(Msg_FontSize+Font_Space) +
  796.              Name_SpaceY
  797.         width = contents.width - @face_width
  798.       end
  799.       self.cursor_rect.set(x, y, width, (Msg_FontSize+Font_Space))
  800.     else
  801.       self.cursor_rect.empty
  802.     end
  803.   end
  804.   #--------------------------------------------------------------------------
  805.   # ● 文章显示输入处理
  806.   #--------------------------------------------------------------------------
  807.   def input_pause
  808.     if Input.trigger?(Input::B) or Input.trigger?(Input::C)
  809.       self.custom_pause = false
  810.       if @text != nil and not @text.empty?
  811.         new_page if @line_count >= MAX_LINE
  812.       else
  813.         terminate_message
  814.       end
  815.     end
  816.   end
  817.   #--------------------------------------------------------------------------
  818.   # ● 选择项输入处理
  819.   #--------------------------------------------------------------------------
  820.   def input_choice
  821.     if Input.trigger?(Input::B)
  822.       if $game_message.choice_cancel_type > 0
  823.         Sound.play_cancel
  824.         $game_message.choice_proc.call($game_message.choice_cancel_type - 1)
  825.         terminate_message
  826.       end
  827.     elsif Input.trigger?(Input::C)
  828.       Sound.play_decision
  829.       $game_message.choice_proc.call(self.index)
  830.       terminate_message
  831.     end
  832.   end
  833.   #--------------------------------------------------------------------------
  834.   # ● 数值输入处理
  835.   #--------------------------------------------------------------------------
  836.   def input_number
  837.     if Input.trigger?(Input::C)
  838.       Sound.play_decision
  839.       $game_variables[$game_message.num_input_variable_id] =
  840.         @number_input_window.number
  841.       $game_map.need_refresh = true
  842.       terminate_message
  843.     end
  844.   end
  845.   #--------------------------------------------------------------------------
  846.   # ○ 生成名称背景条
  847.   #--------------------------------------------------------------------------
  848.   def create_namebar_sprite
  849.     @namebar_sprite = Sprite.new
  850.     @namebar_sprite.bitmap = Bitmap.new(width-Name_SpaceX, Name_FontSize+4)
  851.     # 可视性
  852.     @namebar_sprite.visible = false
  853.     # 准备参数
  854.     rect = Rect.new(Name_SpaceX,0,@namebar_sprite.width,@namebar_sprite.height)
  855.     color1 = text_color(NameBar_Color)
  856.     color2 = text_color(NameBar_Color)
  857.     color1.alpha = NameBar_Opacity
  858.     color2.alpha = 0
  859.     # 描绘渐变条
  860.     @namebar_sprite.bitmap.gradient_fill_rect(rect, color1, color2)
  861.   end
  862.   #--------------------------------------------------------------------------
  863.   # ○ 生成头像
  864.   #--------------------------------------------------------------------------
  865.   def create_face_sprite
  866.     @face_sprite = Sprite.new
  867.     @face_sprite.bitmap = Bitmap.new(1,1)
  868.     @face_sprite.z = self.z + 2
  869.     @face_sprite.visible = false
  870.     @old_name = ""                        # 判断头像是否改变
  871.     @old_index = 0                        # 判断头像是否改变
  872.     @face_enter = Face_Enter              # 头像显示模式
  873.   end
  874.   #--------------------------------------------------------------------------
  875.   # ○ 显示名称背景条
  876.   #--------------------------------------------------------------------------
  877.   def show_namebar_sprite
  878.     @show_name = true
  879.     return if @background == 1
  880.     # 坐标跟随
  881.     @namebar_sprite.x = self.x
  882.     @namebar_sprite.y = self.y + 16 - 1
  883.     @namebar_sprite.z = self.z + 1
  884.     # 可视性
  885.     @namebar_sprite.visible = true
  886.   end
  887.   #--------------------------------------------------------------------------
  888.   # ○ 描绘头像
  889.   #     face_name  : 头像图像文件名
  890.   #     face_index : 头像图像索引
  891.   #--------------------------------------------------------------------------
  892.   def draw_msg_face(face_name, face_index)
  893.     bitmap = Cache.face(face_name)
  894.     width = bitmap.width / 4
  895.     height = bitmap.height / 2
  896.     rect = Rect.new(0, 0, 0, 0)
  897.     rect.x = face_index % 4 * width
  898.     rect.y = face_index / 4 * height
  899.     rect.width = width
  900.     rect.height = height
  901.     @face_sprite.bitmap = Bitmap.new(width, height)
  902.     @face_sprite.bitmap.blt(0, 0, bitmap, rect)
  903.     @face_sprite.mirror = @show_right
  904.   end
  905.   #--------------------------------------------------------------------------
  906.   # ○ 生成自定义暂停标记
  907.   #--------------------------------------------------------------------------
  908.   def create_custom_pause
  909.     return if Pause_Custom == 0
  910.     @pause_sprite = Sprite.new
  911.     @pause_sprite.visible = false
  912.     @pause_sprite.z = self.z + 3
  913.     @pause_sprite.bitmap = Cache.system("Window_pause")
  914.     @pause_aniindex = -1
  915.     @pause_anispeed = 0
  916.   end
  917.   #--------------------------------------------------------------------------
  918.   # ○ 获取暂停标记
  919.   #--------------------------------------------------------------------------
  920.   def custom_pause
  921.     return @custom_pause
  922.   end
  923.   #--------------------------------------------------------------------------
  924.   # ○ 更改暂停标记
  925.   #--------------------------------------------------------------------------
  926.   def custom_pause=(val)
  927.     @custom_pause = val
  928.     self.pause = val if Pause_Custom == 0
  929.   end
  930.   #--------------------------------------------------------------------------
  931.   # ○ 更新暂停标记
  932.   #--------------------------------------------------------------------------
  933.   def update_custom_pause
  934.     return if Pause_Custom == 0
  935.     @pause_sprite.visible = @custom_pause
  936.     @pause_sprite.visible = false if @pause_aniindex == -1
  937.     return if !@custom_pause
  938.     if @pause_anispeed > 0
  939.       @pause_anispeed -= 1
  940.     else
  941.       @pause_aniindex = (@pause_aniindex + 1) % Pause_AniFrm
  942.       pw = @pause_sprite.bitmap.width / Pause_AniFrm
  943.       ph = @pause_sprite.bitmap.height
  944.       @pause_sprite.src_rect.set(@pause_aniindex*pw, 0, pw, ph)
  945.       @pause_anispeed = Pause_AniCyc
  946.     end
  947.   end
  948.   #--------------------------------------------------------------------------
  949.   # ○ 设定暂停标记坐标
  950.   #--------------------------------------------------------------------------
  951.   def set_custom_pause_pos
  952.     return if Pause_Custom == 0
  953.     #@pause_sprite.visible = false
  954.     pw = @pause_sprite.bitmap.width / Pause_AniFrm
  955.     ph = @pause_sprite.bitmap.height
  956.     case Pause_Custom
  957.     when 1 # 底边居中
  958.       @pause_sprite.x = self.x + (self.width - pw)/2
  959.       @pause_sprite.y = self.y + self.height - ph
  960.     when 2 # 右下角
  961.       @pause_sprite.x = self.x + self.width - pw
  962.       @pause_sprite.y = self.y + self.height - ph
  963.       @pause_sprite.x -= @face_width if @show_right
  964.     when 3 # 文字后
  965.       @pause_sprite.x = self.x + @contents_x + Msg_FontSize + Font_Space
  966.       @pause_sprite.y = self.y + @contents_y + Msg_FontSize + Font_Space
  967.     end
  968.     @pause_sprite.x += Pause_AdjX
  969.     @pause_sprite.y += Pause_AdjY
  970.     #@pause_sprite.visible = @custom_pause
  971.   end
  972.   #--------------------------------------------------------------------------
  973.   # ○ 滚动换行
  974.   #--------------------------------------------------------------------------
  975.   def scroll_line
  976.     w = self.width - 32
  977.     hm = Msg_FontSize + Font_Space
  978.     if @show_name
  979.       l = MAX_LINE - 2
  980.       hn = Name_FontSize + Font_Space + Name_SpaceY
  981.       rect = Rect.new(0, hn+hm, w, hm*l)
  982.     else
  983.       l = MAX_LINE - 1
  984.       hn = 0
  985.       rect = Rect.new(0, hm, w, hm*l)
  986.     end
  987.     # 复制位图
  988.     buff = Bitmap.new(w, hm*l)
  989.     buff.blt(0, 0, contents, rect)
  990.     # 描绘位图
  991.     contents.clear_rect Rect.new(0, hn, w, hm*l+hm)
  992.     contents.blt 0, hn, buff, Rect.new(0, 0, w, hm*l)
  993.     buff.dispose
  994.     @contents_y -= Msg_FontSize + Font_Space
  995.     @multi_lines = false
  996.   end
  997.   #--------------------------------------------------------------------------
  998.   # ○ 返回字体
  999.   #     index       : 编号
  1000.   #--------------------------------------------------------------------------
  1001.   def get_font(index)
  1002.     case index
  1003.     when 0
  1004.       name = [Font_Lib[Name_FontIndex], Font.default_name].flatten!
  1005.       size = Name_FontSize
  1006.       font = Font.new(name, size)
  1007.     when 1
  1008.       name = [Font_Lib[Msg_FontName], Font.default_name].flatten!
  1009.       size = Msg_FontSize
  1010.       font = Font.new(name, size)
  1011.     else
  1012.       name = [Font_Lib[index],Font.default_name].flatten!
  1013.       font = Font.new(name)
  1014.     end
  1015.     return font
  1016.   end
  1017.   #--------------------------------------------------------------------------
  1018.   # ○ 设定头像宽度
  1019.   #     face_name  : 头像图像文件名
  1020.   #--------------------------------------------------------------------------
  1021.   def set_face_width(face_name)
  1022.     bitmap = Cache.face(face_name)
  1023.     @face_width = bitmap.width / 4
  1024.   end
  1025.   #--------------------------------------------------------------------------
  1026.   # ○ 获取头像高度
  1027.   #     face_name  : 头像图像文件名
  1028.   #--------------------------------------------------------------------------
  1029.   def get_face_height(face_name)
  1030.     bitmap = Cache.face(face_name)
  1031.     return bitmap.height / 2
  1032.   end
  1033.   #--------------------------------------------------------------------------
  1034.   # ○ 设定头像增强功能
  1035.   #--------------------------------------------------------------------------
  1036.   def set_face_plus
  1037.     fw = @face_sprite.width
  1038.     fh = @face_sprite.height
  1039.     # 水平坐标
  1040.     if @show_right
  1041.       @face_x = self.width - fw - Face_AdjX
  1042.     else
  1043.       @face_x = self.x + Face_AdjX
  1044.     end
  1045.     @face_sprite.x = @face_x
  1046.     # 垂直坐标
  1047.     case Face_Align
  1048.     when 0
  1049.       @face_sprite.y = self.y + Face_AdjY
  1050.     when 1
  1051.       @face_sprite.y = self.y + (self.height - fh) / 2
  1052.     when 2
  1053.       @face_sprite.y = self.y + (self.height - fh) + Face_AdjY
  1054.     end
  1055.     case @face_enter
  1056.     when 1 # 水平趋中时
  1057.       @face_sprite.x += (@show_right ? fw : -fw)
  1058.     when 2 # 渐显时
  1059.       @face_sprite.opacity = 0
  1060.     end
  1061.     # 可视性
  1062.     @face_sprite.visible = true
  1063.   end
  1064. end
  1065. #==============================================================================
  1066. # ■ Game_Interpreter
  1067. #==============================================================================
  1068. class Game_Interpreter
  1069.   #--------------------------------------------------------------------------
  1070.   # ◎ 显示文章
  1071.   #--------------------------------------------------------------------------
  1072.   def command_101
  1073.     unless $game_message.busy
  1074.       $game_message.face_name = @params[0]
  1075.       $game_message.face_index = @params[1]
  1076.       $game_message.background = @params[2]
  1077.       $game_message.position = @params[3]
  1078.       @index += 1
  1079.       loop do
  1080.         case @list[@index].code
  1081.         when 101 # 对话设定
  1082.           multi_lines? ? @index += 1 : break
  1083.         when 401 # 对话数据
  1084.           $game_message.texts.push(@list[@index].parameters[0])
  1085.           @index += 1
  1086.         else
  1087.           break
  1088.         end
  1089.       end
  1090.       if @list[@index].code == 102          # 显示选择项
  1091.         setup_choices(@list[@index].parameters)
  1092.       elsif @list[@index].code == 103       # 处理数值输入
  1093.         setup_num_input(@list[@index].parameters)
  1094.       end
  1095.       set_message_waiting                   # 消息待机状态
  1096.     end
  1097.     return false
  1098.   end
  1099.   #--------------------------------------------------------------------------
  1100.   # ○ 多行模式?
  1101.   #--------------------------------------------------------------------------
  1102.   def multi_lines?
  1103.     return false if FSL::Window_message_Plus::MultiLinesWait <= 0
  1104.     return false if $game_message.face_name != @list[@index].parameters[0]
  1105.     return false if $game_message.face_index != @list[@index].parameters[1]
  1106.     return false if $game_message.background != @list[@index].parameters[2]
  1107.     return false if $game_message.position != @list[@index].parameters[3]
  1108.     return true
  1109.   end
  1110.   #--------------------------------------------------------------------------
  1111.   # ○ 心情图标扩展
  1112.   #     character_id: 角色 ID (-1 为角色、0 为本事件、除此之外为事件 ID)
  1113.   #     balloon_id  : 心情动画 ID (从1开始)
  1114.   #--------------------------------------------------------------------------
  1115.   def balloon_extend(character_id, balloon_id)
  1116.     character = get_character(character_id)
  1117.     if character != nil
  1118.       character.balloon_id = balloon_id
  1119.     end
  1120.     return true
  1121.   end
  1122. end
  1123. #==============================================================================
  1124. # ■ Bitmap
  1125. #==============================================================================
  1126. class Bitmap
  1127.   #--------------------------------------------------------------------------
  1128.   # ○ 描边字
  1129.   #--------------------------------------------------------------------------
  1130.   def draw_stroke_text(x, y, width, height, str, align = 0, color = nil)
  1131.     # 准备字体
  1132.     font_backup = self.font.clone
  1133.     # 处理字色
  1134.     self.font.color.set(color.red,color.green,color.blue) if color
  1135.     # 关闭默认阴影
  1136.     self.font.shadow = false
  1137.     # 描绘边缘
  1138.     self.draw_text(x-1, y-1, width, height, str, align)
  1139.     self.draw_text(x-1, y+1, width, height, str, align)
  1140.     self.draw_text(x+1, y-1, width, height, str, align)
  1141.     self.draw_text(x+1, y+1, width, height, str, align)
  1142.     self.draw_text(x, y-1, width, height, str, align)
  1143.     self.draw_text(x, y+1, width, height, str, align)
  1144.     self.draw_text(x-1, y, width, height, str, align)
  1145.     self.draw_text(x+1, y, width, height, str, align)
  1146.     # 描绘主文字
  1147.     self.font.color = font_backup.color
  1148.     self.draw_text(x, y, width, height, str, align)
  1149.     # 还原默认字体
  1150.     self.font = font_backup
  1151.   end
  1152.   #--------------------------------------------------------------------------
  1153.   # ○ 发光字
  1154.   #--------------------------------------------------------------------------
  1155.   def draw_radiate_text(x, y, width, height, str, align = 0, color = nil)
  1156.     # 准备buffer
  1157.     buffer = Bitmap.new(width, height)
  1158.     # 同步font
  1159.     buffer.font = self.font.clone
  1160.     # 关闭默认阴影
  1161.     buffer.font.shadow = false
  1162.     # 处理字色
  1163.     buffer.font.color.set(color.red,color.green,color.blue) if color
  1164.     # 描绘边缘
  1165.     buffer.draw_text(-1, -1, width, height, str, align)
  1166.     buffer.draw_text(-1, 1, width, height, str, align)
  1167.     buffer.draw_text(1, -1, width, height, str, align)
  1168.     buffer.draw_text(1, 1, width, height, str, align)
  1169.     buffer.draw_text(0, -1, width, height, str, align)
  1170.     buffer.draw_text(0, 1, width, height, str, align)
  1171.     buffer.draw_text(0-1, 0, width, height, str, align)
  1172.     buffer.draw_text(1, 0, width, height, str, align)
  1173.     buffer.blur
  1174.     # 描绘主文字
  1175.     buffer.font.color = self.font.color
  1176.     buffer.draw_text(0, 0, width, height, str, align)
  1177.     self.blt(x, y, buffer, Rect.new(0, 0, width, height))
  1178.     buffer.dispose
  1179.   end
  1180. end
复制代码

点评

于是起冲突的那段是用来干啥的……?能不能直接删了或是怎样……?  发表于 2011-9-8 17:26
那啥……我把唯一动过的俩脚本发上来成么……电脑重装之后就一直苦逼得不得了……  发表于 2011-9-8 17:25
那么发一个范例吧……我连“华丽版显示地图名”脚本都不知道是哪个=A= 一直用外站脚本……  发表于 2011-9-8 17:18
回复

使用道具 举报

Lv5.捕梦者 (管理员)

老黄鸡

梦石
0
星屑
39684
在线时间
7486 小时
注册时间
2009-7-6
帖子
13483

开拓者贵宾

5
发表于 2011-9-8 17:38:51 | 只看该作者
37行在哪里我看不到.丢工程.
RGDirect - DirectX驱动的RGSS,点我了解.
RM全系列成套系统定制请联系QQ1213237796
不接受对其他插件维护的委托
回复

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
5896
在线时间
492 小时
注册时间
2010-8-27
帖子
254
6
 楼主| 发表于 2011-9-8 18:43:52 | 只看该作者
fux2 发表于 2011-9-8 17:38
37行在哪里我看不到.丢工程.

系统苦逼打包不能……在主楼那段代码的第10行,“@time_stamp = file.mtime”那里
回复

使用道具 举报

Lv5.捕梦者 (管理员)

老黄鸡

梦石
0
星屑
39684
在线时间
7486 小时
注册时间
2009-7-6
帖子
13483

开拓者贵宾

7
发表于 2011-9-8 18:49:48 | 只看该作者
zxlxp2006 发表于 2011-9-8 18:43
系统苦逼打包不能……在主楼那段代码的第10行,“@time_stamp = file.mtime”那里 ...

能不能把报的什么错也说出来= =
你是故意不给全条件让我们答题么?
RGDirect - DirectX驱动的RGSS,点我了解.
RM全系列成套系统定制请联系QQ1213237796
不接受对其他插件维护的委托
回复

使用道具 举报

Lv2.观梦者

(?????)

梦石
0
星屑
700
在线时间
1327 小时
注册时间
2011-7-18
帖子
3184

贵宾

8
发表于 2011-9-9 02:22:58 | 只看该作者
本帖最后由 各种压力的猫君 于 2011-9-9 02:24 编辑

╮(╯_╰)╭  经测试这两个脚本完全没有冲突问题
同7L,删了存档试试。

另外你这个版本不觉得太旧了 = =

对话框加强目前的最新版是1.09.1013
http://rpg.blue/thread-158161-1-2.html
\!有个小BUG,看我在50L的回复 - -

点评

这个加强版本我下过……因为觉得用不到那么多功能所以就没用……  发表于 2011-9-9 12:24
谢谢,我试试看  发表于 2011-9-9 12:23
回复

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
5896
在线时间
492 小时
注册时间
2010-8-27
帖子
254
9
 楼主| 发表于 2011-9-9 12:22:46 | 只看该作者
fux2 发表于 2011-9-8 18:49
能不能把报的什么错也说出来= =
你是故意不给全条件让我们答题么?

呃我不是故意的……下的游戏玩不了都快悲催死了……

这货是日语的……


zxlxp2006于2011-9-9 12:28补充以下内容:
我试了一下……删掉存档之后存倒是没问题了,但读档的时候就会报错……


zxlxp2006于2011-9-10 12:59补充以下内容:
那个……感谢各位……一番尝试过后我发现是自己犯了个BC错误……我的系统时间设置的是2099年……(撞墙)还是谢谢大家……7L8L两位都有帮到我……不过7L的大大说得更清楚些……所以最佳答案给7L了……(鞠躬退下)

点评

2099 = = ||b  发表于 2011-9-10 15:13
2009年... 明白了  发表于 2011-9-10 13:07
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-29 12:35

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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