mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Reimplemented comparing edit times of PBS/data files to decide whether to compile
This commit is contained in:
@@ -797,6 +797,28 @@ module Compiler
|
|||||||
write_all
|
write_all
|
||||||
mustCompile = true
|
mustCompile = true
|
||||||
end
|
end
|
||||||
|
# Check data files and PBS files, and recompile if any PBS file was edited
|
||||||
|
# more recently than the data files were last created
|
||||||
|
dataFiles.each do |filename|
|
||||||
|
next if !safeExists?("Data/" + filename)
|
||||||
|
begin
|
||||||
|
File.open("Data/#{filename}") { |file|
|
||||||
|
latestDataTime = [latestDataTime, file.mtime.to_i].max
|
||||||
|
}
|
||||||
|
rescue SystemCallError
|
||||||
|
mustCompile = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
textFiles.each do |filename|
|
||||||
|
next if !safeExists?("PBS/" + filename)
|
||||||
|
begin
|
||||||
|
File.open("PBS/#{filename}") { |file|
|
||||||
|
latestTextTime = [latestTextTime, file.mtime.to_i].max
|
||||||
|
}
|
||||||
|
rescue SystemCallError
|
||||||
|
end
|
||||||
|
end
|
||||||
|
mustCompile |= (latestTextTime >= latestDataTime)
|
||||||
# Should recompile if holding Ctrl
|
# Should recompile if holding Ctrl
|
||||||
Input.update
|
Input.update
|
||||||
mustCompile = true if Input.press?(Input::CTRL)
|
mustCompile = true if Input.press?(Input::CTRL)
|
||||||
@@ -804,7 +826,7 @@ module Compiler
|
|||||||
if mustCompile
|
if mustCompile
|
||||||
for i in 0...dataFiles.length
|
for i in 0...dataFiles.length
|
||||||
begin
|
begin
|
||||||
File.delete("Data/#{dataFiles[i]}") if File.exists?("Data/#{dataFiles[i]}")
|
File.delete("Data/#{dataFiles[i]}") if safeExists?("Data/#{dataFiles[i]}")
|
||||||
rescue SystemCallError
|
rescue SystemCallError
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -774,7 +774,7 @@ module Compiler
|
|||||||
#=============================================================================
|
#=============================================================================
|
||||||
def compile_shadow_movesets
|
def compile_shadow_movesets
|
||||||
sections = {}
|
sections = {}
|
||||||
if File.exists?("PBS/shadowmoves.txt")
|
if safeExists?("PBS/shadowmoves.txt")
|
||||||
pbCompilerEachCommentedLine("PBS/shadowmoves.txt") { |line, _line_no|
|
pbCompilerEachCommentedLine("PBS/shadowmoves.txt") { |line, _line_no|
|
||||||
if line[/^\s*(\w+)\s*=\s*(.*)$/]
|
if line[/^\s*(\w+)\s*=\s*(.*)$/]
|
||||||
key = $1
|
key = $1
|
||||||
|
|||||||
Reference in New Issue
Block a user