12,883
edits
(Icon: Expand support for 'section links' to include POIs; remove duplicate extension overrides) |
(Use inline-flex instead of inline-block; reverse order of amount & image for _Currency) |
||
(13 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 185: | Line 186: | ||
["Aranite Sieve"] = "png", | ["Aranite Sieve"] = "png", | ||
["Aranite Trowel"] = "png", | ["Aranite Trowel"] = "png", | ||
["Travel Token"] = "png", | |||
["Dig Site Token"] = "png", | |||
["Summoner's Pack I"] = "png", | |||
["Summoners' Pack II"] = "png", | |||
["Summoners' Pack III"] = "png", | |||
-- Marks (Summoning), included to override the type level override above | -- Marks (Summoning), included to override the type level override above | ||
["Eagle"] = "png", | ["Eagle"] = "png", | ||
Line 198: | Line 204: | ||
["Cult Grounds"] = "png", | ["Cult Grounds"] = "png", | ||
["Trickery Temple"] = "png", | ["Trickery Temple"] = "png", | ||
["Underwater City"] = "png" | ["Underwater City"] = "png", | ||
["Underwater Ruins"] = "png", | |||
["Eye-conic Cave"] = "png", | |||
["Mucky Cave"] = "png", | |||
["Lost Temple"] = "png", | |||
["Ritual Site"] = "png", | |||
["Shipwreck Cove"] = "png", | |||
} | } | ||
} | } | ||
Line 273: | Line 285: | ||
["Winter"] = "png", | ["Winter"] = "png", | ||
["Nightfall"] = "png", | ["Nightfall"] = "png", | ||
["Solar Eclipse | ["Solar Eclipse"] = "png" | ||
} | } | ||
} | } | ||
Line 323: | Line 334: | ||
["Cartographer's Enhancement"] = {'Cartography', 'skill'}, | ["Cartographer's Enhancement"] = {'Cartography', 'skill'}, | ||
["Cartographer's Knowledge"] = {'Cartography', 'skill'}, | ["Cartographer's Knowledge"] = {'Cartography', 'skill'}, | ||
["Combat Supply I"] = {'Adamant Javelin', 'item'}, | |||
["Combat Supply II"] = {'Rune Javelin', 'item'}, | |||
["Combat Supply III"] = {'Dragon Javelin', 'item'}, | |||
-- Golbin Raid shop items | -- Golbin Raid shop items | ||
["Reduce Wave Skip Cost"] = {'Melvor Logo', ''}, | ["Reduce Wave Skip Cost"] = {'Melvor Logo', ''}, | ||
Line 411: | 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 445: | Line 461: | ||
["Birthday Present (Utility)"] = "Christmas Present (Blue)", | ["Birthday Present (Utility)"] = "Christmas Present (Blue)", | ||
["Birthday Present (Gathering)"] = "Christmas Present (Green)", | ["Birthday Present (Gathering)"] = "Christmas Present (Green)", | ||
["Birthday Present (Combat)"] = "Christmas Present (White)" | ["Birthday Present (Combat)"] = "Christmas Present (White)", | ||
["Clue Scroll 1"] = "Event Clue 1", | |||
["Clue Scroll 2"] = "Event Clue 1", | |||
["Clue Scroll 3"] = "Event Clue 1", | |||
["Clue Scroll 4"] = "Event Clue 1", | |||
["Clue Scroll 5"] = "Event Clue 1", | |||
["Clue Scroll 6"] = "Event Clue 1" | |||
} | } | ||
--When calling for an icon for Key + Type, replace with image Value, and optionally override type also | --When calling for an icon for Key + Type, replace with image Value, and optionally override type also | ||
Line 767: | Line 789: | ||
if menu then | if menu then | ||
return '{| class="articletable" style="display:inline- | return '{| class="articletable" style="display:inline-flex;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- | return '<span style="display:inline-flex">' .. expIcon .. resultText .. '</span>' | ||
else | else | ||
return resultText | return resultText | ||
Line 788: | Line 810: | ||
result = result.." Level "..level | result = result.." Level "..level | ||
result = '<span style="display:inline- | result = '<span style="display:inline-flex">'..result..'</span>' | ||
return result | return result | ||
end | end | ||
Line 815: | 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- | result = '<span style="display:inline-flex">'..result..'</span>' | ||
return result | return result | ||
end | end | ||
Line 827: | Line 849: | ||
end | end | ||
function p._Currency(fileName, link, altText, | function p._Currency(fileName, link, altText, amount, maxAmount) | ||
local | local ret = {} | ||
if tonumber( | table.insert(ret, '<span style="display:inline-flex">') | ||
local sep = '' | |||
if | -- Currency amounts | ||
if tonumber(amount) ~= nil then | |||
sep = ' ' | |||
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 | |||
if fileName ~= nil then | if fileName ~= nil then | ||
table.insert(ret, sep .. '[[File:' .. fileName .. '|25px') | |||
if link ~= nil then | if link ~= nil then | ||
table.insert(ret, '|link=' .. link) | |||
end | end | ||
table.insert(ret, '|alt=' .. ((altText == nil and '') or altText) .. ']]') | |||
end | end | ||
table.insert(ret, '</span>') | |||
return table.concat(ret) | |||
end | end | ||
Line 867: | 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 | ||