Editing Module:Infobox Recipe/Sandbox

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

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
for _,material in ipairs(argsMaterials) do
local smw_properties = {
mw.smw.set({
['Uses item'] = {},
['Uses item and quantity'] = {},
["Uses item"] = material.name,
["Uses item_and_quantity"] = material.name .. ',' .. tostring(material.quantity)
-- these are for when a recipe is called by a subsequent recipe that uses showFull
})
['Uses facility'] = args.facility,
end
-- not implemented yet, for adding to duration if showfull is true
['Uses duration'] = args.duration,
-- these are for when a recipe is called by a subsequent recipe that uses showFull
}
if args.facility then
for _, material in ipairs(argsMaterials) do
mw.smw.set({
table.insert(smw_properties['Uses item'], material.name)
["Uses facility"] = args.facility
table.insert(smw_properties['Uses item and quantity'], ('%s,%s'):format(material.name, material.quantity))
})
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
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 212: Line 222:
:attr{ colspan = '5' }
:attr{ colspan = '5' }
:css{ ['text-align'] = 'center' }
:css{ ['text-align'] = 'center' }
:wikitext(hc(args.kp) and ('%s%%'):format(args.kp) or editButton("'''?''' (edit)"))
:wikitext(hc(args.kp) and (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.exp) and (args.exp) or editButton("'''?''' (edit)"))
:wikitext(hc(args.xp) and (args.xp) or editButton("'''?''' (edit)"))
:done()
:done()
:done()
:done()
Please note that all contributions to Brighter Shores Wiki are considered to be released under the CC BY-NC-SA 3.0 (see Brighter Shores:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)
Preview page with this template

Template used on this page: