Release 0.0.1.8.8.7
This commit is contained in:
1 parent
3c8a17aa78
commit
c7beab414c
16283 files changed
+768761
-2
No files matched your search
@@ -0,0 +1,36 @@
|
||||
# encoding: UTF-8
|
||||
#==============================================================================
|
||||
# LonaCraft: mkxp-z / Ruby 3.1.0 compatibility bootstrap for the 2026-10-09
|
||||
# online build. Ruby310Compat belongs to the GAME, not the mod.
|
||||
# This file does NOT change the Ruby interpreter used by Game.exe.
|
||||
#==============================================================================
|
||||
module LonaCraft
|
||||
module Ruby310Runtime
|
||||
def self.load_game_compat
|
||||
return true if defined?(::Ruby310Compat)
|
||||
candidates = [
|
||||
File.join(Dir.pwd, "ModScripts/000_Ruby310_Compat.rb"),
|
||||
File.join(Dir.pwd, "Data/Scripts/000_Ruby310_Compat.rb")
|
||||
]
|
||||
candidates.each do |path|
|
||||
next unless File.file?(path)
|
||||
load path
|
||||
return true if defined?(::Ruby310Compat)
|
||||
end
|
||||
false
|
||||
end
|
||||
|
||||
def self.check!
|
||||
unless load_game_compat
|
||||
raise LoadError, "LonaCraft needs the game's Ruby310Compat (ModScripts/000_Ruby310_Compat.rb or Data/Scripts/000_Ruby310_Compat.rb)"
|
||||
end
|
||||
# Ruby 3.1 separates keyword arguments from positional hashes.
|
||||
# Aliases in date/menu hooks forward both **kwargs and &block.
|
||||
if defined?(RUBY_VERSION) && RUBY_VERSION.split('.').map(&:to_i)[0] < 3
|
||||
raise LoadError, "LonaCraft online build requires Ruby 3.x (detected #{RUBY_VERSION})"
|
||||
end
|
||||
true
|
||||
end
|
||||
end
|
||||
end
|
||||
LonaCraft::Ruby310Runtime.check!
|
||||
Reference in new issue
Block a user