61 lines
1.5 KiB
Ruby
61 lines
1.5 KiB
Ruby
begin
|
|||
|
|
unless defined?(Ruby310Compat)
|
||
|
|
compat_candidates = []
|
||
|
|
begin
|
||
|
|
cwd = Dir.pwd.to_s
|
||
|
|
unless cwd.nil? || cwd.empty?
|
||
|
|
compat_candidates << File.expand_path('ModScripts/000_Ruby310_Compat.rb', cwd)
|
||
|
|
compat_candidates << File.expand_path('000_Ruby310_Compat.rb', cwd)
|
||
|
|
end
|
||
|
|
rescue StandardError
|
||
|
|
end
|
||
|
|
begin
|
||
|
|
script_dir = File.dirname(__FILE__)
|
||
|
|
unless script_dir.nil? || script_dir.empty?
|
||
|
|
compat_candidates << File.expand_path('000_Ruby310_Compat.rb', script_dir)
|
||
|
|
end
|
||
|
|
rescue StandardError
|
||
|
|
end
|
||
|
|
compat_candidates.compact.uniq.each do |path|
|
||
|
|
begin
|
||
|
|
next unless File.file?(path)
|
||
|
|
load path
|
||
|
|
break if defined?(Ruby310Compat)
|
||
|
|
rescue StandardError
|
||
|
|
end
|
||
|
|
end
|
||
|
|
end
|
||
|
|
rescue StandardError
|
||
|
|
end
|
||
|
|
|
||
|
|
$lang = $LonaINI["LonaRPG"]["Language"]
|
||
|
|
$game_text = Text.new("Text/#{$lang}")
|
||
|
|
#module FileGetter
|
||
|
|
#end
|
||
|
|
$mod_manager.link_texts
|
||
|
|
$mod_manager.load_mods(binding)
|
||
|
|
|
||
|
|
|
||
|
|
#if !File.exist?("GameMods.ini")
|
||
|
|
# new_file = IniFile.new
|
||
|
|
# # set properties
|
||
|
|
# new_file["Mods"]={}
|
||
|
|
# # pretty print object
|
||
|
|
# p new_file
|
||
|
|
# # set file path
|
||
|
|
# new_file.filename = "GameMods.ini"
|
||
|
|
# # save file
|
||
|
|
# new_file.write()
|
||
|
|
#end
|
||
|
|
#$ModINI = IniFile.load("GameMods.ini")
|
||
|
|
#
|
||
|
|
#module FileGetter
|
||
|
|
# def self.mods_remove_sections_folder_not_found
|
||
|
|
# $ModINI.sections.each{|folder|
|
||
|
|
# next if Dir.exist?("ModScripts/_Mods/#{folder}")
|
||
|
|
# prp "Mod folder not found! Remove GameMods.ini=>#{folder}"
|
||
|
|
# $ModINI.delete_section(folder)
|
||
|
|
# }
|
||
|
|
# end
|
||
|
|
#end
|
||
|
|
#FileGetter.mods_remove_sections_folder_not_found
|