Module:Icons: Difference between revisions

Use class in place of inline styles
(Add override for Lemon Season)
(Use class in place of inline styles)
(10 intermediate revisions by 4 users not shown)
Line 45: Line 45:
["Hardcore Adventure Speedrun"] = "svg",
["Hardcore Adventure Speedrun"] = "svg",
["Mastery Tokens"] = "gif",
["Mastery Tokens"] = "gif",
["Lesser Relics"] = "gif",
["Prat, the Serpent of Fire"] = "svg",
["Prat, the Serpent of Fire"] = "svg",
["Unholy Prayers"] = "svg",
["Unholy Prayers"] = "svg",
Line 204: Line 205:
["Trickery Temple"] = "png",
["Trickery Temple"] = "png",
["Underwater City"] = "png",
["Underwater City"] = "png",
["Underwater Ruins"] = "png"
["Underwater Ruins"] = "png",
["Eye-conic Cave"] = "png",
["Mucky Cave"] = "png",
["Lost Temple"] = "png",
["Ritual Site"] = "png",
["Shipwreck Cove"] = "png",
}
}
}
}
Line 783: Line 789:


if menu then
if menu then
return '{| class="articletable" style="display:inline-block;vertical-align:middle;"\r\n|-\r\n|' .. expIcon .. resultText .. '\r\n|}'
return '{| class="articletable img-text" style="vertical-align:middle;"\r\n|-\r\n|' .. expIcon .. resultText .. '\r\n|}'
elseif not noicon and not nospan then
elseif not noicon and not nospan then
return '<span style="display:inline-block">' .. expIcon .. resultText .. '</span>'
return '<span class="img-text">' .. expIcon .. resultText .. '</span>'
else
else
return resultText
return resultText
Line 804: Line 810:
result = result.." Level "..level
result = result.." Level "..level


result = '<span style="display:inline-block">'..result..'</span>'
result = '<span class="img-text">'..result..'</span>'
return result
return result
end
end
Line 831: Line 837:
result = result..p.Icon({linkname, img=iconname, type='item', notext=true, nospan=true, alt=altTextItem})..p.Icon({'Mastery', notext=true, nospan=true, alt=altTextMastery})
result = result..p.Icon({linkname, img=iconname, type='item', notext=true, nospan=true, alt=altTextItem})..p.Icon({'Mastery', notext=true, nospan=true, alt=altTextMastery})
if showText then result = result..'[['..linkname..']] [[Mastery]]' end
if showText then result = result..'[['..linkname..']] [[Mastery]]' end
result = '<span style="display:inline-block">'..result..'</span>'
result = '<span class="img-text">'..result..'</span>'
return result
return result
end
end
Line 843: Line 849:
end
end


function p._Currency(fileName, link, altText, amt, maxAmt)
function p._Currency(fileName, link, altText, amount, maxAmount)
local amtText = nil
local ret = {}
if tonumber(amt) ~= nil then
table.insert(ret, '<span class="img-text">')
amtText = formatnum(amt)
local sep = ''
if maxAmt ~= nil and maxAmt >= amt then
-- Currency amounts
amtText = amtText .. ' - ' .. formatnum(maxAmt)
if tonumber(amount) ~= nil then
sep = '&nbsp;'
local function numColour(amount)
if tonumber(amount) < 0 then
return '<span style="color:red;">' .. formatnum(amount) .. '</span>'
else
return formatnum(amount)
end
end
table.insert(ret, numColour(amount))
if (tonumber(maxAmount) ~= nil and maxAmount > amount) then
table.insert(ret, ' - ' .. numColour(maxAmount))
end
end
end
end
 
-- Currency icon
local fileText = ''
if fileName ~= nil then
if fileName ~= nil then
fileText = '[[File:' .. fileName .. '|25px'
table.insert(ret, sep .. '[[File:' .. fileName .. '|25px')
if link ~= nil then
if link ~= nil then
fileText = fileText .. '|link=' .. link
table.insert(ret, '|link=' .. link)
end
end
fileText = fileText .. '|alt=' .. ((altText == nil and '') or altText) .. ']]'
table.insert(ret, '|alt=' .. ((altText == nil and '') or altText) .. ']]')
end
end
 
table.insert(ret, '</span>')
return '<span style="display:inline-block">' .. fileText .. (amtText ~= nil and '&nbsp;' .. amtText or '') .. '</span>'
return table.concat(ret)
end
end


Line 883: Line 900:
function p.AoD()
function p.AoD()
return p.Icon({'Atlas of Discovery Expansion', notext=true, img='AoD', alt=''})
return p.Icon({'Atlas of Discovery Expansion', notext=true, img='AoD', alt=''})
end
-- Prework to have function call available for when DLC releases.
-- Remove comments and uncomment line below when the image is available.
function p.ItA()
--return p.Icon({'Into the Abyss Expansion', notext=true, img='ItA', alt=''})
return nil
end
end