Module:Icons: Difference between revisions

no edit summary
(Amend overrides for V1.2.2 additions)
No edit summary
Tag: Manual revert
(9 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 279: Line 285:
["Winter"] = "png",
["Winter"] = "png",
["Nightfall"] = "png",
["Nightfall"] = "png",
["Solar Eclipse"] = "png",
["Solar Eclipse"] = "png"
["Lemon Season"] = "png"
}
}
}
}
Line 420: Line 425:
-- Township generic statue building
-- Township generic statue building
['Statue of Worship'] = 'Statue of Nothing',
['Statue of Worship'] = 'Statue of Nothing',
-- Township seasons
["Lemon Season"] = 'Spring',
-- Easter egg stuff
-- Easter egg stuff
["Lemonade (Empty)"] = "Lemonade",
["Lemonade (Empty)"] = "Lemonade",
Line 842: 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 style="display:inline-block">')
amtText = formatnum(amt)
-- Currency icon
if maxAmt ~= nil and maxAmt >= amt then
if fileName ~= nil then
amtText = amtText .. ' - ' .. formatnum(maxAmt)
table.insert(ret, '[[File:' .. fileName .. '|25px')
if link ~= nil then
table.insert(ret, '|link=' .. link)
end
end
table.insert(ret, '|alt=' .. ((altText == nil and '') or altText) .. ']]')
end
end
 
-- Currency amounts
local fileText = ''
if tonumber(amount) ~= nil then
if fileName ~= nil then
local function numColour(amount)
fileText = '[[File:' .. fileName .. '|25px'
if tonumber(amount) < 0 then
if link ~= nil then
return '<span style="color:red;">' .. formatnum(amount) .. '</span>'
fileText = fileText .. '|link=' .. link
else
return formatnum(amount)
end
end
table.insert(ret, '&nbsp;' .. numColour(amount))
if (tonumber(maxAmount) ~= nil and maxAmount > amount) then
table.insert(ret, ' - ' .. numColour(maxAmount))
end
end
fileText = fileText .. '|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 882: Line 898:
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


432

edits