Module:Param Parse: Difference between revisions

Add new "unlock_profession" arg that defaults to "profession_a" but could be different (+Property:Unlock profession)
(parse a value parameter of 'N/A' as a valid option, and return 'N/A' as the output instead of a currency value)
(Add new "unlock_profession" arg that defaults to "profession_a" but could be different (+Property:Unlock profession))
Line 672:
 
-- Unlock Level
function parse.unlock_level_funcunlock_profession_func(professionunlock_profession, levelprofession)
return parse.has_content(unlock_profession) or parse.has_content(profession)
end
 
function parse.unlock_level_func(unlock_profession, profession, level)
local level_valid = parse.number(level)
local profession_valid = parse.has_contentunlock_profession_func(unlock_profession, profession)
local profession_valid_link = profession_valid
Line 695 ⟶ 699:
end
 
function parse.unlock_level_smw(unlock_profession, profession, level)
local profession_valid = parse.has_contentunlock_profession_func(unlock_profession, profession)
local level_valid = parse.number(level)
Line 709 ⟶ 713:
return level_valid
end
 
parse.unlock_profession_smw = {
name = 'unlock_profession_smw',
func = {name = parse.unlock_profession_func, params = {Infobox.raw_param('unlock_profession'), Infobox.raw_param('profession_a')}},
smw_property = 'Unlock profession',
}
 
parse.unlock_level = {
name = 'unlock_level',
func = {name = parse.unlock_level_func, params = {Infobox.raw_param('unlock_profession'), Infobox.raw_param('profession_a'), Infobox.raw_param('unlock_level')}},
smw_property = 'Unlock level',
smw_func = {name = parse.unlock_level_smw, params = {Infobox.raw_param('unlock_profession'), Infobox.raw_param('profession_a'), Infobox.raw_param('unlock_level')}},
category_incomplete = 'Needs unlock level',
}
1,524

edits