#==============================================================================
# ★ 输出脚本
#==============================================================================
path = 'scripts'
ext = '.rb'
output = lambda do
Dir.mkdir(path) unless File.directory?(path)
$RGSS_SCRIPTS.each_with_index do |(_, tag, _, contents), i|
next unless tag.start_with?('★')..tag.start_with?('☆')
next if contents.force_encoding("utf-8").empty?
filename = tag.delete('/:*?"<>|\\')
if filename.empty?
msgbox "Warning: script #{i} with an invalid tag"
else
File.open("#{path}/#{filename}#{ext}", "wb") {|f| f << contents }
end
end
msgbox 'Scripts output successfully.'
exit
end
#~ output.call if $TEST
#==============================================================================
# ★ 输出脚本
#==============================================================================
path = 'scripts'
ext = '.rb'
output = lambda do
Dir.mkdir(path) unless File.directory?(path)
$RGSS_SCRIPTS.each_with_index do |(_, tag, _, contents), i|
next unless tag.start_with?('★')..tag.start_with?('☆')
next if contents.force_encoding("utf-8").empty?
filename = tag.delete('/:*?"<>|\\')
if filename.empty?
msgbox "Warning: script #{i} with an invalid tag"
else
File.open("#{path}/#{filename}#{ext}", "wb") {|f| f << contents }
end
end
msgbox 'Scripts output successfully.'
exit
end
#~ output.call if $TEST