Anonymous

Module:Icons: Difference between revisions

From Melvor Idle
Fix - wrap class around image only (exclude text)
(Adding typeImgOverrides and CSS classes (imgClassOverrides), and adding Township resources and stats)
(Fix - wrap class around image only (exclude text))
(One intermediate revision by the same user not shown)
Line 250: Line 250:
['Herbs'] = {'Garum Herb', 'item'},
['Herbs'] = {'Garum Herb', 'item'},
['Clothing'] = {'Leather Body', 'item'},
['Clothing'] = {'Leather Body', 'item'},
-- Township generic statue building
['Statue of Worship'] = 'Statue of Nothing',
-- Easter egg stuff
-- Easter egg stuff
["Lemonade (Empty)"] = "Lemonade",
["Lemonade (Empty)"] = "Lemonade",
Line 397: Line 399:
class = ovrClass
class = ovrClass
end
end
class = class ~= nil and class ~= '' and ' class="'..class..'"' or ''
-- There are a couple specific double overrides to be included that don't fit in the above lists
-- There are a couple specific double overrides to be included that don't fit in the above lists
if ambiguousOverrides[link] then
if ambiguousOverrides[link] then
Line 416: Line 417:
local txtLink = '|link=' .. (nolink and notext and '' or 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 .. ']]'
if class ~= nil and class ~= '' then
resultText = '<span class="'..class..'">'..resultText..'</span>'
end
end
end


Line 435: Line 439:
return '{| class="articletable" style="display:inline-block;vertical-align:middle;"\r\n|-\r\n|' .. resultText .. '\r\n|}'
return '{| class="articletable" style="display:inline-block;vertical-align:middle;"\r\n|-\r\n|' .. resultText .. '\r\n|}'
elseif not noicon then
elseif not noicon then
return '<span style="display:inline-block"'..class..'>' .. resultText .. '</span>'
return '<span style="display:inline-block">' .. resultText .. '</span>'
else
else
return resultText
return resultText
572

edits