From 128a002324c7532f85574e38c0509b0c3d3c70cd Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Sat, 12 Jun 2021 19:05:22 +0100 Subject: [PATCH] Fix for messages not being reloaded after the game is compiled --- Data/Scripts/021_Compiler/001_Compiler.rb | 109 +++++++++--------- .../004_Compiler_MapsAndEvents.rb | 4 +- Data/Scripts/999_Main/999_Main.rb | 1 + 3 files changed, 56 insertions(+), 58 deletions(-) diff --git a/Data/Scripts/021_Compiler/001_Compiler.rb b/Data/Scripts/021_Compiler/001_Compiler.rb index 649e4cdab..86f589c8f 100644 --- a/Data/Scripts/021_Compiler/001_Compiler.rb +++ b/Data/Scripts/021_Compiler/001_Compiler.rb @@ -676,63 +676,60 @@ 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")) - compile_town_map # No dependencies - yield(_INTL("Compiling map connection data")) - compile_connections # No dependencies - yield(_INTL("Compiling phone data")) - compile_phone - yield(_INTL("Compiling type data")) - compile_types # No dependencies - yield(_INTL("Compiling ability data")) - compile_abilities # No dependencies - yield(_INTL("Compiling move data")) - compile_moves # Depends on Type - yield(_INTL("Compiling item data")) - compile_items # Depends on Move - yield(_INTL("Compiling berry plant data")) - compile_berry_plants # Depends on Item - yield(_INTL("Compiling Pokémon data")) - compile_pokemon # Depends on Move, Item, Type, Ability - yield(_INTL("Compiling Pokémon forms data")) - compile_pokemon_forms # Depends on Species, Move, Item, Type, Ability - yield(_INTL("Compiling machine data")) - compile_move_compatibilities # Depends on Species, Move - yield(_INTL("Compiling shadow moveset data")) - compile_shadow_movesets # Depends on Species, Move - yield(_INTL("Compiling Regional Dexes")) - compile_regional_dexes # Depends on Species - yield(_INTL("Compiling ribbon data")) - compile_ribbons # No dependencies - yield(_INTL("Compiling encounter data")) - compile_encounters # Depends on Species - yield(_INTL("Compiling Trainer type data")) - compile_trainer_types # No dependencies - yield(_INTL("Compiling Trainer data")) - compile_trainers # Depends on Species, Item, Move - yield(_INTL("Compiling battle Trainer data")) - compile_trainer_lists # Depends on TrainerType - yield(_INTL("Compiling metadata")) - compile_metadata # Depends on TrainerType - yield(_INTL("Compiling animations")) - compile_animations - yield(_INTL("Converting events")) - compile_trainer_events(mustCompile) - yield(_INTL("Saving messages")) - pbSetTextMessages - MessageTypes.saveMessages - echoln "" - echoln _INTL("*** Finished full compile ***") - echoln "" - System.reload_cache - end + echoln _INTL("*** Starting full compile ***") + echoln "" + yield(_INTL("Compiling town map data")) + compile_town_map # No dependencies + yield(_INTL("Compiling map connection data")) + compile_connections # No dependencies + yield(_INTL("Compiling phone data")) + compile_phone # No dependencies + yield(_INTL("Compiling type data")) + compile_types # No dependencies + yield(_INTL("Compiling ability data")) + compile_abilities # No dependencies + yield(_INTL("Compiling move data")) + compile_moves # Depends on Type + yield(_INTL("Compiling item data")) + compile_items # Depends on Move + yield(_INTL("Compiling berry plant data")) + compile_berry_plants # Depends on Item + yield(_INTL("Compiling Pokémon data")) + compile_pokemon # Depends on Move, Item, Type, Ability + yield(_INTL("Compiling Pokémon forms data")) + compile_pokemon_forms # Depends on Species, Move, Item, Type, Ability + yield(_INTL("Compiling machine data")) + compile_move_compatibilities # Depends on Species, Move + yield(_INTL("Compiling shadow moveset data")) + compile_shadow_movesets # Depends on Species, Move + yield(_INTL("Compiling Regional Dexes")) + compile_regional_dexes # Depends on Species + yield(_INTL("Compiling ribbon data")) + compile_ribbons # No dependencies + yield(_INTL("Compiling encounter data")) + compile_encounters # Depends on Species + yield(_INTL("Compiling Trainer type data")) + compile_trainer_types # No dependencies + yield(_INTL("Compiling Trainer data")) + compile_trainers # Depends on Species, Item, Move + yield(_INTL("Compiling battle Trainer data")) + compile_trainer_lists # Depends on TrainerType + yield(_INTL("Compiling metadata")) + compile_metadata # Depends on TrainerType + yield(_INTL("Compiling animations")) + compile_animations + yield(_INTL("Converting events")) + compile_trainer_events(mustCompile) + 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 "" pbSetWindowText(nil) end diff --git a/Data/Scripts/021_Compiler/004_Compiler_MapsAndEvents.rb b/Data/Scripts/021_Compiler/004_Compiler_MapsAndEvents.rb index 99aa05add..a9ea08f86 100644 --- a/Data/Scripts/021_Compiler/004_Compiler_MapsAndEvents.rb +++ b/Data/Scripts/021_Compiler/004_Compiler_MapsAndEvents.rb @@ -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)) diff --git a/Data/Scripts/999_Main/999_Main.rb b/Data/Scripts/999_Main/999_Main.rb index 516de92ea..257b0cbf1 100644 --- a/Data/Scripts/999_Main/999_Main.rb +++ b/Data/Scripts/999_Main/999_Main.rb @@ -24,6 +24,7 @@ end def mainFunctionDebug begin + MessageTypes.loadMessageFile("Data/messages.dat") if safeExists?("Data/messages.dat") PluginManager.runPlugins Compiler.main Game.initialize