Module:ItemInfobox

local yesno = require('Dev:Yesno') local roblox_urls = require('Module:RobloxUrls') local links = require('Module:Links') local currency = require('Module:Currency') local utils = require("Module:Utils") local infobox_utils = require('Module:InfoboxUtils')

local categorize = utils.categorize('Catalog', 'Community')

local p = {}

function p._format_title(args) if args.id == '' then return infobox_utils.error_message(" parameter missing") elseif tonumber(args.id) then if args.id == "0" then return categorize("Items which are not in the catalog") else return links.plain_external_link(roblox_urls.item_from_id(args.id), args.name) end else return infobox_utils.error_message(" must be a number") end end

p.format_title = utils.make_wrapper_function(p._format_title)

function p._format_13plus(args) if yesno(args['13plus']) then return "" .. categorize("13+ items") end end

p.format_13plus = utils.make_wrapper_function(p._format_13plus)

function p._format_tickets(args) local output = (yesno(args.limited) or yesno(args.limitedu)) and "Formerly " or '' if tonumber(args.tickets) then return currency._format_tickets(args.tickets) else return infobox_utils.error_message(" must be a number") end end

p.format_tickets = utils.make_wrapper_function(p._format_tickets)

function p._format_robux(args) local output = (yesno(args.limited) or yesno(args.limitedu)) and "Formerly " or '' if tonumber(args.robux) then return currency._format_robux(args.robux) else return infobox_utils.error_message(" must be a number") end end

p.format_robux = utils.make_wrapper_function(p._format_robux)

function p._format_free(args) if yesno(args.free) then return "Free" .. categorize("Free items") end end

p.format_free = utils.make_wrapper_function(p._format_free)

return p