Module:Param Parse: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
(Undo revision 15914 by The Gaffer (talk))
Tag: Undo
(Testing function for parsing requirements)
Line 437: Line 437:
return nil
return nil
end
end

-- Quest difficulty
-- Quest difficulty
parse.difficulty = {
parse.difficulty = {
Line 446: Line 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
return parse