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
#=============================================================================
def compile_all(mustCompile)
return if !mustCompile
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 ""
yield(_INTL("Compiling town map data"))
@@ -688,7 +685,7 @@ module Compiler
yield(_INTL("Compiling map connection data"))
compile_connections # No dependencies
yield(_INTL("Compiling phone data"))
compile_phone
compile_phone # No dependencies
yield(_INTL("Compiling type data"))
compile_types # No dependencies
yield(_INTL("Compiling ability data"))
@@ -728,11 +725,11 @@ module Compiler
yield(_INTL("Saving messages"))
pbSetTextMessages
MessageTypes.saveMessages
MessageTypes.loadMessageFile("Data/messages.dat") if safeExists?("Data/messages.dat")
System.reload_cache
echoln ""
echoln _INTL("*** Finished full compile ***")
echoln ""
System.reload_cache
end
pbSetWindowText(nil)
end

View File

@@ -512,7 +512,7 @@ module Compiler
end
return nil if battles.length<=0
# 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
# doesn't have a charset
if firstpage.graphic.character_name=="" && GameData::TrainerType.exists?(trtype)
@@ -570,7 +570,7 @@ module Compiler
# Write rematch and last pages
for i in 1...battles.length
# 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
push_branch(rematchpage.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
begin
MessageTypes.loadMessageFile("Data/messages.dat") if safeExists?("Data/messages.dat")
PluginManager.runPlugins
Compiler.main
Game.initialize