Module:Param Parse: Difference between revisions

Testing function for parsing requirements
(Undo revision 15914 by The Gaffer (talk))
Tag: Undo
(Testing function for parsing requirements)
Line 437:
return nil
end
 
-- Quest difficulty
parse.difficulty = {
Line 446 ⟶ 447:
}
 
-- Requirements
function parse.requirements_func(arg)
local icon_map = {
quest = [[File:Quests_icon.png|link=Quests|width=18x18]],
profession = [[File:Scout_icon.png|link=Scout|width=18x18]],
knowledge = [[File:Knowledge_icon.png|link=Knowledge|width=18x18]],
}
local requirement_pairs = {}
for key, value in pairs(obj) do
table.insert(requirement_pairs, string.format("%s %s", icon_map[key], value))
end
 
return table.concat(requirement_pairs, " ")
end
 
parse.requirements = {
name = 'requirements',
func = parse.requirements,
smw_property = 'Requirements',
category_incomplete = 'Needs requirements'
}
 
return parse
131

edits