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 end
lineno += 1 lineno += 1
Graphics.update if lineno%500==0 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 yield lastsection,sectionname if havesection
end end
@@ -668,6 +668,7 @@ module Compiler
if !$INEDITOR && LANGUAGES.length>=2 if !$INEDITOR && LANGUAGES.length>=2
pbLoadMessages("Data/"+LANGUAGES[$PokemonSystem.language][1]) pbLoadMessages("Data/"+LANGUAGES[$PokemonSystem.language][1])
end end
pbSetWindowText(nil) if mkxp?
end end
def main def main
@@ -731,24 +732,26 @@ module Compiler
end end
# Check data files and PBS files, and recompile if any PBS file was edited # Check data files and PBS files, and recompile if any PBS file was edited
# more recently than the data files were last created # more recently than the data files were last created
for i in 0...dataFiles.length if !mkxp?
begin for i in 0...dataFiles.length
File.open("Data/#{dataFiles[i]}") { |file| begin
latestDataTime = [latestDataTime,file.mtime.to_i].max File.open("Data/#{dataFiles[i]}") { |file|
} latestDataTime = [latestDataTime,file.mtime.to_i].max
rescue SystemCallError }
mustCompile = true rescue SystemCallError
mustCompile = true
end
end end
end for i in 0...textFiles.length
for i in 0...textFiles.length begin
begin File.open("PBS/#{textFiles[i]}") { |file|
File.open("PBS/#{textFiles[i]}") { |file| latestTextTime = [latestTextTime,file.mtime.to_i].max
latestTextTime = [latestTextTime,file.mtime.to_i].max }
} rescue SystemCallError
rescue SystemCallError end
end end
mustCompile |= (latestTextTime>=latestDataTime)
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)
@@ -762,7 +765,7 @@ module Compiler
end end
end end
# Recompile all data # Recompile all data
compile_all(mustCompile) { |msg| Win32API.SetWindowText(msg) } compile_all(mustCompile) { |msg| pbSetWindowText(msg) }
rescue Exception rescue Exception
e = $! e = $!
raise e if "#{e.class}"=="Reset" || e.is_a?(Reset) || e.is_a?(SystemExit) 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 def compile_animations
begin begin
if $RPGVX pbanims = load_data("Data/PkmnAnimations.rxdata")
pbanims = load_data("Data/PkmnAnimations.rvdata")
else
pbanims = load_data("Data/PkmnAnimations.rxdata")
end
rescue rescue
pbanims = PBAnimations.new pbanims = PBAnimations.new
end end
move2anim = [[],[]] move2anim = [[],[]]
=begin =begin
if $RPGVX anims = load_data("Data/Animations.rxdata")
anims = load_data("Data/Animations.rvdata")
else
anims = load_data("Data/Animations.rxdata")
end
for anim in anims for anim in anims
next if !anim || anim.frames.length==1 next if !anim || anim.frames.length==1
found = false found = false

View File

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