Module:HeroData: Difference between revisionsGive feedback
Jump to navigation
Jump to search
m get_hero_stat > get_hero_var |
m _attribute_order attribute_order |
||
| Line 216: | Line 216: | ||
--{{#invoke:HeroData| | --{{#invoke:HeroData|write_stat_infoboxes|HERO_NAME}} | ||
--Creates {{ | --Creates {{Infobox_stat}}'s' for the 3 categories Weapon, Vitality, Spirit | ||
p. | p.write_stat_infoboxes = function(frame) | ||
local hero_name = frame.args[1] | local hero_name = frame.args[1] | ||
if(hero_name == nil) then return "Hero parameter missing" end | if(hero_name == nil) then return "Hero parameter missing" end | ||
-- Use expandTemplate to evaluate the Infobox_hero template | -- Use expandTemplate to evaluate the Infobox_hero template | ||
local template_title = mw.title.new("Template: | local template_title = mw.title.new("Template:Infobox_stat") --name of the template | ||
local template_calls = "" --all template calls concatenated | local template_calls = "" --all template calls concatenated | ||
local template_call --current template call | local template_call --current template call | ||
| Line 242: | Line 242: | ||
local should_display | local should_display | ||
for _, category in ipairs(attribute_orders[" | for _, category in ipairs(attribute_orders["category_order"]) do | ||
stats = attributes_data[category] | stats = attributes_data[category] | ||
local category_values = category_data[category] | local category_values = category_data[category] | ||
| Line 251: | Line 251: | ||
-- Determine cell values | -- Determine cell values | ||
for _, stat_name in ipairs(attribute_orders[category][" | for _, stat_name in ipairs(attribute_orders[category]["attribute_order"]) do | ||
stat_data = stats[stat_name] | stat_data = stats[stat_name] | ||
-- Confirm its meant to be displayed in hero | -- Confirm its meant to be displayed in hero stat infobox | ||
should_display = stat_data['display_regions']['hero_statbox'] | should_display = stat_data['display_regions']['hero_statbox'] | ||
if (should_display ~= nil) then | if (should_display ~= nil) then | ||