Fix for messages not being reloaded after the game is compiled

This commit is contained in:
Maruno17
2021-06-12 19:05:22 +01:00
parent 8dec89bb50
commit 128a002324
3 changed files with 56 additions and 58 deletions

View File

@@ -676,11 +676,8 @@ module Compiler
# Compile all data # Compile all data
#============================================================================= #=============================================================================
def compile_all(mustCompile) def compile_all(mustCompile)
return if !mustCompile
FileLineData.clear FileLineData.clear
if (!$INEDITOR || Settings::LANGUAGES.length < 2) && safeExists?("Data/messages.dat")
MessageTypes.loadMessageFile("Data/messages.dat")
end
if mustCompile
echoln _INTL("*** Starting full compile ***") echoln _INTL("*** Starting full compile ***")
echoln "" echoln ""
yield(_INTL("Compiling town map data")) yield(_INTL("Compiling town map data"))
@@ -688,7 +685,7 @@ module Compiler
yield(_INTL("Compiling map connection data")) yield(_INTL("Compiling map connection data"))
compile_connections # No dependencies compile_connections # No dependencies
yield(_INTL("Compiling phone data")) yield(_INTL("Compiling phone data"))
compile_phone compile_phone # No dependencies
yield(_INTL("Compiling type data")) yield(_INTL("Compiling type data"))
compile_types # No dependencies compile_types # No dependencies
yield(_INTL("Compiling ability data")) yield(_INTL("Compiling ability data"))
@@ -728,11 +725,11 @@ module Compiler
yield(_INTL("Saving messages")) yield(_INTL("Saving messages"))
pbSetTextMessages pbSetTextMessages
MessageTypes.saveMessages MessageTypes.saveMessages
MessageTypes.loadMessageFile("Data/messages.dat") if safeExists?("Data/messages.dat")
System.reload_cache
echoln "" echoln ""
echoln _INTL("*** Finished full compile ***") echoln _INTL("*** Finished full compile ***")
echoln "" echoln ""
System.reload_cache
end
pbSetWindowText(nil) pbSetWindowText(nil)
end end

View File

@@ -512,7 +512,7 @@ module Compiler
end end
return nil if battles.length<=0 return nil if battles.length<=0
# Run trainer check now, except in editor # Run trainer check now, except in editor
trainerChecker.pbTrainerBattleCheck(trtype,trname,battleid) if !$INEDITOR trainerChecker.pbTrainerBattleCheck(trtype,trname,battleid)
# Set the event's charset to one depending on the trainer type if the event # Set the event's charset to one depending on the trainer type if the event
# doesn't have a charset # doesn't have a charset
if firstpage.graphic.character_name=="" && GameData::TrainerType.exists?(trtype) if firstpage.graphic.character_name=="" && GameData::TrainerType.exists?(trtype)
@@ -570,7 +570,7 @@ module Compiler
# Write rematch and last pages # Write rematch and last pages
for i in 1...battles.length for i in 1...battles.length
# Run trainer check now, except in editor # Run trainer check now, except in editor
trainerChecker.pbTrainerBattleCheck(trtype,trname,battleid+i) if !$INEDITOR trainerChecker.pbTrainerBattleCheck(trtype,trname,battleid+i)
if i==battles.length-1 if i==battles.length-1
push_branch(rematchpage.list,sprintf("pbPhoneBattleCount(%s)>=%d",safetrcombo,i)) push_branch(rematchpage.list,sprintf("pbPhoneBattleCount(%s)>=%d",safetrcombo,i))
push_branch(lastpage.list,sprintf("pbPhoneBattleCount(%s)>%d",safetrcombo,i)) push_branch(lastpage.list,sprintf("pbPhoneBattleCount(%s)>%d",safetrcombo,i))

View File

@@ -24,6 +24,7 @@ end
def mainFunctionDebug def mainFunctionDebug
begin begin
MessageTypes.loadMessageFile("Data/messages.dat") if safeExists?("Data/messages.dat")
PluginManager.runPlugins PluginManager.runPlugins
Compiler.main Compiler.main
Game.initialize Game.initialize