Editing Module:Infobox Recipe/Sandbox
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 85: | Line 85: | ||
--Set SMW properties |
--Set SMW properties |
||
⚫ | |||
local smw_properties = { |
|||
mw.smw.set({ |
|||
['Uses item'] = {}, |
|||
[ |
["Uses item"] = material.name, |
||
["Uses item_and_quantity"] = material.name .. ',' .. tostring(material.quantity) |
|||
⚫ | |||
}) |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
table.insert(smw_properties['Uses item'], material.name) |
|||
table.insert(smw_properties['Uses item and quantity'], ('%s,%s'):format(material.name, material.quantity)) |
|||
end |
end |
||
⚫ | |||
⚫ | |||
mw.smw.set(smw_properties) |
|||
if args.facility then |
|||
mw.smw.set({ |
|||
⚫ | |||
}) |
|||
end |
|||
⚫ | |||
if args.duration then |
|||
mw.smw.set({ |
|||
⚫ | |||
}) |
|||
end |
|||
--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 173: | Line 179: | ||
:tag('th') |
:tag('th') |
||
:attr{ colspan = '2' } |
:attr{ colspan = '2' } |
||
:wikitext(' |
:wikitext('Time') |
||
:done() |
:done() |
||
:tag('td') |
:tag('td') |
||
Line 191: | Line 197: | ||
:done() |
:done() |
||
:tag('th') |
:tag('th') |
||
:attr{ colspan = ' |
:attr{ colspan = '10' } |
||
:wikitext('KP') |
|||
:done() |
|||
:tag('th') |
|||
:attr{ colspan = '5' } |
|||
:wikitext('XP') |
:wikitext('XP') |
||
:done() |
:done() |
||
Line 210: | Line 212: | ||
:done() |
:done() |
||
:tag('td') |
:tag('td') |
||
:attr{ colspan = ' |
:attr{ colspan = '10' } |
||
:css{ ['text-align'] = 'center' } |
|||
:wikitext(hc(args.kp) and ('%s%%'):format(args.kp) or editButton("'''?''' (edit)")) |
|||
:done() |
|||
:tag('td') |
|||
:attr{ colspan = '5' } |
|||
:css{ ['text-align'] = 'center' } |
:css{ ['text-align'] = 'center' } |
||
:wikitext(hc(args.exp) and (args.exp) or editButton("'''?''' (edit)")) |
:wikitext(hc(args.exp) and (args.exp) or editButton("'''?''' (edit)")) |