Toggle menu
505
2.3K
828
21.8K
Deadlock Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:AttributeData: Difference between revisions

From Deadlock Wiki
Sur (talk | contribs)
m category data
Sur (talk | contribs)
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, stats in pairs(data) do
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, stat_data in pairs(stats) do
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