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 141: | Line 147: | ||
:tag('td') |
:tag('td') |
||
:attr{ colspan = '10' } |
:attr{ colspan = '10' } |
||
:css{ ['text-align'] = ' |
:css{ ['text-align'] = 'left' } |
||
:wikitext('[[File:' .. facility .. '.png|30px|link=' .. facility .. ']] [[' .. facility .. ']]') |
:wikitext('[[File:' .. facility .. '.png|30px|link=' .. facility .. ']] [[' .. facility .. ']]') |
||
:done() |
:done() |
||
Line 165: | Line 171: | ||
:tag('td') |
:tag('td') |
||
:attr{ colspan = '11' } |
:attr{ colspan = '11' } |
||
:css{ ['text-align'] = 'center' } |
|||
:wikitext(hc(args.facility) and ('[[File:%s.png|link=%s|30px]] [[%s]]'):format(args.facility, args.facility, args.facility) or editButton("'''?''' (edit)")) |
:wikitext(hc(args.facility) and ('[[File:%s.png|link=%s|30px]] [[%s]]'):format(args.facility, args.facility, args.facility) or editButton("'''?''' (edit)")) |
||
Line 173: | Line 178: | ||
:tag('th') |
:tag('th') |
||
:attr{ colspan = '2' } |
:attr{ colspan = '2' } |
||
:wikitext(' |
:wikitext('Time') |
||
:done() |
:done() |
||
:tag('td') |
:tag('td') |
||
:attr{ colspan = '11' } |
:attr{ colspan = '11' } |
||
⚫ | |||
:css{ ['text-align'] = 'center' } |
|||
⚫ | |||
:done() |
:done() |
||
Line 191: | Line 195: | ||
: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 210: | ||
: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)")) |