#==============================================================================
# ■ 容错脚本第3版(070816修订) BY 轮回者
#------------------------------------------------------------------------------
# 本脚本基于星大叔的容错脚本第2版,区别只是“下手”的地方不同而已。
# 说明请参看星大叔的容错脚本第2版。
#------------------------------------------------------------------------------
# 07.08.16
# 修正了按下F12重启后的错误
# 附,出错原因:重启后RMXP封装的类没有重置
#==============================================================================
$丢失提示 = true #丢失文件后是否信息框提示
begin
result = Graphics::Transition.nil?
rescue
result = true
end
if result
$need_file_bitmap = []
if FileTest.exist?("log_bitmap.txt")
f = File.open("./log_bitmap.txt","r")
$need_file_bitmap = f.read.split(/\n/)
f.close
end
module Graphics
Transition = method("transition")
def self.transition(*arg)
begin
Transition.call(*arg)
rescue Errno::ENOENT
ary=[*arg]
filename=ary[1]
unless $need_file_bitmap.include?(filename)
$need_file_bitmap.push(filename)
f = File.open("./log_bitmap.txt","a")
f.write(filename + "\n")
f.close
msgbox "弱弱的提示一下,您有图像文件(#{filename})丢失了..." if $丢失提示
end
Transition.call(ary[0])
end
end
end
class Bitmap < Object
alias ini_Fx initialize
def initialize(*args)
begin
ini_Fx(*args)
return
rescue Errno::ENOENT
filename=[*args][0]
unless $need_file_bitmap.include?(filename)
$need_file_bitmap.push(filename)
f = File.open("./log_bitmap.txt","a")
f.write(filename + "\n")
f.close
msgbox "弱弱的提示一下,您有图像文件(#{filename})丢失了..." if $丢失提示
end
ini_Fx(32,32)
end
end
end
$need_file_audio = []
if FileTest.exist?("log_audio.txt")
f = File.open("./log_audio.txt","r")
$need_file_audio = f.read.split(/\n/)
f.close
end
module Audio
Me_play = method("me_play")
def self.me_play(*arg)
begin
Me_play.call(*arg)
rescue Errno::ENOENT
filename=[*arg][0]
unless $need_file_audio.include?(filename)
$need_file_audio.push(filename)
f = File.open("./log_audio.txt","a")
f.write(filename + "\n")
f.close
msgbox "弱弱的提示一下,您有ME文件(#{filename})丢失了..." if $丢失提示
end
me_stop
end
end
Bgm_play = method("bgm_play")
def self.bgm_play(*arg)
begin
Bgm_play.call(*arg)
rescue Errno::ENOENT
filename=[*arg][0]
unless $need_file_audio.include?(filename)
$need_file_audio.push(filename)
f = File.open("./log_audio.txt","a")
f.write(filename + "\n")
f.close
msgbox "弱弱的提示一下,您有BGM文件(#{filename})丢失了..." if $丢失提示
end
bgm_stop
end
end
Se_play = method("se_play")
def self.se_play(*arg)
begin
Se_play.call(*arg)
rescue Errno::ENOENT
filename=[*arg][0]
unless $need_file_audio.include?(filename)
$need_file_audio.push(filename)
f = File.open("./log_audio.txt","a")
f.write(filename + "\n")
f.close
msgbox "弱弱的提示一下,您有SE文件(#{filename})丢失了..." if $丢失提示
end
se_stop
end
end
Bgs_play = method("bgs_play")
def self.bgs_play(*arg)
begin
Bgs_play.call(*arg)
rescue Errno::ENOENT
filename=[*arg][0]
unless $need_file_audio.include?(filename)
$need_file_audio.push(filename)
f = File.open("./log_audio.txt","a")
f.write(filename + "\n")
f.close
msgbox "弱弱的提示一下,您有BGS文件(#{filename})丢失了..." if $丢失提示
end
bgs_stop
end
end
end
end