Module:Infobox Recipe/Sandbox: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
(implement kp, put it next to xp) |
(set to current version of main infobox) |
||
Line 85: | Line 85: | ||
--Set SMW properties |
--Set SMW properties |
||
local smw_properties = { |
|||
⚫ | |||
['Uses item'] = {}, |
|||
mw.smw.set({ |
|||
['Uses item and quantity'] = {}, |
|||
⚫ | |||
["Uses item_and_quantity"] = material.name .. ',' .. tostring(material.quantity) |
|||
⚫ | |||
}) |
|||
⚫ | |||
end |
|||
⚫ | |||
} |
|||
⚫ | |||
⚫ | |||
if args.facility then |
|||
table.insert(smw_properties['Uses item'], material.name) |
|||
mw.smw.set({ |
|||
table.insert(smw_properties['Uses item and quantity'], ('%s,%s'):format(material.name, material.quantity)) |
|||
⚫ | |||
}) |
|||
end |
|||
⚫ | |||
if args.duration then |
|||
mw.smw.set({ |
|||
⚫ | |||
}) |
|||
end |
|||
if args.kp then |
|||
mw.smw.set({ |
|||
["has kp"] = args.kp |
|||
}) |
|||
end |
end |
||
mw.smw.set(smw_properties) |
|||
--Creates a row suitable for the raw materials section of the infobox. |
--Creates a row suitable for the raw materials section of the infobox. |
||
Line 222: | Line 212: | ||
:attr{ colspan = '5' } |
:attr{ colspan = '5' } |
||
:css{ ['text-align'] = 'center' } |
:css{ ['text-align'] = 'center' } |
||
:wikitext(hc(args.kp) and (args.kp) or editButton("'''?''' (edit)")) |
:wikitext(hc(args.kp) and ('%s%%'):format(args.kp) or editButton("'''?''' (edit)")) |
||
:done() |
:done() |
||
:tag('td') |
:tag('td') |
||
:attr{ colspan = '5' } |
:attr{ colspan = '5' } |
||
:css{ ['text-align'] = 'center' } |
:css{ ['text-align'] = 'center' } |
||
:wikitext(hc(args. |
:wikitext(hc(args.exp) and (args.exp) or editButton("'''?''' (edit)")) |
||
:done() |
:done() |
||
:done() |
:done() |