Moved global/map metadata constants and schema into modules

This commit is contained in:
Maruno17
2020-10-16 22:05:38 +01:00
parent 71a4d09224
commit e82b5409fb
25 changed files with 170 additions and 164 deletions

View File

@@ -12,10 +12,10 @@ def pbCompileMetadata
if line[/^\s*\[\s*(\d+)\s*\]\s*$/]
sectionname = $~[1]
if currentmap==0
if sections[currentmap][MetadataHome]==nil
if sections[currentmap][Metadata::HOME]==nil
raise _INTL("The entry Home is required in metadata.txt section [{1}]",sectionname)
end
if sections[currentmap][MetadataPlayerA]==nil
if sections[currentmap][Metadata::PLAYER_A]==nil
raise _INTL("The entry PlayerA is required in metadata.txt section [{1}]",sectionname)
end
end
@@ -32,9 +32,9 @@ def pbCompileMetadata
schema = nil
FileLineData.setSection(currentmap,matchData[1],matchData[2])
if currentmap==0
schema = PokemonMetadata::GlobalTypes[matchData[1]]
schema = Metadata::SCHEMA[matchData[1]]
else
schema = PokemonMetadata::NonGlobalTypes[matchData[1]]
schema = MapMetadata::SCHEMA[matchData[1]]
end
if schema
record = pbGetCsvRecord(matchData[2],lineno,schema)