加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
这样……因为游戏全程无菜单,所以希望能实现F12键暂停游戏同时显示一张图片的功能。
目前F12因为用了容错脚本所以会报错。
容错脚本:
#============================================================================== # ■ 容错脚本第3版 BY 轮回者 #------------------------------------------------------------------------------ # 本脚本基于星大叔的容错脚本第2版,区别只是“下手”的地方不同而已。 # 说明请参看星大叔的容错脚本第2版。 #============================================================================== $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 end @transition.call(ary[0]) end end end class Bitmap < Object alias ini initialize def initialize(*arg) begin ini(*arg) rescue Errno::ENOENT filename=[*arg][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 end ini(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 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 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 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 end bgs_stop end end end
#==============================================================================
# ■ 容错脚本第3版 BY 轮回者
#------------------------------------------------------------------------------
# 本脚本基于星大叔的容错脚本第2版,区别只是“下手”的地方不同而已。
# 说明请参看星大叔的容错脚本第2版。
#==============================================================================
$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
end
@transition.call(ary[0])
end
end
end
class Bitmap < Object
alias ini initialize
def initialize(*arg)
begin
ini(*arg)
rescue Errno::ENOENT
filename=[*arg][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
end
ini(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
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
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
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
end
bgs_stop
end
end
end
|