UTFSTEXT = "游戏文件丢失,目录%s.\n请联系游戏的作者.\n"
#选择代替的图像(默认为空白):
UTFSSUB = ""
#是否跳过缺失的音频(true or(或者) false):
UTFSBOX = false
#============================================================
UTFS_print = UTFSBOX ? method(:print) : method(:msgbox)
class << Bitmap
alias_method :utfs_new, :new unless method_defined?(:utfs_new)
def new(*args)
utfs_new(*args)
rescue
if args.size == 1
UTFS_print.call sprintf UTFSTEXT, args[0]
end
begin
utfs_new(UTFSSUB)
rescue
utfs_new(32, 32)
end
end
end
module Audio
class << self
alias_method :utfs_se_play, :se_play
alias_method :utfs_me_play, :me_play
alias_method :utfs_bgm_play, :bgm_play
alias_method :utfs_bgs_play, :bgs_play
end
def self.se_play(filename, volume = 100, pitch = 100)
self.utfs_se_play(filename, volume, pitch)
rescue
UTFS_print.call sprintf UTFSTEXT, filename
end
def self.me_play(filename, volume = 100, pitch = 100)
self.utfs_me_play(filename, volume, pitch)
rescue
UTFS_print.call sprintf UTFSTEXT, filename
end
def self.bgm_play(filename, volume = 100, pitch = 100, pos = 0)
self.utfs_bgm_play(filename, volume, pitch, pos)
rescue
UTFS_print.call sprintf UTFSEXT, filename
end
def self.bgs_play(filename, volume = 100, pitch = 100, pos = 0)
self.utfs_bgs_play(filename, volume, pitch, pos)
rescue
UTFS_print.call sprintf UTFSTEXT, filename
end
end
UTFSTEXT = "游戏文件丢失,目录%s.\n请联系游戏的作者.\n"
#选择代替的图像(默认为空白):
UTFSSUB = ""
#是否跳过缺失的音频(true or(或者) false):
UTFSBOX = false
#============================================================
UTFS_print = UTFSBOX ? method(:print) : method(:msgbox)
class << Bitmap
alias_method :utfs_new, :new unless method_defined?(:utfs_new)
def new(*args)
utfs_new(*args)
rescue
if args.size == 1
UTFS_print.call sprintf UTFSTEXT, args[0]
end
begin
utfs_new(UTFSSUB)
rescue
utfs_new(32, 32)
end
end
end
module Audio
class << self
alias_method :utfs_se_play, :se_play
alias_method :utfs_me_play, :me_play
alias_method :utfs_bgm_play, :bgm_play
alias_method :utfs_bgs_play, :bgs_play
end
def self.se_play(filename, volume = 100, pitch = 100)
self.utfs_se_play(filename, volume, pitch)
rescue
UTFS_print.call sprintf UTFSTEXT, filename
end
def self.me_play(filename, volume = 100, pitch = 100)
self.utfs_me_play(filename, volume, pitch)
rescue
UTFS_print.call sprintf UTFSTEXT, filename
end
def self.bgm_play(filename, volume = 100, pitch = 100, pos = 0)
self.utfs_bgm_play(filename, volume, pitch, pos)
rescue
UTFS_print.call sprintf UTFSEXT, filename
end
def self.bgs_play(filename, volume = 100, pitch = 100, pos = 0)
self.utfs_bgs_play(filename, volume, pitch, pos)
rescue
UTFS_print.call sprintf UTFSTEXT, filename
end
end