仙剑5磁盘写入失败4怎么解压时它老说写入错误

解压时 出现Data2.cab写入错误或磁盘已满
怎么办啊?
64 威望
0 点 魅力
31 点 阅读权限
10 在线时间
1 小时 最后登录
2011-7-23 UID
633022 帖子
29 精华
64 点 金钱
175 ¥ 注册时间
2010-5-2 跳转到
字体大小:
发表于 2011-7-16 21:04
解压时 出现Data2.cab写入错误或磁盘已满
怎么办啊?
爷爷奶奶 !!! 爸爸妈妈!!!!!叔叔阿姨!!!大哥大姐!!!!救命啊!!!!
我下载的数字版 解压时 出现Data2.cab写入错误或磁盘已满 怎么办啊?
下了好长时间 还花了50块钱 买的 激活码·······
额 悲剧啊!!!!!! [attach]340739[/attach]
64 威望
0 点 魅力
31 点 阅读权限
10 在线时间
1 小时 最后登录
2011-7-23 UID
633022 帖子
29 精华
64 点 金钱
175 ¥ 注册时间
2010-5-2 发表于 2011-7-16 21:05
2011-7-16 21:05
0 点 魅力
2 点 阅读权限
10 在线时间
0 小时 最后登录
2011-7-17 UID
1681992 帖子
4 点 金钱
30 ¥ 注册时间
2011-7-17 发表于 2011-7-17 10:25
同问题 求解 没人回答吗?
62 威望
0 点 魅力
31 点 阅读权限
10 在线时间
2 小时 最后登录
2011-7-17 UID
604149 帖子
31 精华
62 点 金钱
175 ¥ 注册时间
2010-4-18 发表于 2011-7-17 11:46
试试重启下机器在装一下。我装的时候也出现了个问题说什么什么的,忘了,我重设路径在装就装起了
64 威望
0 点 魅力
31 点 阅读权限
10 在线时间
1 小时 最后登录
2011-7-23 UID
633022 帖子
29 精华
64 点 金钱
175 ¥ 注册时间
2010-5-2 发表于 2011-7-17 12:30
额 这就不是 ***的问题 是我下下来的压缩文件 解压不了 怎么***啊···············
在官网上下的 也是这个情况 ···········
16 威望
0 点 魅力
8 点 阅读权限
10 在线时间
2 小时 最后登录
2011-7-21 UID
1663896 帖子
16 点 金钱
60 ¥ 注册时间
2011-7-11 发表于 2011-7-18 08:48
系统盘空间不够,你清理下系统盘就ok了
比黑更黑,比萌更萌
4486 威望
0 点 魅力
1528 点 阅读权限
100 在线时间
226 小时 最后登录
2011-7-29 UID
1403876 帖子
1356 精华
4486 点 金钱
7304 ¥ 注册时间
2011-3-28 发表于 2011-7-18 09:01
那不是写的很明确了吗,硬盘空间不够了。。。 (
GMT+8, 2011-8-2 03:39,
Proce ed in 0.108707 second(s), 5 queries
Powered by
2001-2009鬼泣4解压问题Devil.May.Cry.4.iso中写入错误
悬赏分:5
提问时间:2008-11-27 22:33
提问者:
解压过程中Devil.May.Cry.4.iso中写入错误 是怎么回事啊?如何解决?高手支招吧!!!!!!!!
推荐***
iso是镜像文件
用虚拟光驱运行***
不用解压的啊
回答时间:2008-11-27 23:11
回答者:
擅长领域:
参加的活动:
暂时没有参加的活动
相关内容
2011-4-10
2010-8-29
2008-9-10
2010-3-17
查看同主题问题:
其他回答
重新检测完整性有吗
回答者:
2008-11-27 22:36
你看看你的盘符是什么属性的?查看方法:例子~~~右键C盘属性,文件属性~~~
如果是FAT32的话,抱歉,不支持大的文件解压,改成NTFS就好了。
具体方法:
1.开始——运行
2.输入cmd——回车
3.在命令提示符窗口中,输入
convert D:\fs:ntfs 回车
注意:硬盘一旦转换为NTFS就不能再转换回去,慎重操作!
如果在该盘运行有程序,则先关闭程序,否则转换无法进行
NTFS为存在它上面的文件很好的保护,如加密和访问权限等,在帮助上可以查到。
回答者:
2008-11-28 01:42
解压缩错误,肯定无法修复的,重新下载吧,或者重新换个BT种子下.或者直接下载iso文件.
回答者:
2008-11-28 05:14
分享到:
用户名:
记住我的登录状态
2011 Baidu自动登录 密码
登录 让不懂编程的人也能做出精美的游戏来。
高效编辑、画面流畅、RGSS2脚本系统
动作游戏制作大师
查看:
回复:
[已经解决] 当前离线
最后登录
2011-6-24
好人卡
在线时间
18 小时
注册时间
2009-7-25
杂兵, 积分 2, 距离下一级还需 1 积分
好人卡
2 经验
在线时间
18 小时
注册时间
2009-7-25
发表于 2009-7-29 16:08:33
本帖最后由 flzt5354 于 2009-7-29 16:40 编辑
,说不清楚了,代码贴上来又显示不了
附上工程
当前离线
最后登录
2011-6-24
好人卡
在线时间
18 小时
注册时间
2009-7-25
杂兵, 积分 2, 距离下一级还需 1 积分
好人卡
2 经验
在线时间
18 小时
注册时间
2009-7-25
发表于 2009-7-29 16:09:23
本帖最后由 flzt5354 于 2009-7-29 16:12 编辑
晕噢。复制了怎么不显示的
不知道怎么回事。一但用了代码显示就什么都没。2016行就是最后一行
当前离线
最后登录
2010-8-5
好人卡
在线时间
0 小时
注册时间
2009-3-28
伸手爱好者
龙骑士, 积分 36, 距离下一级还需 9 积分
26 精华
1 经验
在线时间
0 小时
注册时间
2009-3-28
发表于 2009-7-29 16:20:58
LZ你到底想问什么?
上边的脚本已经因为代码问题废掉了~
最后一行到底什么是意思?
如果是少了个end的自己加上去!!!!
66~无言的思索~
当前离线
最后登录
2011-5-5
好人卡
在线时间
0 小时
注册时间
2009-7-25
龙骑士, 积分 33, 距离下一级还需 12 积分
1 好人卡
2 经验
在线时间
0 小时
注册时间
2009-7-25
发表于 2009-7-29 16:28:38
- -上传工程吧
当前离线
最后登录
2011-6-24
好人卡
在线时间
18 小时
注册时间
2009-7-25
杂兵, 积分 2, 距离下一级还需 1 积分
好人卡
2 经验
在线时间
18 小时
注册时间
2009-7-25
发表于 2009-7-29 19:34:38
3小时了、、、、、、、
当前离线
最后登录
2011-7-22
好人卡
在线时间
25 小时
注册时间
2007-8-26
神之意志, 积分 272, 距离下一级还需 28 积分
157 好人卡
6 经验
在线时间
25 小时
注册时间
2007-8-26
发表于 2009-7-29 20:19:14
文件下载时会中断 - -~
下载不能,请使用论坛附件吧~
当前离线
最后登录
2011-7-7
好人卡
在线时间
22 小时
注册时间
2008-11-6
~琉璃の雪~
◎幻世虚空中的浮云◎
神之意志, 积分 270, 距离下一级还需 30 积分
260 好人卡
1 经验
在线时间
22 小时
注册时间
2008-11-6
发表于 2009-7-29 20:21:19
本帖最后由 夏季冰川 于 2009-7-29 20:23 编辑
论坛附件接压好象也有问题,我下载附件后解压会出错.
6R重开,很好......很好......
当前离线
最后登录
2011-6-24
好人卡
在线时间
18 小时
注册时间
2009-7-25
杂兵, 积分 2, 距离下一级还需 1 积分
好人卡
2 经验
在线时间
18 小时
注册时间
2009-7-25
发表于 2009-7-29 20:53:24
本帖最后由 flzt5354 于 2009-7-29 20:56 编辑
汗了。。。。。。。
论坛附件解压都坏了- -
连接我用米人下了次,没问题- -就是速度慢
当前离线
最后登录
2011-7-16
好人卡
在线时间
36 小时
注册时间
2009-1-6
士兵, 积分 3, 距离下一级还需 4 积分
好人卡
2 经验
在线时间
36 小时
注册时间
2009-1-6
发表于 2009-10-21 06:14:45
#==============================================================================
#真·仙剑菜单
#脚本作者by七夕小雨
#本脚本来自于66RPG 转贴请保留该信息
#==============================================================================
cla Scene_Menu #-------------------------------------------------------------------------- # ● 初始化对像 # menu_index : 命令光标的初期位置 #-------------------------------------------------------------------------- def initialize(menu_index = 0) @menu_index = menu_index end #-------------------------------------------------------------------------- # ● 主处理 #-------------------------------------------------------------------------- def main ############################# @back 2 = Sprite.new @back 2.bitmap = Bitmap.new(Graphics/menu/menu_all. g) @back 2.x = 0 @back 2.y = 0 @back 2.z = 1 ############################ # 生成命令窗口 @command_window = Window_Command.new(250,[状态, 仙术, 物品, 系统]) @command_window.windowskin = RPG::Cache.windowskin(" il) @command_window.width = 180 @command_window.height = 250 @command_window.y = 115 @command_window.x = -1 @command_window.z = 10 @command_window.opacity = 0 @command_window.index = @menu_index #================================================================ @command_window.contents = Bitmap.new(Graphics/menu/menu. g) #================================================================ # 同伴人数为 0 的情况下 if $game_party.actors.size == 0 # 物品、特技、装备、状态无效化 @command_window.disable_item(0) @command_window.disable_item(1) @command_window.disable_item(2) @command_window.disable_item(3) end # 禁止存档的情况下 if $game_system.save_disabled # 存档无效 @command_window.disable_item(4) end # 生成金钱窗口 @gold_window = Window_Gold.new @gold_window.x = 0 @gold_window.y = 60 @gold_window.opacity = 0 # 生成状态窗口 @status_window = Window_MenuStatus.new # 执行过渡 #============================================================= case @menu_index when 0 @command_window.contents = Bitmap.new(Graphics/menu/menu. g) when 1 @command_window.contents = Bitmap.new(Graphics/menu/menu2. g) when 2 @command_window.contents = Bitmap.new(Graphics/menu/menu3. g) when 3 @command_window.contents = Bitmap.new(Graphics/menu/menu4. g) end #==================================================================== Graphics.tra ition # 主循环 loop do # 刷新游戏画面 Graphics.update # 刷新输入信息 I ut.update # 刷新画面 update # 如果切换画面就中断循环 if $scene != self reak end end # 准备过渡 Graphics.freeze # 释放窗口 @command_window.di ose @gold_window.di ose @status_window.di ose @back 2.di ose end #-------------------------------------------------------------------------- # ● 刷新画面 #-------------------------------------------------------------------------- def update # 刷新窗口 @command_window.update @gold_window.update @status_window.update #============================================================= case @command_window.index when 0 @command_window.contents = Bitmap.new(Graphics/menu/menu. g) when 1 @command_window.contents = Bitmap.new(Graphics/menu/menu2. g) when 2 @command_window.contents = Bitmap.new(Graphics/menu/menu3. g) when 3 @command_window.contents = Bitmap.new(Graphics/menu/menu4. g) end #==================================================================== # 命令窗口被激活的情况下: 调用 update_command if @command_window.active update_command return end # 状态窗口被激活的情况下: 调用 update_status if @status_window.active update_status return end end #-------------------------------------------------------------------------- # ● 刷新画面 (命令窗口被激活的情况下) #-------------------------------------------------------------------------- def update_command # 按下 B 键的情况下 if I ut.trigger?(I ut::B) # 演奏取消 SE $game_system.se_play($data_system.cancel_se) # 切换的地图画面 $scene = Scene_Map.new return end # 按下 C 键的情况下 if I ut.trigger?(I ut::C) # 同伴人数为 0、存档、游戏结束以外的场合 if $game_party.actors.size == 0 and @command_window.index 4 # 演奏冻结 SE $game_system.se_play($data_system.buzzer_se) return end # 命令窗口的光标位置分支 case @command_window.index when 0 # 状态 # 演奏确定 SE $game_system.se_play($data_system.decision_se) # 激活状态窗口 @command_window.active = false @status_window.active = true @status_window.index = 0 when 1 # 仙术 # 演奏确定 SE $game_system.se_play($data_system.decision_se) # 激活状态窗口 @command_window.active = false @status_window.active = true @status_window.index = 0 when 2 # 物品 # 演奏确定 SE $game_system.se_play($data_system.decision_se) # 切换到物品画面 $scene = Scene_Menu_Item.new when 3 # 状态 # 演奏确定 SE $game_system.se_play($data_system.decision_se) # 切换到物品画面 $scene = Scene_Menu_System.new when 4 # 存档 # 禁止存档的情况下 if $game_system.save_disabled # 演奏冻结 SE $game_system.se_play($data_system.buzzer_se) return end # 演奏确定 SE $game_system.se_play($data_system.decision_se) # 切换到存档画面 $scene = Scene_Save.new when 5 # 游戏结束 # 演奏确定 SE $game_system.se_play($data_system.decision_se) # 切换到游戏结束画面 $scene = Scene_End.new end return end end #-------------------------------------------------------------------------- # ● 刷新画面 (状态窗口被激活的情况下) #-------------------------------------------------------------------------- def update_status # 按下 B 键的情况下 if I ut.trigger?(I ut::B) # 演奏取消 SE $game_system.se_play($data_system.cancel_se) # 激活命令窗口 @command_window.active = true @status_window.active = false @status_window.index = -1 return end # 按下 C 键的情况下 if I ut.trigger?(I ut::C) # 命令窗口的光标位置分支 case @command_window.index when 0 # 状态 # 演奏确定 SE $game_system.se_play($data_system.decision_se) # 切换到状态画面 $scene = Scene_Status.new(@status_window.index) when 1 # 特技 # 本角色的行动限制在 2 以上的情况下 if $game_party.actors[@status_window.index].restriction = 2 # 演奏冻结 SE $game_system.se_play($data_system.buzzer_se) return end # 演奏确定 SE $game_system.se_play($data_system.decision_se) # 切换到特技画面 $scene = Scene_Skill.new(@status_window.index) when 2 # 装备 # 演奏确定 SE $game_system.se_play($data_system.decision_se) # 切换的装备画面 $scene = Scene_Equip.new(@status_window.index) when 3 # 状态 # 演奏确定 SE $game_system.se_play($data_system.decision_se) # 切换到状态画面 $scene = Scene_Status.new(@status_window.index) end return end end
#-------------------------物品·二级菜单--------------------------------------
cla Scene_Menu_Item #-------------------------------------------------------------------------- # ● 初始化对像 # menu_index : 命令光标的初期位置 #-------------------------------------------------------------------------- def initialize(menu_index = 0) @menu_index = menu_index end #-------------------------------------------------------------------------- # ● 主处理 #-------------------------------------------------------------------------- def main ############################# @back 2 = Sprite.new @back 2.bitmap = Bitmap.new(Graphics/menu/menu_all_2.jpg) @back 2.x = 0 @back 2.y = 0 @back 2.z = 1 ############################ # 生成命令窗口 @command_window = Window_Command.new(250,[装备, 物品]) @command_window.windowskin = RPG::Cache.windowskin(" il) @command_window.width = 180 @command_window.height = 250 @command_window.y = 150 @command_window.x = 60 @command_window.z = 10 @command_window.opacity = 0 @command_window.index = @menu_index #================================================================ @command_window.contents = Bitmap.new(Graphics/menu/menu3_1. g) #================================================================ # 同伴人数为 0 的情况下 # 禁止存档的情况下 # 生成金钱窗口 @gold_window = Window_Gold.new @gold_window.x = 0 @gold_window.y = 60 @gold_window.opacity = 0 # 生成状态窗口 @status_window = Window_MenuStatus.new # 执行过渡 #============================================================= case @menu_index when 0 @command_window.contents = Bitmap.new(Graphics/menu/menu3_1. g) when 1 @command_window.contents = Bitmap.new(Graphics/menu/menu3_2. g) end #==================================================================== Graphics.tra ition # 主循环 loop do # 刷新游戏画面 Graphics.update # 刷新输入信息 I ut.update # 刷新画面 update # 如果切换画面就中断循环 if $scene != self reak end end # 准备过渡 Graphics.freeze # 释放窗口 @command_window.di ose @gold_window.di ose @status_window.di ose @back 2.di ose end #-------------------------------------------------------------------------- # ● 刷新画面 #-------------------------------------------------------------------------- def update # 刷新窗口 @command_window.update @gold_window.update @status_window.update #============================================================= case @command_window.index when 0 @command_window.contents = Bitmap.new(Graphics/menu/menu3_1. g) when 1 @command_window.contents = Bitmap.new(Graphics/menu/menu3_2. g) end #==================================================================== # 命令窗口被激活的情况下: 调用 update_command if @command_window.active update_command return end # 状态窗口被激活的情况下: 调用 update_status if @status_window.active update_status return end end #-------------------------------------------------------------------------- # ● 刷新画面 (命令窗口被激活的情况下) #-------------------------------------------------------------------------- def update_command # 按下 B 键的情况下 if I ut.trigger?(I ut::B) # 演奏取消 SE $game_system.se_play($data_system.cancel_se) # 切换的地图画面 $scene = Scene_Menu.new(2) return end # 按下 C 键的情况下 if I ut.trigger?(I ut::C) # 同伴人数为 0、存档、游戏结束以外的场合 if $game_party.actors.size == 0 and @command_window.index 4 # 演奏冻结 SE $game_system.se_play($data_system.buzzer_se) return end # 命令窗口的光标位置分支 case @command_window.index when 0 # 物品 # 演奏确定 SE $game_system.se_play($data_system.decision_se) # 切换到物品画面 $scene = Scene_Item.new when 1 # 装备 # 演奏确定 SE $game_system.se_play($data_system.decision_se) # 激活状态窗口 @command_window.active = false @status_window.active = true @status_window.index = 0 end return end end #-------------------------------------------------------------------------- # ● 刷新画面 (状态窗口被激活的情况下) #-------------------------------------------------------------------------- def update_status # 按下 B 键的情况下 if I ut.trigger?(I ut::B) # 演奏取消 SE $game_system.se_play($data_system.cancel_se) # 激活命令窗口 @command_window.active = true @status_window.active = false @status_window.index = -1 return end # 按下 C 键的情况下 if I ut.trigger?(I ut::C) # 命令窗口的光标位置分支 case @command_window.index when 1 # 特技 # 演奏确定 SE $game_system.se_play($data_system.decision_se) # 切换的装备画面 $scene = Scene_Equip.new(@status_window.index) end return end end
#-------------------------系统·二级菜单--------------------------------------
cla Scene_Menu_System #-------------------------------------------------------------------------- # ● 初始化对像 # menu_index : 命令光标的初期位置 #-------------------------------------------------------------------------- def initialize(menu_index = 0) @menu_index = menu_index end #-------------------------------------------------------------------------- # ● 主处理 #-------------------------------------------------------------------------- def main ############################# @back 2 = Sprite.new @back 2.bitmap = Bitmap.new(Graphics/menu/menu_all_3.jpg) @back 2.x = 0 @back 2.y = 0 @back 2.z = 1 ############################ # 生成命令窗口 @command_window = Window_Command.new(250,[存储, 读取,离开]) @command_window.windowskin = RPG::Cache.windowskin(" il) @command_window.width = 280 @command_window.height = 250 @command_window.y = 150 @command_window.x = 60 @command_window.z = 10 @command_window.opacity = 0 @command_window.index = @menu_index #================================================================ @command_window.contents = Bitmap.new(Graphics/menu/menu4_1. g) #================================================================ # 生成金钱窗口 @gold_window = Window_Gold.new @gold_window.x = 0 @gold_window.y = 60 @gold_window.opacity = 0 # 执行过渡 #============================================================= case @menu_index when 0 @command_window.contents = Bitmap.new(Graphics/menu/menu4_1. g) when 1 @command_window.contents = Bitmap.new(Graphics/menu/menu4_2. g) when 2 @command_window.contents = Bitmap.new(Graphics/menu/menu4_3. g) end #==================================================================== Graphics.tra ition # 主循环 loop do # 刷新游戏画面 Graphics.update # 刷新输入信息 I ut.update # 刷新画面 update # 如果切换画面就中断循环 if $scene != self reak end end # 准备过渡 Graphics.freeze # 释放窗口 @command_window.di ose @gold_window.di ose @back 2.di ose end #-------------------------------------------------------------------------- # ● 刷新画面 #-------------------------------------------------------------------------- def update # 刷新窗口 @command_window.update @gold_window.update #============================================================= case @command_window.index when 0 @command_window.contents = Bitmap.new(Graphics/menu/menu4_1. g) when 1 @command_window.contents = Bitmap.new(Graphics/menu/menu4_2. g) when 2 @command_window.contents = Bitmap.new(Graphics/menu/menu4_3. g) end #==================================================================== # 命令窗口被激活的情况下: 调用 update_command if @command_window.active update_command return end # 状态窗口被激活的情况下: 调用 update_status if @status_window.active update_status return end end #-------------------------------------------------------------------------- # ● 刷新画面 (命令窗口被激活的情况下) #-------------------------------------------------------------------------- def update_command # 按下 B 键的情况下 if I ut.trigger?(I ut::B) # 演奏取消 SE $game_system.se_play($data_system.cancel_se) # 切换的地图画面 $scene = Scene_Menu.new(3) return end # 按下 C 键的情况下 if I ut.trigger?(I ut::C) # 同伴人数为 0、存档、游戏结束以外的场合 if $game_party.actors.size == 0 and @command_window.index 4 # 演奏冻结 SE $game_system.se_play($data_system.buzzer_se) return end # 命令窗口的光标位置分支 case @command_window.index when 0 # 存储 if $game_system.save_disabled # 演奏冻结 SE $game_system.se_play($data_system.buzzer_se) return end # 演奏确定 SE $game_system.se_play($data_system.decision_se) $scene = Scene_Save.new when 1 # 读取 # 演奏确定 SE $game_system.se_play($data_system.decision_se) $scene = Scene_Load.new when 2 # 离开 # 演奏确定 SE $game_system.se_play($data_system.decision_se) $scene = nil end return end end
#==============================================================================
# ■ Window_Base
#------------------------------------------------------------------------------
#  游戏中全部窗口的超级类。
#==============================================================================
cla Window_Base Window #-------------------------------------------------------------------------- # ● 初始化对像 # x : 窗口的 X 坐标 # y : 窗口的 Y 坐标 # width : 窗口的宽 # height : 窗口的宽 #-------------------------------------------------------------------------- def initialize(x, y, width, height) super() @windowskin_name = $game_system.windowskin_name self.windowskin = RPG::Cache.windowskin(@windowskin_name) self.x = x self.y = y self.width = width self.height = height self.z = 9999 end #-------------------------------------------------------------------------- # ● 释放 #-------------------------------------------------------------------------- def di ose # 如果窗口的内容已经被设置就被释放 if self.contents != nil elf.contents.di ose end super end #-------------------------------------------------------------------------- # ● 获取文字色 # : 文字色编号 (0~7) #-------------------------------------------------------------------------- def text_color(n) case n when 0 return Color.new(255, 255, 255, 255) when 1 return Color.new(255, -255, -255, 255) when 2 return Color.new(255, 128, 128, 255) when 3 return Color.new(128, 255, 128, 255) when 4 return Color.new(128, 255, 255, 255) when 5 return Color.new(255, 128, 255, 255) when 6 return Color.new(255, 141, 0, 255) when 7 return Color.new(80, 73, 127, 255) else ormal_color end end #-------------------------------------------------------------------------- # ● 获取普通文字色 #-------------------------------------------------------------------------- def normal_color return Color.new(255, 255, 255, 255) end #-------------------------------------------------------------------------- # ● 获取无效文字色 #-------------------------------------------------------------------------- def disabled_color return Color.new(255, 255, 255, 128) end #-------------------------------------------------------------------------- # ● 获取系统文字色 #-------------------------------------------------------------------------- def system_color return Color.new(192, 224, 255, 255) end #-------------------------------------------------------------------------- # ● 获取危机文字色 #-------------------------------------------------------------------------- def crisis_color return Color.new(255, 255, 64, 255) end #-------------------------------------------------------------------------- # ● 获取战斗不能文字色 #-------------------------------------------------------------------------- def knockout_color return Color.new(255, 64, 0) end #-------------------------------------------------------------------------- # ● 刷新画面 #-------------------------------------------------------------------------- def update super # 如果窗口的外关被变更了、再设置 if $game_system.windowskin_name != @windowskin_name @windowskin_name = $game_system.windowskin_name elf.windowskin = RPG::Cache.windowskin(@windowskin_name) end end #-------------------------------------------------------------------------- # ● 图形的描绘 # actor : 角色 # x : 描画目标 X 坐标 # y : 描画目标 Y 坐标 #-------------------------------------------------------------------------- def draw_actor_graphic(actor, x, y) bitmap = RPG::Cache.character(actor.character_name, actor.character_hue) cw = bitmap.width / 4 ch = bitmap.height / 4 src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect) end #-------------------------------------------------------------------------- # ● 名称的描绘 # actor : 角色 # x : 描画目标 X 坐标 # y : 描画目标 Y 坐标 #-------------------------------------------------------------------------- def draw_actor_name(actor, x, y) self.contents.font.color = normal_color self.contents.draw_text(x, y, 120, 32, actor.name) end #-------------------------------------------------------------------------- # ● 职业的描绘 # actor : 角色 # x : 描画目标 X 坐标 # y : 描画目标 Y 坐标 #-------------------------------------------------------------------------- def draw_actor_cla (actor, x, y) self.contents.font.color = normal_color self.contents.draw_text(x, y, 236, 32, actor.cla _name) end #-------------------------------------------------------------------------- # ● 水平的描画 # actor : 角色 # x : 描画目标 X 坐标 # y : 描画目标 Y 坐标 #-------------------------------------------------------------------------- def draw_actor_level(actor, x, y) self.contents.font.color = Color.new(64,70,124,255) self.contents.draw_text(x, y, 32, 32, ) self.contents.font.color = Color.new(64,70,124,255) self.contents.draw_text(x + 32, y, 24, 32, actor.level.to_s, 2) end #-------------------------------------------------------------------------- # ● 生辰成描绘用状态字符串 # actor : 角色 # width : 描画目标的宽度 # eed_normal : [正常] 是否为必须 (true / false) #-------------------------------------------------------------------------- def make_battler_state_text(battler, width, need_normal) # 获取括号的宽 brackets_width = self.contents.text_size([]).width # 生成状态名字符串 text = for i in battler.states if $data_states
.rating = 1 if text == text = $data_states
.name else new_text = text + / + $data_states
.name text_width = self.contents.text_size(new_text).width if text_width width - brackets_width reak end text = new_text end end end # 状态名空的字符串是 [正常] 的情况下 if text == if need_normal text = [正常] end else # 加上括号 text = [ + text + ] end # 返回完成后的文字类 return text end #-------------------------------------------------------------------------- # ● 描绘状态 # actor : 角色 # x : 描画目标 X 坐标 # y : 描画目标 Y 坐标 # width : 描画目标的宽 #-------------------------------------------------------------------------- def draw_actor_state(actor, x, y, width = 120) text = make_battler_state_text(actor, width, true) self.contents.font.color = actor.hp == 0 ? knockout_color : normal_color self.contents.draw_text(x, y, width, 32, text) end #-------------------------------------------------------------------------- # ● 描画 EXP # actor : 角色 # x : 描画目标 X 坐标 # y : 描画目标 Y 坐标 #-------------------------------------------------------------------------- def draw_actor_exp(actor, x, y) self.contents.font.color = system_color self.contents.draw_text(x, y, 24, 32, E) self.contents.font.color = normal_color self.contents.draw_text(x + 24, y, 84, 32, actor.exp_s, 2) self.contents.draw_text(x + 108, y, 12, 32, /, 1) self.contents.draw_text(x + 120, y, 84, 32, actor.next_exp_s) end #-------------------------------------------------------------------------- # ● 描绘 HP # actor : 角色 # x : 描画目标 X 坐标 # y : 描画目标 Y 坐标 # width : 描画目标的宽 #-------------------------------------------------------------------------- def draw_actor_hp(actor, x, y, width = 144) # 描绘字符串 HP self.contents.font.color = system_color self.contents.draw_text(x, y, 32, 32, $data_system.words.hp) # 计算描绘 MaxHP 所需的空间 if width - 32 = 108 hp_x = x + width - 108 flag = true elsif width - 32 = 48 hp_x = x + width - 48 flag = false end # 描绘 HP self.contents.font.color = actor.hp == 0 ? knockout_color : actor.hp = actor.maxhp / 4 ? crisis_color : Color.new(224,96,112,255) elf.contents.font.color = Color.new(224,96,112,255) self.contents.draw_text(hp_x, y, 48, 32, actor.hp.to_s, 2) # 描绘 MaxHP if flag elf.contents.font.color = Color.new(0,0,0,255) elf.contents.draw_text(hp_x + 48, y, 12, 32, /, 1) elf.contents.font.color = Color.new(224,96,112,255) elf.contents.draw_text(hp_x + 60, y, 48, 32, actor.maxhp.to_s) end end #-------------------------------------------------------------------------- # ● 描绘 SP # actor : 角色 # x : 描画目标 X 坐标 # y : 描画目标 Y 坐标 # width : 描画目标的宽 #-------------------------------------------------------------------------- def draw_actor_ (actor, x, y, width = 144) # 描绘字符串 SP self.contents.font.color = system_color self.contents.draw_text(x, y, 32, 32, $data_system.words. ) # 计算描绘 MaxSP 所需的空间 if width - 32 = 108 _x = x + width - 108 flag = true elsif width - 32 = 48 _x = x + width - 48 flag = false end # 描绘 SP self.contents.font.color = actor. == 0 ? knockout_color : actor. = actor.max / 4 ? crisis_color : Color.new(80,112,232,255) self.contents.draw_text( _x, y, 48, 32, actor. .to_s, 2) # 描绘 MaxSP if flag elf.contents.font.color = Color.new(0,0,0,255) elf.contents.draw_text( _x + 48, y, 12, 32, /, 1) elf.contents.font.color = Color.new(80,112,232,255) elf.contents.draw_text( _x + 60, y, 48, 32, actor.max .to_s) end end #-------------------------------------------------------------------------- # ● 描绘能力值 # actor : 角色 # x : 描画目标 X 坐标 # y : 描画目标 Y 坐标 # type : 能力值种类 (0~6) #-------------------------------------------------------------------------- def draw_actor_parameter(actor, x, y, type) case type when 0 arameter_name = $data_system.words.atk arameter_value = actor.atk when 1 arameter_name = $data_system.words.pdef arameter_value = actor.pdef when 2 arameter_name = $data_system.words.mdef arameter_value = actor.mdef when 3 arameter_name = $data_system.words.str arameter_value = actor.str when 4 arameter_name = $data_system.words.dex arameter_value = actor.dex when 5 arameter_name = $data_system.words.agi arameter_value = actor.agi when 6 arameter_name = $data_system.words.int arameter_value = actor.int end self.contents.font.color = normal_color self.contents.font.color = Color.new(64,70,124,255) self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s, 2) end #-------------------------------------------------------------------------- # ● 描绘物品名 # item : 物品 # x : 描画目标 X 坐标 # y : 描画目标 Y 坐标 #-------------------------------------------------------------------------- def draw_item_name(item, x, y) if item == nil return end bitmap = RPG::Cache.icon(item.icon_name) self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24)) self.contents.font.color = Color.new(64,70,124,255) self.contents.draw_text(x + 28, y, 212, 32, item.name) end #==============================================================
def draw_actor_hp1(actor, x, y, width = 72) # 计算描绘 MaxHP 所需的空间 if width - 24 = 32 hp_x = x + 32# + width - 24 end # 描绘 HP elf.contents.font.color = actor.hp == 0 ? knockout_color : actor.hp = actor.maxhp / 4 ? crisis_color : Color.new(255,-255,-255,255) elf.contents.draw_text(315 + x, 409 , 64, 32, actor.hp.to_s, 2) elf.contents.font.color = Color.new(0,0,0,255) elf.contents.draw_text(380 + x, 409, 12, 32, /, 1) elf.contents.font.color = Color.new(255,-255,-255,255) elf.contents.draw_text(350 + x, 409, 64, 32, actor.maxhp.to_s,2)
#--------------------------------------------------------------------------
# ● 描绘 SP
# actor : 角色
# x : 描画目标 X 坐标
# y : 描画目标 Y 坐标
# width : 描画目标的宽
#--------------------------------------------------------------------------
def draw_actor_ 1(actor, x, y, width = 72) # 计算描绘 MaxSP 所需的空间 if width - 24 = 32 _x = x + 32# + width - 24 end # 描绘 SP elf.contents.font.color = actor. == 0 ? knockout_color : actor. = actor.max / 4 ? crisis_color : Color.new(-255,-255,255,255) elf.contents.draw_text(315 + x, 426, 64, 32, actor. .to_s, 2) elf.contents.font.color = Color.new(0,0,0,255) elf.contents.draw_text(380 + x, 426, 12, 32, /, 1) elf.contents.font.color = Color.new(-255,-255,255,255) elf.contents.draw_text(350 + x, 426, 64, 32, actor.max .to_s,2)
#==============================================================================
# ■ Window_Selectable
#------------------------------------------------------------------------------
#  拥有光标的移动以及滚动功能的窗口类。
#==============================================================================
cla Window_Selectable_MenuStatus Window_Base #-------------------------------------------------------------------------- # ● 定义实例变量 #-------------------------------------------------------------------------- attr_reader :index # 光标位置 attr_reader :help_window # 帮助窗口 #-------------------------------------------------------------------------- # ● 初始画对像 # x : 窗口的 X 坐标 # y : 窗口的 Y 坐标 # width : 窗口的宽 # height : 窗口的高 #-------------------------------------------------------------------------- def initialize(x, y, width, height) super(x, y, width, height) @item_max = 1 @column_max = 1 @index = -1 end #-------------------------------------------------------------------------- # ● 设置光标的位置 # index : 新的光标位置 #-------------------------------------------------------------------------- def index=(index) @index = index # 刷新帮助文本 (update_help 定义了继承目标) if self.active and @help_window != nil update_help end # 刷新光标矩形 update_cursor_rect end #-------------------------------------------------------------------------- # ● 获取行数 #-------------------------------------------------------------------------- def row_max # 由项目数和列数计算出行数 return (@item_max + @column_max - 1) / @column_max end #-------------------------------------------------------------------------- # ● 获取开头行 #-------------------------------------------------------------------------- def top_row # 将窗口内容的传送源 Y 坐标、1 行的高 32 等分 return self.oy / 32 end #-------------------------------------------------------------------------- # ● 设置开头行 # row : 显示开头的行 #-------------------------------------------------------------------------- def top_row=(row) # row 未满 0 的场合更正为 0 if row 0 row = 0 end # row 超过 row_max - 1 的情况下更正为 row_max - 1 if row row_max - 1 row = row_max - 1 end # row 1 行高的 32 倍、窗口内容的传送源 Y 坐标 self.oy = row * 32 end #-------------------------------------------------------------------------- # ● 获取 1 页可以显示的行数 #-------------------------------------------------------------------------- def page_row_max # 窗口的高度,设置画面的高度减去 32 ,除以 1 行的高度 32 return (self.height - 32) / 32 end #-------------------------------------------------------------------------- # ● 获取 1 页可以显示的项目数 #-------------------------------------------------------------------------- def page_item_max # 将行数 page_row_max 乘上列数 @column_max return page_row_max * @column_max end #-------------------------------------------------------------------------- # ● 帮助窗口的设置 # help_window : 新的帮助窗口 #-------------------------------------------------------------------------- def help_window=(help_window) @help_window = help_window # 刷新帮助文本 (update_help 定义了继承目标) if self.active and @help_window != nil update_help end end #-------------------------------------------------------------------------- # ● 更新光标举行 #-------------------------------------------------------------------------- def update_cursor_rect # 光标位置不满 0 的情况下 if @index 0 elf.cursor_rect.empty return end # 获取当前的行 row = @index / @column_max # 当前行被显示开头行前面的情况下 if row self.top_row # 从当前行向开头行滚动 elf.top_row = row end # 当前行被显示末尾行之后的情况下 if row self.top_row + (self.page_row_max - 1) # 从当前行向末尾滚动 elf.top_row = row - (self.page_row_max - 1) end # 计算光标的宽 cursor_width = self.width / @column_max - 32 # 计算光标坐标 x = @index % @column_max * (cursor_width + 32) y = @index / @column_max * 32 - self.oy # 更新国标矩形 self.cursor_rect.set(x, y, cursor_width, 32) end #-------------------------------------------------------------------------- # ● 刷新画面 #-------------------------------------------------------------------------- def update super # 可以移动光标的情况下 if self.active and @item_max 0 and @index = 0 # 方向键右被按下的情况下 if I ut.repeat?(I ut:
EFT) if (@column_max == 1 and I ut.trigger?(I ut::UP)) or @index = @column_max # 光标向上移动 $game_system.se_play($data_system.cursor_se) @index = (@index - @column_max + @item_max) % @item_max end end # 方向键左被按下的情况下 if I ut.repeat?(I ut::RIGHT) if (@column_max == 1 and I ut.trigger?(I ut:
OWN)) or @index @item_max - @column_max # 光标向下移动 $game_system.se_play($data_system.cursor_se) @index = (@index + @column_max) % @item_max end end # R 键被按下的情况下 if I ut.repeat?(I ut::R) # 显示的最后行在数据中最后行上方的情况下 if self.top_row + (self.page_row_max - 1) (self.row_max - 1) # 光标向后移动一页 $game_system.se_play($data_system.cursor_se) @index = [@index + self.page_item_max, @item_max - 1].min self.top_row += self.page_row_max end end # L 键被按下的情况下 if I ut.repeat?(I ut:
) # 显示的开头行在位置 0 之后的情况下 if self.top_row 0 # 光标向前移动一页 $game_system.se_play($data_system.cursor_se) @index = [@index - self.page_item_max, 0].max self.top_row -= self.page_row_max end end end # 刷新帮助文本 (update_help 定义了继承目标) if self.active and @help_window != nil update_help end # 刷新光标矩形 update_cursor_rect end
#---------------------------物品·帮助-------------------------------
#==============================================================================
# ■ Window_Help
#------------------------------------------------------------------------------
#  特技及物品的说明、角色的状态显示的窗口。
#==============================================================================
cla Window_Help2 Window_Base #-------------------------------------------------------------------------- # ● 初始化对像 #-------------------------------------------------------------------------- def initialize super(-16, -16, 640, 480) self.windowskin = RPG::Cache.windowskin(" il) self.contents = Bitmap.new(width - 32, height - 32) self.opacity = 220 self.z = 400 end #-------------------------------------------------------------------------- # ● 设置文本 # text : 窗口显示的字符串 # align : 对齐方式 (0..左对齐、1..中间对齐、2..右对齐) #-------------------------------------------------------------------------- def set_text(text, y = nil,align = 0) self.visible = true self.contents.clear self.contents.font.color = Color.new(64,70,124,255) @text = text.clone x = y = 0 begin last_text = @text.clone @text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] } end until @text == last_text @text.gsub!(/\\[Nn]\[([0-9]+)\]/) do $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : end @text.gsub!(/\\\\/) { \000 } @text.gsub!(/\\[Cc]\[([0-9]+)\]/) { \001[#{$1}] } @text.gsub!(/\\[Nn]/) { \002 } @text.gsub!(/\\[Ss]\[([0-9]+)\]/) { \003[#{$1}] } while ((c = @text.slice!(/./m)) != nil) if c == \000 c = \\ end if c == \001 @text.sub!(/\[([0-9]+)\]/, ) color = $1.to_i if color = 0 and color = 7 self.contents.font.color = text_color(color) end ext end if c == \002 y += 1 x = 0 ext end if c == \003 @text.sub!(/\[([0-9]+)\]/, ) t = RPG::Cache.icon(item_#{$1}) elf.contents.blt(-40, 0, t, t.rect) t.di ose ext end elf.contents.draw_text(205 + x, 32 * y+32, 40, 32, c) x += self.contents.text_size(c).width end end end
#------------------------------技能·帮助----------------------------------
#==============================================================================
# ■ Window_Help
#------------------------------------------------------------------------------
#  特技及物品的说明、角色的状态显示的窗口。
#==============================================================================
cla Window_Help Window_Base #-------------------------------------------------------------------------- # ● 初始化对像 #-------------------------------------------------------------------------- def initialize super(-16, -16, 640, 480) self.windowskin = RPG::Cache.windowskin(" il) self.contents = Bitmap.new(width - 32, height - 32) self.opacity = 220 self.z = 400 end #-------------------------------------------------------------------------- # ● 设置文本 # text : 窗口显示的字符串 # align : 对齐方式 (0..左对齐、1..中间对齐、2..右对齐) #-------------------------------------------------------------------------- def set_text(text, y = nil,align = 0) self.visible = true self.contents.clear self.contents.font.color = Color.new(64,70,124,255) @text = text.clone x = y = 0 begin last_text = @text.clone @text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] } end until @text == last_text @text.gsub!(/\\[Nn]\[([0-9]+)\]/) do $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : end @text.gsub!(/\\\\/) { \000 } @text.gsub!(/\\[Cc]\[([0-9]+)\]/) { \001[#{$1}] } @text.gsub!(/\\[Nn]/) { \002 } @text.gsub!(/\\[Ss]\[([0-9]+)\]/) { \003[#{$1}] } while ((c = @text.slice!(/./m)) != nil) if c == \000 c = \\ end if c == \001 @text.sub!(/\[([0-9]+)\]/, ) color = $1.to_i if color = 0 and color = 7 self.contents.font.color = text_color(color) end ext end if c == \002 y += 1 x = 0 ext end if c == \003 @text.sub!(/\[([0-9]+)\]/, ) t = RPG::Cache.icon(" kill_#{$1}) elf.contents.blt(0, 15, t, t.rect) t.di ose ext end elf.contents.draw_text(176 + x, 32 * y+32, 40, 32, c) x += self.contents.text_size(c).width end end 5.
#==============================================================================
# ■ Window_Target
#------------------------------------------------------------------------------
#  物品画面与特技画面的、使用对像角色选择窗口。
#==============================================================================
cla Window_Target Window_Selectable_MenuStatus #-------------------------------------------------------------------------- # ● 初始化对像 #-------------------------------------------------------------------------- def initialize super(0, 320, 480, 480) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.size = 14 self.opacity = 0 self.z += 10 @item_max = $game_party.actors.size refresh end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def refresh self.contents.clear for i in 0...$game_party.actors.size x = i * 160 y = 25 actor = $game_party.actors @actor = actor testname = @actor.name.to_s #========================================= itmap=Bitmap.new(Graphics/menu/status/#{testname}_a) rc_rect = Rect.new(0, 0, bitmap.width, bitmap.height) elf.contents.blt(x, y, bitmap, src_rect) #========================================= draw_actor_hp(actor, x + 23, y + 58) draw_actor_ (actor, x + 20, y + 72) end end #-------------------------------------------------------------------------- # ● 刷新光标矩形 #-------------------------------------------------------------------------- def update_cursor_rect # 光标位置 -1 为全选、-2 以下为单独选择 (使用者自身) if @index = -2 elf.cursor_rect.set(@index*160, 50, 150, 76) elsif @index == -1 elf.cursor_rect.set(0, 50, @item_max * 155, 76) else elf.cursor_rect.set(@index*160, 50, 150, 76) end end def di ose super
#==============================================================================
# ■ Window_Status
#------------------------------------------------------------------------------
#  显示状态画面、完全规格的状态窗口。
#==============================================================================
cla Window_Status Window_Base #-------------------------------------------------------------------------- # ● 初始化对像 # actor : 角色 #-------------------------------------------------------------------------- def initialize(actor) super(-16, -16, 800, 600) self.back_opacity = 0 self.opacity = 0 self.contents = Bitmap.new(width - 32, height - 32) @actor = actor self.contents.font.size = 20 refresh end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def refresh #====================================================== testname = @actor.name.to_s self.contents.clear bitmap=Bitmap.new(Graphics/menu/Status/#{testname}) src_rect = Rect.new(0, 0, bitmap.width, bitmap.height) self.contents.blt(0, 0, bitmap, src_rect) bitmap=Bitmap.new(Graphics/menu/Status/#{testname}+_1) src_rect = Rect.new(0, 0, bitmap.width, bitmap.height) self.contents.blt(40, 380, bitmap, src_rect) #====================================================== draw_actor_level(@actor, 120, 80) draw_actor_hp(@actor, 34, 157, 172) draw_actor_ (@actor, 34, 182, 172) draw_actor_parameter(@actor, 20, 266, 1) draw_actor_parameter(@actor, 20, 210, 3) draw_actor_parameter(@actor, 20, 322, 4) draw_actor_parameter(@actor, 20, 294, 5) draw_actor_parameter(@actor, 20, 238, 6) self.contents.font.color = Color.new(64,70,124,255) self.contents.draw_text(90, 108, 84, 32, @actor.exp_s, 2) self.contents.font.color = Color.new(168,232,160,255) self.contents.draw_text(90, 128, 84, 32, @actor.next_rest_exp_s, 2) end
#==============================================================================
# ■ Window_Gold
#------------------------------------------------------------------------------
#  显示金钱的窗口。
#==============================================================================
cla Window_Gold Window_Base #-------------------------------------------------------------------------- # ● 初始化窗口 #-------------------------------------------------------------------------- def initialize super(0, 0, 160, 64) self.contents = Bitmap.new(width - 32, height - 32) refresh end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def refresh self.contents.clear cx = contents.text_size($data_system.words.gold).width self.contents.font.color = Color.new(64,70,124,255) self.contents.font.size = 18 self.contents.draw_text(4, 0, 120-cx-2, 32, $game_party.gold.to_s, 1) end
#==============================================================================
# ■ Window_Item
#------------------------------------------------------------------------------
#  物品画面、战斗画面、显示浏览物品的窗口。
#==============================================================================
cla Window_Item2 Window_Selectable #-------------------------------------------------------------------------- # ● 初始化对像 #-------------------------------------------------------------------------- def initialize super(30, 150, 595, 240) #============================== self.windowskin = RPG::Cache.windowskin(choose) #============================================================= @column_max = 2 refresh self.index = 0 if $game_temp.in_battle elf.back_opacity = 160 end # 战斗中的情况下将窗口移至中央并将其半透明化 end #-------------------------------------------------------------------------- # ● 获取物品 #-------------------------------------------------------------------------- def item return @data[self.index] end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def refresh if self.contents != nil elf.contents.di ose elf.contents = nil end @data = [] # 添加报务 for i in 1...$data_items.size if $game_party.item_number(i) 0 @data.push($data_items
) end end # 在战斗中以外添加武器、防具 unle $game_temp.in_battle for i in 1...$data_weapo .size if $game_party.weapon_number(i) 0 @data.push($data_weapo ) end end for i in 1...$data_armors.size if $game_party.armor_number(i) 0 @data.push($data_armors
) end end end # 如果项目数不是 0 就生成位图、重新描绘全部项目 @item_max = @data.size if @item_max 0 elf.contents = Bitmap.new(width - 32, row_max * 32) for i in 0...@item_max draw_item(i) end end end #-------------------------------------------------------------------------- # ● 描绘项目 # index : 项目编号 #-------------------------------------------------------------------------- def draw_item(index) item = @data[index] case item when RPG::Item umber = $game_party.item_number(item.id) when RPG::Weapon umber = $game_party.weapon_number(item.id) when RPG::Armor umber = $game_party.armor_number(item.id) end if item.is_a?(RPG::Item) and $game_party.item_can_use?(item.id) elf.contents.font.color = Color.new(64,70,124,255) else elf.contents.font.color = Color.new(224,96,112,255) end x = 4 + index % 2 * (288 + 32) y = index / 2 * 32 rect = Rect.new(x, y, self.width / @column_max - 32, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) opacity = self.contents.font.color == normal_color ? 255 : 128. self.contents.draw_text(x + 28, y, 212, 32, item.name, 0) self.contents.draw_text(x + 180, y, 16, 32, X, 1) self.contents.draw_text(x + 200, y, 24, 32, number.to_s, 2) end #-------------------------------------------------------------------------- # ● 刷新帮助文本 #-------------------------------------------------------------------------- def update_help @help_window.set_text(self.item == nil ? : self.item.description) end
#==============================================================================
# ■ Window_Item
#------------------------------------------------------------------------------
#  物品画面、战斗画面、显示浏览物品的窗口。
#==============================================================================
cla Window_Item Window_Selectable #-------------------------------------------------------------------------- # ● 初始化对像 #-------------------------------------------------------------------------- def initialize super(30, 150, 595, 240) #============================== self.windowskin = RPG::Cache.windowskin(choose) @back 1 = Sprite.new @back 1.bitmap = Bitmap.new(Graphics/menu/底板. g) @back 1.z = 99 @back 2 = Sprite.new @back 2.bitmap = Bitmap.new(Graphics/menu/物品. g) @back 2.x = 15 @back 2.y = 115 @back 2.z = 101 #============================================================= @help2 = Sprite.new @help2.bitmap = Bitmap.new(Graphics/menu/帮助窗口使用. g) @help2.x = 15 @help2.y = -20 @help2.z = 100 #============================== @column_max = 2 refresh self.index = 0 # 战斗中的情况下将窗口移至中央并将其半透明化 if $game_temp.in_battle elf.y = 64 elf.height = 256 elf.back_opacity = 160 end end #-------------------------------------------------------------------------- # ● 获取物品 #-------------------------------------------------------------------------- def item return @data[self.index] end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def refresh if self.contents != nil elf.contents.di ose elf.contents = nil end @data = [] # 添加报务 for i in 1...$data_items.size if $game_party.item_number(i) 0 @data.push($data_items
) end end # 在战斗中以外添加武器、防具 unle $game_temp.in_battle for i in 1...$data_weapo .size if $game_party.weapon_number(i) 0 @data.push($data_weapo ) end end for i in 1...$data_armors.size if $game_party.armor_number(i) 0 @data.push($data_armors
) end end end # 如果项目数不是 0 就生成位图、重新描绘全部项目 @item_max = @data.size if @item_max 0 elf.contents = Bitmap.new(width - 32, row_max * 32) for i in 0...@item_max draw_item(i) end end end #-------------------------------------------------------------------------- # ● 描绘项目 # index : 项目编号 #-------------------------------------------------------------------------- def draw_item(index) item = @data[index] case item when RPG::Item umber = $game_party.item_number(item.id) when RPG::Weapon umber = $game_party.weapon_number(item.id) when RPG::Armor umber = $game_party.armor_number(item.id) end if item.is_a?(RPG::Item) and $game_party.item_can_use?(item.id) elf.contents.font.color = Color.new(64,70,124,255) else elf.contents.font.color = Color.new(224,96,112,255) end x = 4 + index % 2 * (288 + 32) y = index / 2 * 32 rect = Rect.new(x, y, self.width / @column_max - 32, 32) self.contents.fill_rect(rect, Color.new(64,70,124,0)) #bitmap = RPG::Cache.icon(item.icon_name) #self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity) opacity = self.contents.font.color == Color.new(224,96,112,255) ? 255 : 128. #self.contents.font.color = Color.new(64,70,124,255) self.contents.draw_text(x + 28, y, 212, 32, item.name, 0) self.contents.draw_text(x + 180, y, 16, 32, X, 1) self.contents.draw_text(x + 200, y, 24, 32, number.to_s, 2) end #-------------------------------------------------------------------------- # ● 刷新帮助文本 #-------------------------------------------------------------------------- def update_help desc1 = self.item == nil ? '' : self.item.description item2 = $data_skills[self.item.id + 1] desc2 = item2 == nil ? '' : item2.description @help_window.set_text(desc1 + desc2, [@index / @column_max * 28 - self.oy, 260].min) end #==================== def di ose super @back 1.di ose @back 2.di ose @help2.di ose end #=====================
#==============================================================================
# ■ Window_Skill
#------------------------------------------------------------------------------
#  特技画面、战斗画面、显示可以使用的特技浏览的窗口。
#==============================================================================
cla Window_Skill2 Window_Selectable #-------------------------------------------------------------------------- # ● 初始化对像 # actor : 角色 #-------------------------------------------------------------------------- def initialize(actor) super(30, 150, 595, 240) #============================== self.windowskin = RPG::Cache.windowskin(choose) #============================================================= @actor = actor @column_max = 2 refresh self.index = 0 # 战斗中的情况下将窗口移至中央并将其半透明化 if $game_temp.in_battle elf.back_opacity = 160 end end #-------------------------------------------------------------------------- # ● 获取特技 #-------------------------------------------------------------------------- def skill return @data[self.index] end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def refresh if self.contents != nil elf.contents.di ose elf.contents = nil end @data = [] for i in kill = $data_skills[@actor.skills
] if skill != nil @data.push(skill) end end # 如果项目数不是 0 就生成位图、重新描绘全部项目 @item_max = @data.size if @item_max 0 elf.contents = Bitmap.new(width - 32, row_max * 32) for i in 0...@item_max draw_item(i) end end end #-------------------------------------------------------------------------- # ● 描绘项目 # index : 项目编号 #-------------------------------------------------------------------------- def draw_item(index) skill = @data[index] if @actor.skill_can_use?(skill.id) elf.contents.font.color = Color.new(64,70,124,255) else elf.contents.font.color = Color.new(224,96,112,255) end x = 4 + index % 2 * (288 + 32) y = index / 2 * 32 rect = Rect.new(x, y, self.width / @column_max - 32, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) opacity = self.contents.font.color == normal_color ? 255 : 128 elf.contents.draw_text(x + 28, y, 204, 32, skill.name, 0) elf.contents.draw_text(x + 160, y, 48, 32, skill. _cost.to_s, 2)
end #-------------------------------------------------------------------------- # ● 刷新帮助文本 #-------------------------------------------------------------------------- def update_help desc1 = self.skill == nil ? '' : self.skill.description skill2 = $data_skills[self.skill.id + 1] desc2 = skill2 == nil ? '' : skill2.description @help_window.set_text(desc1 + desc2, [@index / @column_max * 28 - self.oy, 260].min) end
#==============================================================================
# ■ Window_Skill
#------------------------------------------------------------------------------
#  特技画面、战斗画面、显示可以使用的特技浏览的窗口。
#==============================================================================
cla Window_Skill Window_Selectable #-------------------------------------------------------------------------- # ● 初始化对像 # actor : 角色 #-------------------------------------------------------------------------- def initialize(actor) super(30, 150, 595, 240) self.windowskin = RPG::Cache.windowskin(choose) @actor = actor @column_max = 2 refresh self.index = 0 # 战斗中的情况下将窗口移至中央并将其半透明化 if $game_temp.in_battle elf.y = 64 elf.height = 256 elf.back_opacity = 160 end end #-------------------------------------------------------------------------- # ● 获取特技 #-------------------------------------------------------------------------- def skill return @data[self.index] end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def refresh if self.contents != nil elf.contents.di ose elf.contents = nil end @data = [] for i in kill = $data_skills[@actor.skills
] if skill != nil @data.push(skill) end end # 如果项目数不是 0 就生成位图、重新描绘全部项目 @item_max = @data.size if @item_max 0 elf.contents = Bitmap.new(width - 32, row_max * 32) for i in 0...@item_max draw_item(i) end end end #-------------------------------------------------------------------------- # ● 描绘项目 # index : 项目编号 #-------------------------------------------------------------------------- def draw_item(index) skill = @data[index] if @actor.skill_can_use?(skill.id) elf.contents.font.color = Color.new(64,70,124,255) else elf.contents.font.color = Color.new(224,96,112,255) end x = 4 + index % 2 * (288 + 32) y = index / 2 * 32 rect = Rect.new(x, y, self.width / @column_max - 32, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) opacity = self.contents.font.color == normal_color ? 255 : 128 elf.contents.draw_text(x + 28, y, 204, 32, skill.name, 0) elf.contents.draw_text(x + 160, y, 48, 32, skill. _cost.to_s, 2)
end #-------------------------------------------------------------------------- # ● 刷新帮助文本 #-------------------------------------------------------------------------- def update_help desc1 = self.skill == nil ? '' : self.skill.description skill2 = $data_skills[self.skill.id + 1] desc2 = skill2 == nil ? '' : skill2.description @help_window.set_text(desc1 + desc2, [@index / @column_max * 28 - self.oy, 260].min) end
#==============================================================================
# ■ Window_MenuStatus
#------------------------------------------------------------------------------
#  显示菜单画面和同伴状态的窗口。
#==============================================================================
cla Window_MenuStatus Window_Selectable_MenuStatus #-------------------------------------------------------------------------- # ● 初始化目标 #-------------------------------------------------------------------------- def initialize super(140, 330, 480, 200) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.size = 14 self.opacity = 0 refresh self.active = false self.index = -1 end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def refresh self.contents.clear @item_max = $game_party.actors.size for i in 0...$game_party.actors.size x = i * 160 y = 25 actor = $game_party.actors @actor = actor testname = @actor.name.to_s #------------------------------------------------------------------- itmap = Bitmap.new(Graphics/menu/Status/#{testname}+_a) rc_rect = Rect.new(0, 0, bitmap.width, bitmap.height) elf.contents.blt(x, y, bitmap, src_rect) #------------------------------------------------------------------- draw_actor_hp(actor, x + 23, y + 58) draw_actor_ (actor, x + 20, y + 72) end end #-------------------------------------------------------------------------- # ● 刷新光标矩形 #-------------------------------------------------------------------------- def update_cursor_rect if @index 0 elf.cursor_rect.empty else elf.cursor_rect.set(@index*160, 50, 150, 76) end end
#==============================================================================
# ■ Window_SaveFile
#------------------------------------------------------------------------------
#  显示存档以及读档画面、保存文件的窗口。
#==============================================================================
cla Window_SaveFile Window_Base #-------------------------------------------------------------------------- # ● 定义实例变量 #-------------------------------------------------------------------------- attr_reader :filename # 文件名 attr_reader :selected # 选择状态 #-------------------------------------------------------------------------- # ● 初始化对像 # file_index : 存档文件的索引 (0~3) # filename : 文件名 #-------------------------------------------------------------------------- def initialize(file_index, filename) super(250, 64 + file_index % 4 * 104, 640, 100) self.windowskin = RPG::Cache.windowskin(choose) self.contents = Bitmap.new(width, height) @file_index = file_index @filename = Save#{@file_index + 1}.rxdata @time_stamp = Time.at(0) @file_exist = FileTest.exist?(@filename) if @file_exist file = File.open(@filename, r) @time_stamp = file.mtime @characters = Marshal.load(file) @frame_count = Marshal.load(file) @game_system = Marshal.load(file) @game_switches = Marshal.load(file) @game_variables = Marshal.load(file) @total_sec = @frame_count / Graphics.frame_rate file.close end refresh @selected = false end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def refresh # 描绘文件编号 self.contents.font.color = normal_color name = 进度 #{@file_index + 1} self.contents.draw_text(4, 0, 600, 32, name) @name_width = contents.text_size(name).width # 存档文件存在的情况下 if @file_exist # 描绘角色 for i in itmap = RPG::Cache.character(@characters
[0]+_a, @characters
[1]) cw = bitmap.rect.width / 4 ch = bitmap.rect.height / 4 rc_rect = Rect.new(0, 0, cw, ch) x = 150 - @characters.size * 32 + i * 64 - cw / 2 elf.contents.blt(x, 68 - ch, bitmap, src_rect) end # 描绘游戏时间 hour = @total_sec / 60 / 60 min = @total_sec / 60 % 60 ec = @total_sec % 60 time_string = rintf(%02d小时%02d分, hour, min, sec) elf.contents.font.size = 16 elf.contents.font.color = Color.new(64,70,124,255) elf.contents.draw_text(6, 38, 600, 32, time_string, 1) elf.contents.draw_text(0,-7,600,32, @game_variables[11].to_s,1) elf.contents.draw_text(0,16,600,32, @game_variables[16].to_s,1) end end #-------------------------------------------------------------------------- # ● 设置选择状态 # elected : 新的选择状态 (true=选择 false=不选择) #-------------------------------------------------------------------------- def selected=(selected) @selected = selected update_cursor_rect end #-------------------------------------------------------------------------- # ● 刷新光标矩形 #-------------------------------------------------------------------------- def update_cursor_rect if @selected elf.cursor_rect.set(0, 0, 240, 32) else elf.cursor_rect.empty end end
#==============================================================================
# ■ Window_SaveFile
#------------------------------------------------------------------------------
#  显示存档以及读档画面、保存文件的窗口。
#==============================================================================
cla Window_SaveFile2 Window_Base #-------------------------------------------------------------------------- # ● 定义实例变量 #-------------------------------------------------------------------------- attr_reader :filename # 文件名 attr_reader :selected # 选择状态 #-------------------------------------------------------------------------- # ● 初始化对像 # file_index : 存档文件的索引 (0~3) # filename : 文件名 #-------------------------------------------------------------------------- def initialize(file_index, filename) super(250, 64 + file_index % 4 * 104, 640, 100) self.windowskin = RPG::Cache.windowskin(choose) #================================================ @ rite = Sprite.new @ rite.bitmap = RPG::Cache.title($data_system.title_name) #============================================================= @back = Sprite.new @back.bitmap = Bitmap.new(Graphics/menu/标题存档. g) @back.z = 150 #============================== #================================================ self.contents = Bitmap.new(width, height) @file_index = file_index @filename = Save#{@file_index + 1}.rxdata @time_stamp = Time.at(0) @file_exist = FileTest.exist?(@filename) if @file_exist file = File.open(@filename, r) @time_stamp = file.mtime @characters = Marshal.load(file) @frame_count = Marshal.load(file) @game_system = Marshal.load(file) @game_switches = Marshal.load(file) @game_variables = Marshal.load(file) @total_sec = @frame_count / Graphics.frame_rate file.close end refresh @selected = false end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def refresh # 描绘文件编号 self.contents.font.color = normal_color name = 进度 #{@file_index + 1} self.contents.draw_text(4, 0, 600, 32, name) @name_width = contents.text_size(name).width # 存档文件存在的情况下 if @file_exist # 描绘角色 for i in itmap = RPG::Cache.character(@characters
[0]+_a, @characters
[1]) cw = bitmap.rect.width / 4 ch = bitmap.rect.height / 4 rc_rect = Rect.new(0, 0, cw, ch) x = 150 - @characters.size * 32 + i * 64 - cw / 2 elf.contents.blt(x, 68 - ch, bitmap, src_rect) end # 描绘游戏时间 hour = @total_sec / 60 / 60 min = @total_sec / 60 % 60 ec = @total

参考资料

 

随机推荐