Module:SpriteFile: Difference between revisions
No edit summary Tags: Manual revert Reverted |
m Reverted edits by Patbox (talk) to last revision by [[User:Minecraft>MarkusRost|Minecraft>MarkusRost]] Tags: Rollback Reverted |
||
| Line 17: | Line 17: | ||
local id = mw.text.trim( tostring( args[1] or '' ) ) | local id = mw.text.trim( tostring( args[1] or '' ) ) | ||
if not args.keepcase then | if not args.keepcase then | ||
id = mw.ustring.lower( id ):gsub( '[%s%+]', '-' ) | id = mw.ustring.lower( id ):gsub( '[%s%+]', '-' ) | ||
end | end | ||
local link = ( args.link or '' ) | local link = ( args.link or '' ) | ||
| Line 55: | Line 46: | ||
name = 'Invicon' | name = 'Invicon' | ||
end | end | ||
local | local file = name .. ' ' .. id .. '.png' | ||
local altText = '' | local altText = '' | ||
if link == '' then | if link == '' then | ||
altText = file .. ': Sprite image for ' .. | altText = file .. ': Sprite image for ' .. id .. ' in Minecraft' | ||
end | end | ||
if id == '' then | if id == '' then | ||
| Line 92: | Line 76: | ||
if args.title then | if args.title then | ||
spriteText:attr( 'title', args.title ) | spriteText:attr( 'title', args.title ) | ||
end | end | ||
if link ~= '' then | if link ~= '' then | ||
| Line 128: | Line 110: | ||
local text | local text | ||
if not args.notext then | if not args.notext then | ||
text = args.text or args[2] or | text = args.text or args[2] or link | ||
end | end | ||