Module:SpriteFile: Difference between revisions

No edit summary
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 58: Line 58:
if mod == 'Minecraft' or mod == 'minecraft' then
if mod == 'Minecraft' or mod == 'minecraft' then
file = name .. ' ' .. id .. '.png'
file = name .. ' ' .. nameId .. '.png'
else
else
file = name .. mod .. ' ' .. id .. '.png'
file = name .. ' ' .. mod .. ' ' .. nameId .. '.png'
end
end
local altText = ''
local altText = ''
if link == '' then
if link == '' then
altText = file .. ': Sprite image for ' .. id .. ' in ' .. mod
altText = file .. ': Sprite image for ' .. nameId .. ' in ' .. mod
end
end
if id == '' then
if id == '' then
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