Module:AttributeData: Difference between revisions
Jump to navigation
Jump to search
m category data moved back to attr module |
m removed require hero for inf loop; data>attributes_data |
||
Line 1: | Line 1: | ||
local p = {}; | local p = {}; | ||
local | local attributes_data = mw.loadJsonData("Data:AttributeData.json") | ||
local category_data = { --category specific parameters | local category_data = { --category specific parameters | ||
["Weapon"] = { | ["Weapon"] = { | ||
Line 25: | Line 22: | ||
-- returns the table of a specific item | -- returns the table of a specific item | ||
function get_json_item(name) | function get_json_item(name) | ||
for i,v in pairs( | for i,v in pairs(attributes_data) do | ||
if (i == name) then | if (i == name) then | ||
return v | return v |
Revision as of 03:26, 19 September 2024
Documentation for this module may be created at Module:AttributeData/doc
local p = {};
local attributes_data = mw.loadJsonData("Data:AttributeData.json")
local category_data = { --category specific parameters
["Weapon"] = {
unlocalized_name = "CitadelCategoryWeapon",
rgb = "213, 144, 63"
},
["Vitality"] = {
unlocalized_name = "CitadelCategoryArmor",
rgb = "116, 176, 28"
},
["Spirit"] = {
unlocalized_name = "CitadelCategoryTech",
rgb = "194, 136, 240"
},
}
function get_category_data()
return category_data
end
-- returns the table of a specific item
function get_json_item(name)
for i,v in pairs(attributes_data) do
if (i == name) then
return v
end
end
return nil
end
return p