Module:SpriteFile: Difference between revisions

No edit summary
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 60: Line 60:
file = name .. ' ' .. nameId .. '.png'
file = name .. ' ' .. nameId .. '.png'
else
else
file = name .. mod .. ' ' .. nameId .. '.png'
file = name .. ' ' .. mod .. ' ' .. nameId .. '.png'
end
end
Line 128: Line 128:
local text
local text
if not args.notext then
if not args.notext then
text = args.text or args[2] or link
text = args.text or args[2] or ''
if text == '' then
local nameStart = (link:find( ':' ) or 0 ) + 1
if nameStart - 1 == #link then
nameStart = 1
end
text = link:sub( nameStart, ( link:find( '[,%[]', nameStart ) or 0 ) - 1 )
end
end
end