Bureaucrats, emailconfirmed, Interface administrators, staff, Administrators, translation-admin, translator, Widget editors
154
edits
m (ugh) |
(Add the ability to get an inlineable item with count) |
||
Line 43: | Line 43: | ||
:GenerateHTML() | :GenerateHTML() | ||
:addClass( "catalyst" ) | :addClass( "catalyst" ) | ||
end | |||
function p.Item( f ) | |||
local args = f.args | |||
if #args == 0 then | |||
args = f:getParent().args or {""} | |||
end | |||
local spriteDiv = require([[Module:Sprite]]) | |||
:new("inventory") | |||
:setItem(mw.text.trim(args[1])) | |||
:GenerateHTML() | |||
local count = tonumber(args['count']) or tonumber(args['Count']) or 1 | |||
if count ~= 1 then | |||
local countSpan = spriteDiv:tag("span"):wikitext(count) | |||
countSpan:addClass("invslot-stacksize") | |||
end | |||
return spriteDiv | |||
end | end | ||
return p | return p |
edits