Renamed various PBS files

This commit is contained in:
Maruno17
2021-06-20 20:27:57 +01:00
parent b1caf13110
commit 565b15dca4
16 changed files with 59 additions and 59 deletions

View File

@@ -189,14 +189,14 @@ module Settings
# Dex list to view if more than one is available (false). # Dex list to view if more than one is available (false).
USE_CURRENT_REGION_DEX = false USE_CURRENT_REGION_DEX = false
# The names of the Pokédex lists, in the order they are defined in the PBS # The names of the Pokédex lists, in the order they are defined in the PBS
# file "regionaldexes.txt". The last name is for the National Dex and is added # file "regional_dexes.txt". The last name is for the National Dex and is
# onto the end of this array (remember that you don't need to use it). This # added onto the end of this array (remember that you don't need to use it).
# array's order is also the order of $Trainer.pokedex.unlocked_dexes, which # This array's order is also the order of $Trainer.pokedex.unlocked_dexes,
# records which Dexes have been unlocked (the first is unlocked by default). # which records which Dexes have been unlocked (the first is unlocked by
# If an entry is just a name, then the region map shown in the Area page while # default). If an entry is just a name, then the region map shown in the Area
# viewing that Dex list will be the region map of the region the player is # page while viewing that Dex list will be the region map of the region the
# currently in. The National Dex entry should always behave like this. # player is currently in. The National Dex entry should always behave like
# If an entry is of the form [name, number], then the number is a region # this. If an entry is of the form [name, number], then the number is a region
# number. That region's map will appear in the Area page while viewing that # number. That region's map will appear in the Area page while viewing that
# Dex list, no matter which region the player is currently in. # Dex list, no matter which region the player is currently in.
def self.pokedex_names def self.pokedex_names

View File

@@ -170,7 +170,7 @@ class PokemonRegionMap_Scene
# TODO: Why is this PBS file writer here? # TODO: Why is this PBS file writer here?
def pbSaveMapData def pbSaveMapData
File.open("PBS/townmap.txt","wb") { |f| File.open("PBS/town_map.txt","wb") { |f|
Compiler.add_PBS_header_to_file(f) Compiler.add_PBS_header_to_file(f)
for i in 0...@mapdata.length for i in 0...@mapdata.length
map = @mapdata[i] map = @mapdata[i]

View File

@@ -1097,22 +1097,22 @@ DebugMenuCommands.register("createpbs", {
cmds = [ cmds = [
_INTL("[Create all]"), _INTL("[Create all]"),
"abilities.txt", "abilities.txt",
"berryplants.txt", "battle_facility_lists.txt",
"connections.txt", "berry_plants.txt",
"encounters.txt", "encounters.txt",
"items.txt", "items.txt",
"map_connections.txt",
"metadata.txt", "metadata.txt",
"moves.txt", "moves.txt",
"phone.txt", "phone.txt",
"pokemon.txt", "pokemon.txt",
"pokemonforms.txt", "pokemon_forms.txt",
"regionaldexes.txt", "regional_dexes.txt",
"ribbons.txt", "ribbons.txt",
"shadowmoves.txt", "shadow_movesets.txt",
"townmap.txt", "town_map.txt",
"trainerlists.txt", "trainer_types.txt",
"trainers.txt", "trainers.txt",
"trainertypes.txt",
"types.txt" "types.txt"
] ]
loop do loop do
@@ -1120,22 +1120,22 @@ DebugMenuCommands.register("createpbs", {
case cmd case cmd
when 0 then Compiler.write_all when 0 then Compiler.write_all
when 1 then Compiler.write_abilities when 1 then Compiler.write_abilities
when 2 then Compiler.write_berry_plants when 2 then Compiler.write_trainer_lists
when 3 then Compiler.write_connections when 3 then Compiler.write_berry_plants
when 4 then Compiler.write_encounters when 4 then Compiler.write_encounters
when 5 then Compiler.write_items when 5 then Compiler.write_items
when 6 then Compiler.write_metadata when 6 then Compiler.write_connections
when 7 then Compiler.write_moves when 7 then Compiler.write_metadata
when 8 then Compiler.write_phone when 8 then Compiler.write_moves
when 9 then Compiler.write_pokemon when 9 then Compiler.write_phone
when 10 then Compiler.write_pokemon_forms when 10 then Compiler.write_pokemon
when 11 then Compiler.write_regional_dexes when 11 then Compiler.write_pokemon_forms
when 12 then Compiler.write_ribbons when 12 then Compiler.write_regional_dexes
when 13 then Compiler.write_shadow_movesets when 13 then Compiler.write_ribbons
when 14 then Compiler.write_town_map when 14 then Compiler.write_shadow_movesets
when 15 then Compiler.write_trainer_lists when 15 then Compiler.write_town_map
when 16 then Compiler.write_trainers when 16 then Compiler.write_trainer_types
when 17 then Compiler.write_trainer_types when 17 then Compiler.write_trainers
when 18 then Compiler.write_types when 18 then Compiler.write_types
else break else break
end end

View File

@@ -128,7 +128,7 @@ module Compiler
yield lastsection,sectionname if havesection yield lastsection,sectionname if havesection
end end
# Used for types.txt, pokemon.txt, trainerlists.txt and Battle Tower trainers PBS files # Used for types.txt, pokemon.txt, battle_facility_lists.txt and Battle Tower trainers PBS files
def pbEachFileSection(f) def pbEachFileSection(f)
pbEachFileSectionEx(f) { |section,name| pbEachFileSectionEx(f) { |section,name|
yield section,name if block_given? && name[/^.+$/] yield section,name if block_given? && name[/^.+$/]
@@ -142,7 +142,7 @@ module Compiler
} }
end end
# Used for pokemonforms.txt # Used for pokemon_forms.txt
def pbEachFileSectionPokemonForms(f) def pbEachFileSectionPokemonForms(f)
pbEachFileSectionEx(f) { |section,name| pbEachFileSectionEx(f) { |section,name|
yield section,name if block_given? && name[/^\w+[-,\s]{1}\d+$/] yield section,name if block_given? && name[/^\w+[-,\s]{1}\d+$/]
@@ -221,7 +221,7 @@ module Compiler
} }
end end
# Used for connections.txt, abilities.txt, moves.txt, regionaldexes.txt # Used for map_connections.txt, abilities.txt, moves.txt, regional_dexes.txt
def pbCompilerEachPreppedLine(filename) def pbCompilerEachPreppedLine(filename)
File.open(filename,"rb") { |f| File.open(filename,"rb") { |f|
FileLineData.file = filename FileLineData.file = filename
@@ -675,7 +675,7 @@ module Compiler
clontype.sub!(/\s*$/, "") clontype.sub!(/\s*$/, "")
typ = GameData::TrainerType.try_get(clontype) typ = GameData::TrainerType.try_get(clontype)
if !typ if !typ
raise _INTL("Undefined Trainer type constant name: {1}\r\nMake sure the trainer type is defined in PBS/trainertypes.txt.\r\n{2}", type, FileLineData.linereport) raise _INTL("Undefined Trainer type constant name: {1}\r\nMake sure the trainer type is defined in PBS/trainer_types.txt.\r\n{2}", type, FileLineData.linereport)
end end
return typ.id return typ.id
end end
@@ -764,22 +764,22 @@ module Compiler
] ]
textFiles = [ textFiles = [
"abilities.txt", "abilities.txt",
"berryplants.txt", "battle_facility_lists.txt",
"connections.txt", "berry_plants.txt",
"encounters.txt", "encounters.txt",
"items.txt", "items.txt",
"map_connections.txt",
"metadata.txt", "metadata.txt",
"moves.txt", "moves.txt",
"phone.txt", "phone.txt",
"pokemon.txt", "pokemon.txt",
"pokemonforms.txt", "pokemon_forms.txt",
"regionaldexes.txt", "regional_dexes.txt",
"ribbons.txt", "ribbons.txt",
"shadowmoves.txt", "shadow_movesets.txt",
"townmap.txt", "town_map.txt",
"trainerlists.txt", "trainer_types.txt",
"trainers.txt", "trainers.txt",
"trainertypes.txt",
"types.txt" "types.txt"
] ]
latestDataTime = 0 latestDataTime = 0

View File

@@ -4,7 +4,7 @@ module Compiler
#============================================================================= #=============================================================================
# Compile Town Map data # Compile Town Map data
#============================================================================= #=============================================================================
def compile_town_map(path = "PBS/townmap.txt") def compile_town_map(path = "PBS/town_map.txt")
nonglobaltypes = { nonglobaltypes = {
"Name" => [0, "s"], "Name" => [0, "s"],
"Filename" => [1, "s"], "Filename" => [1, "s"],
@@ -52,7 +52,7 @@ module Compiler
#============================================================================= #=============================================================================
# Compile map connections # Compile map connections
#============================================================================= #=============================================================================
def compile_connections(path = "PBS/connections.txt") def compile_connections(path = "PBS/map_connections.txt")
records = [] records = []
pbCompilerEachPreppedLine(path) { |line,lineno| pbCompilerEachPreppedLine(path) { |line,lineno|
hashenum = { hashenum = {
@@ -479,7 +479,7 @@ module Compiler
#============================================================================= #=============================================================================
# Compile berry plant data # Compile berry plant data
#============================================================================= #=============================================================================
def compile_berry_plants(path = "PBS/berryplants.txt") def compile_berry_plants(path = "PBS/berry_plants.txt")
GameData::BerryPlant::DATA.clear GameData::BerryPlant::DATA.clear
pbCompilerEachCommentedLine(path) { |line, line_no| pbCompilerEachCommentedLine(path) { |line, line_no|
if line[/^\s*(\w+)\s*=\s*(.*)$/] # Of the format XXX = YYY if line[/^\s*(\w+)\s*=\s*(.*)$/] # Of the format XXX = YYY
@@ -665,7 +665,7 @@ module Compiler
#============================================================================= #=============================================================================
# Compile Pokémon forms data # Compile Pokémon forms data
#============================================================================= #=============================================================================
def compile_pokemon_forms(path = "PBS/pokemonforms.txt") def compile_pokemon_forms(path = "PBS/pokemon_forms.txt")
species_names = [] species_names = []
species_form_names = [] species_form_names = []
species_categories = [] species_categories = []
@@ -855,7 +855,7 @@ module Compiler
#============================================================================= #=============================================================================
# Compile Shadow movesets # Compile Shadow movesets
#============================================================================= #=============================================================================
def compile_shadow_movesets(path = "PBS/shadowmoves.txt") def compile_shadow_movesets(path = "PBS/shadow_movesets.txt")
sections = {} sections = {}
if safeExists?(path) if safeExists?(path)
pbCompilerEachCommentedLine(path) { |line, _line_no| pbCompilerEachCommentedLine(path) { |line, _line_no|
@@ -880,7 +880,7 @@ module Compiler
#============================================================================= #=============================================================================
# Compile Regional Dexes # Compile Regional Dexes
#============================================================================= #=============================================================================
def compile_regional_dexes(path = "PBS/regionaldexes.txt") def compile_regional_dexes(path = "PBS/regional_dexes.txt")
dex_lists = [] dex_lists = []
section = nil section = nil
pbCompilerEachPreppedLine(path) { |line, line_no| pbCompilerEachPreppedLine(path) { |line, line_no|
@@ -1094,12 +1094,12 @@ module Compiler
#============================================================================= #=============================================================================
# Compile trainer type data # Compile trainer type data
#============================================================================= #=============================================================================
def compile_trainer_types(path = "PBS/trainertypes.txt") def compile_trainer_types(path = "PBS/trainer_types.txt")
GameData::TrainerType::DATA.clear GameData::TrainerType::DATA.clear
schema = GameData::TrainerType::SCHEMA schema = GameData::TrainerType::SCHEMA
tr_type_names = [] tr_type_names = []
tr_type_hash = nil tr_type_hash = nil
# Read each line of trainertypes.txt at a time and compile it into a trainer type # Read each line of trainer_types.txt at a time and compile it into a trainer type
pbCompilerEachPreppedLine(path) { |line, line_no| pbCompilerEachPreppedLine(path) { |line, line_no|
if line[/^\s*\[\s*(.+)\s*\]\s*$/] # New section [tr_type_id] if line[/^\s*\[\s*(.+)\s*\]\s*$/] # New section [tr_type_id]
# Add previous trainer type's data to records # Add previous trainer type's data to records

View File

@@ -14,7 +14,7 @@ module Compiler
def write_town_map def write_town_map
mapdata = pbLoadTownMapData mapdata = pbLoadTownMapData
return if !mapdata return if !mapdata
File.open("PBS/townmap.txt","wb") { |f| File.open("PBS/town_map.txt","wb") { |f|
add_PBS_header_to_file(f) add_PBS_header_to_file(f)
for i in 0...mapdata.length for i in 0...mapdata.length
map = mapdata[i] map = mapdata[i]
@@ -72,7 +72,7 @@ module Compiler
conndata = load_data("Data/map_connections.dat") conndata = load_data("Data/map_connections.dat")
return if !conndata return if !conndata
mapinfos = pbLoadMapInfos mapinfos = pbLoadMapInfos
File.open("PBS/connections.txt","wb") { |f| File.open("PBS/map_connections.txt","wb") { |f|
add_PBS_header_to_file(f) add_PBS_header_to_file(f)
f.write("\#-------------------------------\r\n") f.write("\#-------------------------------\r\n")
for conn in conndata for conn in conndata
@@ -226,7 +226,7 @@ module Compiler
# Save berry plant data to PBS file # Save berry plant data to PBS file
#============================================================================= #=============================================================================
def write_berry_plants def write_berry_plants
File.open("PBS/berryplants.txt", "wb") { |f| File.open("PBS/berry_plants.txt", "wb") { |f|
add_PBS_header_to_file(f) add_PBS_header_to_file(f)
f.write("\#-------------------------------\r\n") f.write("\#-------------------------------\r\n")
GameData::BerryPlant.each do |bp| GameData::BerryPlant.each do |bp|
@@ -341,7 +341,7 @@ module Compiler
# Save Pokémon forms data to PBS file # Save Pokémon forms data to PBS file
#============================================================================= #=============================================================================
def write_pokemon_forms def write_pokemon_forms
File.open("PBS/pokemonforms.txt", "wb") { |f| File.open("PBS/pokemon_forms.txt", "wb") { |f|
idx = 0 idx = 0
add_PBS_header_to_file(f) add_PBS_header_to_file(f)
GameData::Species.each do |species| GameData::Species.each do |species|
@@ -448,7 +448,7 @@ module Compiler
#============================================================================= #=============================================================================
def write_shadow_movesets def write_shadow_movesets
shadow_movesets = pbLoadShadowMovesets shadow_movesets = pbLoadShadowMovesets
File.open("PBS/shadowmoves.txt", "wb") { |f| File.open("PBS/shadow_movesets.txt", "wb") { |f|
add_PBS_header_to_file(f) add_PBS_header_to_file(f)
f.write("\#-------------------------------\r\n") f.write("\#-------------------------------\r\n")
GameData::Species.each do |species_data| GameData::Species.each do |species_data|
@@ -465,7 +465,7 @@ module Compiler
#============================================================================= #=============================================================================
def write_regional_dexes def write_regional_dexes
dex_lists = pbLoadRegionalDexes dex_lists = pbLoadRegionalDexes
File.open("PBS/regionaldexes.txt", "wb") { |f| File.open("PBS/regional_dexes.txt", "wb") { |f|
add_PBS_header_to_file(f) add_PBS_header_to_file(f)
# Write each Dex list in turn # Write each Dex list in turn
dex_lists.each_with_index do |list, index| dex_lists.each_with_index do |list, index|
@@ -548,7 +548,7 @@ module Compiler
# Save trainer type data to PBS file # Save trainer type data to PBS file
#============================================================================= #=============================================================================
def write_trainer_types def write_trainer_types
File.open("PBS/trainertypes.txt", "wb") { |f| File.open("PBS/trainer_types.txt", "wb") { |f|
add_PBS_header_to_file(f) add_PBS_header_to_file(f)
GameData::TrainerType.each do |t| GameData::TrainerType.each do |t|
f.write("\#-------------------------------\r\n") f.write("\#-------------------------------\r\n")
@@ -624,7 +624,7 @@ module Compiler
def write_trainer_lists def write_trainer_lists
trainerlists = load_data("Data/trainer_lists.dat") rescue nil trainerlists = load_data("Data/trainer_lists.dat") rescue nil
return if !trainerlists return if !trainerlists
File.open("PBS/trainerlists.txt","wb") { |f| File.open("PBS/battle_facility_lists.txt","wb") { |f|
add_PBS_header_to_file(f) add_PBS_header_to_file(f)
for tr in trainerlists for tr in trainerlists
f.write("\#-------------------------------\r\n") f.write("\#-------------------------------\r\n")