mirror of
https://github.com/bryanthaboi/gen1recomp
synced 2026-09-27 14:02:01 -04:00
Translate FireRed ability names where they are shown
Species, move, item and trainer names reach a translation mod through registries, but nothing renames abilities: battle messages ("<POKéMON>'s <ability> prevents ...") and the summary page printed the ROM's English name whatever the language.
Abilities.name and the summary's ability line now pass the name through Strings(), keyed by the cart's English name ("SPEED BOOST", "COMPOUNDEYES"). The identifiers the battle code compares (SPEED_BOOST) and the description lookup are unchanged.
This commit is contained in:
@@ -8,9 +8,11 @@ local Abilities = {}
|
||||
-- pokefirered/src/data/text/abilities.h:162
|
||||
local DISPLAY = { COMPOUND_EYES = "COMPOUNDEYES", LIGHTNING_ROD = "LIGHTNINGROD" }
|
||||
|
||||
-- The name battle messages print. No registry renames abilities, so a
|
||||
-- translation reaches them through Strings(), keyed by the cart's English.
|
||||
function Abilities.name(ab)
|
||||
if not ab then return "" end
|
||||
return DISPLAY[ab] or (ab:gsub("_", " "))
|
||||
return Strings(DISPLAY[ab] or (ab:gsub("_", " ")))
|
||||
end
|
||||
|
||||
-- pokefirered/src/battle_util.c:31
|
||||
|
||||
@@ -583,7 +583,8 @@ local function draw_page_skills(mon)
|
||||
end
|
||||
ability = ability or "—"
|
||||
local ax, ay = cxy("abilityName", 74, 129)
|
||||
draw_text(tostring(ability), ax, ay, 80, "NORMAL")
|
||||
-- No registry renames abilities; a translation reaches the name through Strings().
|
||||
draw_text(Strings(tostring(ability)), ax, ay, 80, "NORMAL")
|
||||
local desc = SummaryData.abilityDescription(abilityId, tostring(ability))
|
||||
local ad = coords().abilityDesc or { x = 10, y = 143, w = 232 }
|
||||
draw_text(desc, ad.x or 10, ad.y or 143, ad.w or 232, "NORMAL")
|
||||
|
||||
Reference in New Issue
Block a user