Module:HeroData: Difference between revisions
m only dps in infobox made brown |
m get_lore replaced with get_localized_var |
||
Line 43: | Line 43: | ||
--{{#invoke:HeroData| | --{{#invoke:HeroData|get_localized_var|HERO_NAME|HERO_VAR}}-- | ||
p. | --i.e. |Abrams|Role -> hero_atlas_role -> Charges into close combat | ||
p.get_localized_var = function(frame) | |||
local hero_name = frame.args[1] | local hero_name = frame.args[1] | ||
lore_key = p.get_json_item(hero_name)[ | local unlocalized_var = frame.args[2] | ||
lore_key = p.get_json_item(hero_name)[unlocalized_var] | |||
if (lore_key ~= nil) then | if (lore_key ~= nil) then | ||
return lang_module._get_string(lore_key) | return lang_module._get_string(lore_key) | ||
else | else | ||
return "Hero does not have | return "Hero does not have " .. unlocalized_var .. " in their data" | ||
end | end | ||
end | end |