Module:Param Parse: Difference between revisions
no edit summary
No edit summary |
No edit summary |
||
Line 448:
-- Requirements
function parse.requirements_func(
local icon_map = {
min_weapon_strength = [[File:Scout_icon.png|link=Scout|width=18x18]]
}▼
}
end▼
local _, profession, knowledge, quest, min_weapon_strength =
return table.concat(requirement_pairs, " ")▼
input:gmatch("(.-),(.-)%.-%s+(.-),%.-%s+(.-),%.-%s+(.-)")
if not profession or not knowledge or not quest or not min_weapon_strength then
return "Invalid input"
▲ end
local profession_name, profession_value = profession:match("(%w+)%s+(%S+)")
local knowledge_value = knowledge
local quest_value = quest
local min_weapon_strength_value = min_weapon_strength
local result = {
icon_map[profession] .. " " .. profession_value,
icon_map.knowledge .. " " .. knowledge_value,
icon_map.quest .. " " .. quest_value,
icon_map["min_weapon_strength"] .. " " .. min_weapon_strength_value
▲ }
end
parse.requirements = {
name = 'requirements',
func
smw_property = 'Requirements',
category_incomplete = 'Needs requirements'
|