设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 4194|回复: 0
打印 上一主题 下一主题

[通用发布] 修改过的BasePackAce(基础包装Ace)

[复制链接]
梦石
0
星屑
491
在线时间
339 小时
注册时间
2010-12-15
帖子
926

开拓者

跳转到指定楼层
1
发表于 2013-10-12 20:07:45 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
本帖最后由 tamashii 于 2013-10-12 20:09 编辑

添加了ISA.require函数,该函数用来判断需要的脚本是否被引用,以及版本是否正确。
  1. #==============================================================================
  2. #  Name [ BasePack Ace ( 基础包装 Ace ) ]
  3. #  Apply To [ RPG Maker XP & RPG Maker VX & RPG Maker VX Ace ]
  4. #------------------------------------------------------------------------------
  5. #  Author [ 忧雪の伤, Modified by Tamashii ]
  6. #  Last Update [ 2012.1.27 ]
  7. #------------------------------------------------------------------------------
  8. #  Link [ 66RPG Ideal Script Association ]
  9. #  => http://rpg.blue/group-215-1.html
  10. #  Link [ OWL Authors' Protection Organization ]
  11. #  => http://oapo.qzworld.net/index.html
  12. #==============================================================================

  13. #==============================================================================
  14. # * Registered Section
  15. #==============================================================================

  16. $imported = {} if $imported.nil?
  17. $imported['BasePack Ace'] = '2012.1.27'

  18. #==============================================================================
  19. # * Running Section
  20. #==============================================================================

  21. ISA = Module.new
  22. ISA::Edition = self ? (RUBY_VERSION == '1.9.2' ? :va : :vx) : :xp

  23. #==============================================================================
  24. # * Require another pack
  25. #==============================================================================

  26. def ISA.require(name, version)
  27.   if $imported[name] != nil
  28.     # get required version numbers
  29.     version_tokens = version.split(/\./)
  30.     year = version_tokens[0].to_i
  31.     month = version_tokens[1].to_i
  32.     day = version_tokens[2].to_i
  33.     # get imported version numbers
  34.     v_i = $imported[name]
  35.     v_i_tokens = v_i.split(/\./)
  36.     year_i = v_i_tokens[0].to_i
  37.     month_i = v_i_tokens[1].to_i
  38.     day_i = v_i_tokens[2].to_i
  39.     # compare
  40.     if year > year_i or month > month_i or day > day_i
  41.       message = "[ISA]\tInvaled version : #{v_i} with required version #{version}"
  42.       method(RUBY_VERSION == '1.9.2' ? :msgbox : :print)[message]
  43.       exit
  44.     end
  45.     return
  46.   end
  47.   message = "[ISA]\tScript not imported : #{name}"
  48.   method(RUBY_VERSION == '1.9.2' ? :msgbox : :print)[message]
  49.   exit
  50. end
复制代码
拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-25 10:18

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表