Resolving merge conflicts between refactor and mkxp-z

This commit is contained in:
Maruno17
2020-11-20 21:01:47 +00:00
parent ce6bc1737f
commit 6158e42635
6 changed files with 31 additions and 63 deletions

View File

@@ -110,7 +110,7 @@ module Compiler
end
lineno += 1
Graphics.update if lineno%500==0
Win32API.SetWindowText(_INTL("Processing {1} line {2}",FileLineData.file,lineno)) if lineno%50==0
pbSetWindowText(_INTL("Processing {1} line {2}",FileLineData.file,lineno)) if lineno%50==0
}
yield lastsection,sectionname if havesection
end
@@ -668,6 +668,7 @@ module Compiler
if !$INEDITOR && LANGUAGES.length>=2
pbLoadMessages("Data/"+LANGUAGES[$PokemonSystem.language][1])
end
pbSetWindowText(nil) if mkxp?
end
def main
@@ -731,24 +732,26 @@ module Compiler
end
# Check data files and PBS files, and recompile if any PBS file was edited
# more recently than the data files were last created
for i in 0...dataFiles.length
begin
File.open("Data/#{dataFiles[i]}") { |file|
latestDataTime = [latestDataTime,file.mtime.to_i].max
}
rescue SystemCallError
mustCompile = true
if !mkxp?
for i in 0...dataFiles.length
begin
File.open("Data/#{dataFiles[i]}") { |file|
latestDataTime = [latestDataTime,file.mtime.to_i].max
}
rescue SystemCallError
mustCompile = true
end
end
end
for i in 0...textFiles.length
begin
File.open("PBS/#{textFiles[i]}") { |file|
latestTextTime = [latestTextTime,file.mtime.to_i].max
}
rescue SystemCallError
for i in 0...textFiles.length
begin
File.open("PBS/#{textFiles[i]}") { |file|
latestTextTime = [latestTextTime,file.mtime.to_i].max
}
rescue SystemCallError
end
end
mustCompile |= (latestTextTime>=latestDataTime)
end
mustCompile |= (latestTextTime>=latestDataTime)
# Should recompile if holding Ctrl
Input.update
mustCompile = true if Input.press?(Input::CTRL)
@@ -762,7 +765,7 @@ module Compiler
end
end
# Recompile all data
compile_all(mustCompile) { |msg| Win32API.SetWindowText(msg) }
compile_all(mustCompile) { |msg| pbSetWindowText(msg) }
rescue Exception
e = $!
raise e if "#{e.class}"=="Reset" || e.is_a?(Reset) || e.is_a?(SystemExit)

View File

@@ -562,21 +562,13 @@ module Compiler
#=============================================================================
def compile_animations
begin
if $RPGVX
pbanims = load_data("Data/PkmnAnimations.rvdata")
else
pbanims = load_data("Data/PkmnAnimations.rxdata")
end
pbanims = load_data("Data/PkmnAnimations.rxdata")
rescue
pbanims = PBAnimations.new
end
move2anim = [[],[]]
=begin
if $RPGVX
anims = load_data("Data/Animations.rvdata")
else
anims = load_data("Data/Animations.rxdata")
end
anims = load_data("Data/Animations.rxdata")
for anim in anims
next if !anim || anim.frames.length==1
found = false

View File

@@ -9,13 +9,9 @@ module Compiler
mapfiles = {}
# Get IDs of all maps in the Data folder
Dir.chdir("Data") {
mapData = sprintf("Map*.%s",$RPGVX ? "rvdata" : "rxdata")
mapData = sprintf("Map*.rxdata")
for map in Dir.glob(mapData)
if $RPGVX
mapfiles[$1.to_i(10)] = true if map[/map(\d+)\.rvdata/i]
else
mapfiles[$1.to_i(10)] = true if map[/map(\d+)\.rxdata/i]
end
mapfiles[$1.to_i(10)] = true if map[/map(\d+)\.rxdata/i]
end
}
mapinfos = pbLoadRxData("Data/MapInfos")
@@ -41,11 +37,7 @@ module Compiler
count += 1
end
if imported
if $RPGVX
save_data(mapinfos,"Data/MapInfos.rvdata")
else
save_data(mapinfos,"Data/MapInfos.rxdata")
end
save_data(mapinfos,"Data/MapInfos.rxdata")
pbMessage(_INTL("{1} new map(s) copied to the Data folder were successfully imported.",count))
end
return imported
@@ -124,10 +116,6 @@ module Compiler
textsplit = text.split(/\\m/)
for t in textsplit
first = true
if $RPGVX
list.push(RPG::EventCommand.new(101,indent,["",0,0,2]))
first = false
end
textsplit2 = t.split(/\n/)
for i in 0...textsplit2.length
textchunk = textsplit2[i].gsub(/\s+$/,"")
@@ -266,9 +254,7 @@ module Compiler
end
def mapFilename(mapID)
filename = sprintf("Data/map%03d",mapID)
filename += ($RPGVX) ? ".rvdata" : ".rxdata"
return filename
return sprintf("Data/map%03d.rxdata", mapID)
end
def getMap(mapID)
@@ -323,7 +309,6 @@ module Compiler
end
def isPassable?(mapID,x,y)
return true if $RPGVX
map = getMap(mapID)
return false if !map
return false if x<0 || x>=map.width || y<0 || y>=map.height
@@ -344,7 +329,6 @@ module Compiler
end
def isCounterTile?(mapID,x,y)
return false if $RPGVX
map = getMap(mapID)
return false if !map
passages = getTilesetPassages(map,mapID)
@@ -362,7 +346,6 @@ module Compiler
end
def setCounterTile(mapID,x,y)
return if $RPGVX
map = getMap(mapID)
return if !map
passages = getTilesetPassages(map,mapID)
@@ -391,12 +374,8 @@ module Compiler
end
def saveTilesets
filename = "Data/Tilesets"
filename += ($RPGVX) ? ".rvdata" : ".rxdata"
save_data(@tilesets,filename)
filename = "Data/System"
filename += ($RPGVX) ? ".rvdata" : ".rxdata"
save_data(@system,filename)
save_data(@tilesets, "Data/Tilesets.rxdata")
save_data(@system, "Data/System.rxdata")
end
end
@@ -1414,7 +1393,7 @@ module Compiler
changed = false
map = mapData.getMap(id)
next if !map || !mapData.mapinfos[id]
Win32API.SetWindowText(_INTL("Processing map {1} ({2})",id,mapData.mapinfos[id].name))
pbSetWindowText(_INTL("Processing map {1} ({2})",id,mapData.mapinfos[id].name))
for key in map.events.keys
if Time.now.to_i-t>=5
Graphics.update
@@ -1449,7 +1428,7 @@ module Compiler
changed = false
Graphics.update
commonEvents = pbLoadRxData("Data/CommonEvents")
Win32API.SetWindowText(_INTL("Processing common events"))
pbSetWindowText(_INTL("Processing common events"))
for key in 0...commonEvents.length
newevent = fix_event_use(commonEvents[key],0,mapData)
if newevent
@@ -1457,12 +1436,6 @@ module Compiler
changed = true
end
end
if changed
if $RPGVX
save_data(commonEvents,"Data/CommonEvents.rvdata")
else
save_data(commonEvents,"Data/CommonEvents.rxdata")
end
end
save_data(commonEvents,"Data/CommonEvents.rxdata") if changed
end
end