Module:Infobox Recipe/Sandbox: Difference between revisions

set to current version of main infobox
(implement kp, put it next to xp)
(set to current version of main infobox)
 
Line 85:
 
--Set SMW properties
local smw_properties = {
for _,material in ipairs(argsMaterials) do
['Uses item'] = {},
mw.smw.set({
["'Uses item" and quantity'] = material.name{},
-- these are for when a recipe is called by a subsequent recipe that uses showFull
["Uses item_and_quantity"] = material.name .. ',' .. tostring(material.quantity)
["'Uses facility"'] = args.facility,
})
-- not implemented yet, for addinadding to duration if showfull is true
end
["has'Uses duration"'] = args.duration,
}
-- these are for when a recipe is called by a subsequent recipe that uses showFull
for _, material in ipairs(argsMaterials) do
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))
["Uses facility"] = args.facility
})
end
-- not implemented yet, for addin to duration if showfull is true
if args.duration then
mw.smw.set({
["has duration"] = args.duration
})
end
if args.kp then
mw.smw.set({
["has kp"] = args.kp
})
end
 
mw.smw.set(smw_properties)
 
--Creates a row suitable for the raw materials section of the infobox.
Line 222 ⟶ 212:
:attr{ colspan = '5' }
: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' }
:wikitext(hc(args.xpexp) and (args.xpexp) or editButton("'''?''' (edit)"))
:done()
:done()
13,097

edits