Module:HeroData: Difference between revisionsGive feedback
Jump to navigation
Jump to search
m Typo |
m concept for get_hero_infobox |
||
| Line 49: | Line 49: | ||
return hero_scalar | return hero_scalar | ||
end | |||
--{{#invoke:HeroData|write_hero_infobox|HERO_NAME}}-- | |||
p.write_hero_infobox = function(frame) | |||
hero_name = frame.args[1] | |||
hero = get_json_item(hero_name) | |||
local template = "{{Infobox_hero" | |||
if(hero == nil) then return "Hero Not Found" end | |||
for stat_name,stat_value in pairs(hero) do | |||
if (type(stat_value) == "table") then --catches SpiritScaling, LevelScaling, BoundedAbilities, etc. | |||
local a=1 | |||
else | |||
template = template .. "|" .. stat_name .. "=" .. stat_value | |||
end | |||
template = template .. "<br>" --temporary, used for illustration/debugging, won't be in final function | |||
end | |||
template = template .. "}}" | |||
return template | |||
end | end | ||