Editing Module:Param Parse
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 6: | Line 6: | ||
local Infobox = require('Module:Infobox') |
local Infobox = require('Module:Infobox') |
||
local currency = require('Module:Currency').parse |
local currency = require('Module:Currency').parse |
||
local editbutton = require('Module:Edit button') |
|||
local edit = editbutton("'''?''' (edit)") |
|||
local parse = {} |
local parse = {} |
||
Line 310: | Line 308: | ||
category_incomplete = 'Needs release date', |
category_incomplete = 'Needs release date', |
||
smw_property = 'Release Date', |
smw_property = 'Release Date', |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
func = parse.release_func, |
|||
⚫ | |||
smw_func = parse.release_smw, |
smw_func = parse.release_smw, |
||
} |
} |
||
Line 540: | Line 532: | ||
-- Variant type |
-- Variant type |
||
⚫ | |||
⚫ | |||
func = {name=parse.variant_type_func, params = {Infobox.raw_param('variant_type')}}, |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
local valid_variant_types = { |
local valid_variant_types = { |
||
['item'] = 'Item', |
['item'] = 'Item', |
||
['monster'] = 'Monster', |
['monster'] = 'Monster', |
||
['skill node'] = 'Skill node' |
['skill node'] = 'Skill node' |
||
['venture'] = 'Venture' |
|||
} |
} |
||
function parse.variant_type_func(type) |
function parse.variant_type_func(type) |
||
local valid_type = valid_variant_types[string.lower(type or '')] |
local valid_type = valid_variant_types[string.lower(type or '')] |
||
if valid_type then |
if valid_type then |
||
return valid_type..'[[Category:'..valid_type..' |
return valid_type..'[[Category:'..valid_type..' variant]]' |
||
else |
else |
||
return |
return '[[Category:Invalid variant type]]' |
||
end |
end |
||
return nil |
return nil |
||
end |
end |
||
parse.variant_type = { |
|||
name = 'variant_type', |
|||
func = parse.variant_type_func, |
|||
smw_func = parse.has_content, |
|||
smw_property = 'Variant type', |
|||
⚫ | |||
} |
|||
parse.passive = { |
parse.passive = { |
||
Line 574: | Line 565: | ||
function parse.duration_func(hours) |
function parse.duration_func(hours) |
||
hours = string.gsub(hours or '',',','') |
hours = string.gsub(hours or '',',','') |
||
return (tonumber(hours) .. " Hours") |
|||
return (hours .. " Hours") |
|||
end |
end |
||
Line 866: | Line 856: | ||
func = parse.has_content, |
func = parse.has_content, |
||
smw_property = 'Slot', |
smw_property = 'Slot', |
||
} |
|||
-- Event predecessor |
|||
parse.predecessor = { |
|||
name = 'predecessor', |
|||
func = parse.has_content |
|||
} |
|||
-- Event successor |
|||
parse.successor = { |
|||
name = 'successor', |
|||
func = parse.has_content |
|||
} |
} |
||