More actions
m category data |
m ordering category and attributes |
||
Line 45: | Line 45: | ||
local hero_datas = mw.loadJsonData("Data:HeroData.json") | local hero_datas = mw.loadJsonData("Data:HeroData.json") | ||
local hero_data = hero_data_module.get_json_item(hero_name) | local hero_data = hero_data_module.get_json_item(hero_name) | ||
local stats --stats of the current category | |||
if (hero_data == nil) then return "Hero Not Found" end | if (hero_data == nil) then return "Hero Not Found" end | ||
local category_data = { | local category_data = { | ||
Line 64: | Line 65: | ||
} | } | ||
for category | for category in ipairs(data["_category_order"]) do | ||
stats = data[category] | |||
local category_values = category_data[category] | local category_values = category_data[category] | ||
template_args["box_name"] = category_values.box_name | template_args["box_name"] = category_values.box_name | ||
Line 72: | Line 75: | ||
-- Determine cell values | -- Determine cell values | ||
for stat_name | for stat_name in ipairs(stats["_attribute_order"]) do | ||
stat_data = stats[stat_name] | |||
alternate_name = stat_data["alternate_name"] | alternate_name = stat_data["alternate_name"] | ||
Line 94: | Line 99: | ||
end | end | ||
template_args["cell_values"] = cell_values | template_args["cell_values"] = cell_values | ||