Module:Param Parse: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
No edit summary
No edit summary
Line 464: Line 464:


-- Unlock Level
-- Unlock Level
function parse.unlock_level_func(level, profession)
function parse.unlock_level_func(profession, level)
local level_num = parse.number(level)
local level_valid = parse.number(level)
local profession_valid = parse.has_content(profession)
return '[[File:'..profession..'_icon.png|link='..profession..'|width=18x18]] '..level_num
return '[[File:'..profession_valid..'_icon.png|link='..profession_valid..'|width=18x18]] '..level_valid
end

function parse.unlock_level_smw(profession, level)
local profession_valid = parse.has_content(profession)
local level_valid = parse.number(level)
if not profession_valid then
return nil
end
if not level_valid then
return nil
end
return profession_valid..','..level_valid
end
end


parse.unlock_level = {
parse.unlock_level = {
name = 'unlock_level',
name = 'unlock_level',
func = {name = parse.unlock_level_func, params = {Infobox.raw_param('unlock_level'), Infobox.raw_param('profession_a')}},
func = {name = parse.unlock_level_func, params = {Infobox.raw_param('profession_a'), Infobox.raw_param('unlock_level')}},
smw_property = 'Unlocked at',
smw_property = 'Unlocked at',
smw_func = parse.unlock_level_smw
}
}