Module:SpriteFile: Difference between revisions

Jump to navigation Jump to search
No edit summary
No edit summary
Line 39: Line 39:
-- end
-- end
-- Edited to turn regular links into vanilla: prefixes and to turn parallel: prefixes into regular links
-- Edited to turn regular links into links with ' (Vanilla)' at the end and to turn parallel: prefixes into regular links
local link = ( args.link or '' )
local link = ( args.link or '' )
if mw.ustring.lower( link ) == 'none' then
if mw.ustring.lower( link ) == 'none' then
Line 110: Line 110:
spriteText = '[' .. link .. ' ' .. tostring( spriteText ) .. ']'
spriteText = '[' .. link .. ' ' .. tostring( spriteText ) .. ']'
else
else
if string.find(link, "parallel:") then  -- <---- this sub-if/else statement is new
spriteText = '[[' .. link .. '|' .. tostring( spriteText ) .. ']]'
-- have to do this weird inner tostring here bc something about converting the spriteText table causes the text indentation to be correct
spriteText = '[[' .. mw.ustring.gsub( link, "[Pp]arallel:", "" ):gsub("^%l", string.upper) .. '|' .. mw.ustring.gsub( tostring(spriteText), "[Pp]arallel:", "" ):gsub("^%l", string.upper) .. ']]'
else
spriteText = '[[' .. link .. ' (Vanilla)' .. '|' .. tostring( spriteText ) .. ']]'
end
end
end
end
end