Project1
标题:
修改过的BasePackAce(基础包装Ace)
[打印本页]
作者:
tamashii
时间:
2013-10-12 20:07
标题:
修改过的BasePackAce(基础包装Ace)
本帖最后由 tamashii 于 2013-10-12 20:09 编辑
添加了ISA.require函数,该函数用来判断需要的脚本是否被引用,以及版本是否正确。
#==============================================================================
# Name [ BasePack Ace ( 基础包装 Ace ) ]
# Apply To [ RPG Maker XP & RPG Maker VX & RPG Maker VX Ace ]
#------------------------------------------------------------------------------
# Author [ 忧雪の伤, Modified by Tamashii ]
# Last Update [ 2012.1.27 ]
#------------------------------------------------------------------------------
# Link [ 66RPG Ideal Script Association ]
# => http://rpg.blue/group-215-1.html
# Link [ OWL Authors' Protection Organization ]
# => http://oapo.qzworld.net/index.html
#==============================================================================
#==============================================================================
# * Registered Section
#==============================================================================
$imported = {} if $imported.nil?
$imported['BasePack Ace'] = '2012.1.27'
#==============================================================================
# * Running Section
#==============================================================================
ISA = Module.new
ISA::Edition = self ? (RUBY_VERSION == '1.9.2' ? :va : :vx) : :xp
#==============================================================================
# * Require another pack
#==============================================================================
def ISA.require(name, version)
if $imported[name] != nil
# get required version numbers
version_tokens = version.split(/\./)
year = version_tokens[0].to_i
month = version_tokens[1].to_i
day = version_tokens[2].to_i
# get imported version numbers
v_i = $imported[name]
v_i_tokens = v_i.split(/\./)
year_i = v_i_tokens[0].to_i
month_i = v_i_tokens[1].to_i
day_i = v_i_tokens[2].to_i
# compare
if year > year_i or month > month_i or day > day_i
message = "[ISA]\tInvaled version : #{v_i} with required version #{version}"
method(RUBY_VERSION == '1.9.2' ? :msgbox : :print)[message]
exit
end
return
end
message = "[ISA]\tScript not imported : #{name}"
method(RUBY_VERSION == '1.9.2' ? :msgbox : :print)[message]
exit
end
复制代码
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1