Module:ItemData: Difference between revisionsGive feedback
No edit summary |
added function to get component name |
||
| Line 70: | Line 70: | ||
return item[property] | return item[property] | ||
end | |||
p.get_component_name = function(frame) | |||
local item_name = frame.args[1] | |||
local item = get_json_item(item_name) | |||
if(item == nil) then return "Item Not Found" end | |||
local components = item['Components'] | |||
if(item == nil) then return "Components Not Found" end | |||
local component = get_json_item(components[1]) | |||
return component['Name'] | |||
end | end | ||
return p | return p | ||