Anonymous

Module:Icons: Difference between revisions

From Melvor Idle
Icon: Modify link logic to prevent linking to File pages when nolink is specified
(Icon: Fix issue with order of overrides)
(Icon: Modify link logic to prevent linking to File pages when nolink is specified)
(One intermediate revision by the same user not shown)
Line 274: Line 274:
["Impossible Longbow"] = 'png',
["Impossible Longbow"] = 'png',
["Throwing Dragon Sword"] = 'png',
["Throwing Dragon Sword"] = 'png',
["Golbin Crate"] = 'png'
["Golbin Crate"] = 'png',
["Bone"] = 'png'
}
}


Line 451: Line 452:
local txtImg = (iconType ~= nil and iconType ~= '' and img .. '_(' .. iconType .. ')' or img) .. '.' .. ext
local txtImg = (iconType ~= nil and iconType ~= '' and img .. '_(' .. iconType .. ')' or img) .. '.' .. ext
-- Include a link unless no link -and- no text was requested
-- Include a link unless no link -and- no text was requested
local txtLink = (nolink and notext and '' or '|link=' .. link)
local txtLink = '|link=' .. (nolink and notext and '' or link)
resultText = '[[File:' .. txtImg .. '|' .. txtSize .. 'x' .. txtSize .. 'px' .. txtLink .. ']]'
resultText = '[[File:' .. txtImg .. '|' .. txtSize .. 'x' .. txtSize .. 'px' .. txtLink .. ']]'
end
end