Overhauled text translations

This commit is contained in:
Maruno17
2023-01-08 17:11:38 +00:00
parent ae0d193bba
commit 632b0f8b4b
23 changed files with 757 additions and 710 deletions

View File

@@ -15,7 +15,7 @@ module GameData
"SectionName" => [:id, "u"],
"Name" => [:real_name, "s"],
"Filename" => [:filename, "s"],
"Point" => [:point, "^uussUUUU"],
"Point" => [:point, "^uusSUUUU"],
"Flags" => [:flags, "*s"]
}
@@ -33,7 +33,7 @@ module GameData
# @return [String] the translated name of this region
def name
return pbGetMessage(MessageTypes::RegionNames, @id)
return pbGetMessageFromHash(MessageTypes::Regions, @real_name)
end
def has_flag?(flag)

View File

@@ -35,7 +35,7 @@ module GameData
# @return [String] the translated description of this ability
def description
return pbGetMessageFromHash(MessageTypes::AbilityDescs, @real_description)
return pbGetMessageFromHash(MessageTypes::AbilityDescriptions, @real_description)
end
def has_flag?(flag)

View File

@@ -143,13 +143,13 @@ module GameData
# @return [String] the translated portion name of this item
def portion_name
return pbGetMessageFromHash(MessageTypes::ItemPortionNames, @real_portion_name) if @real_portion_name
return pbGetMessageFromHash(MessageTypes::ItemPortions, @real_portion_name) if @real_portion_name
return name
end
# @return [String] the translated plural version of the portion name of this item
def portion_name_plural
return pbGetMessageFromHash(MessageTypes::ItemPortionNamePlurals, @real_portion_name_plural) if @real_portion_name_plural
return pbGetMessageFromHash(MessageTypes::ItemPortionPlurals, @real_portion_name_plural) if @real_portion_name_plural
return name_plural
end

View File

@@ -225,17 +225,17 @@ module GameData
# @return [String] the translated name of this form of this species
def form_name
return pbGetMessageFromHash(MessageTypes::FormNames, @real_form_name)
return pbGetMessageFromHash(MessageTypes::SpeciesForms, @real_form_name)
end
# @return [String] the translated Pokédex category of this species
def category
return pbGetMessageFromHash(MessageTypes::Kinds, @real_category)
return pbGetMessageFromHash(MessageTypes::SpeciesCategories, @real_category)
end
# @return [String] the translated Pokédex entry of this species
def pokedex_entry
return pbGetMessageFromHash(MessageTypes::Entries, @real_pokedex_entry)
return pbGetMessageFromHash(MessageTypes::PokedexEntries, @real_pokedex_entry)
end
def default_form

View File

@@ -107,7 +107,7 @@ module GameData
# @return [String] the translated in-battle lose message of this trainer
def lose_text
return pbGetMessageFromHash(MessageTypes::TrainerLoseText, @real_lose_text)
return pbGetMessageFromHash(MessageTypes::TrainerLoseTexts, @real_lose_text)
end
# Creates a battle-ready version of a trainer's data.

View File

@@ -115,7 +115,10 @@ module GameData
# @return [String] the translated name of this map
def name
return pbGetMapNameFromId(@id)
ret = pbGetMessageFromHash(MessageTypes::MapNames, @real_name)
ret = pbGetBasicMapNameFromId(@id) if nil_or_empty?(ret)
ret.gsub!(/\\PN/, $player.name) if $player
return ret
end
def has_flag?(flag)