432
edits
(AoD: Use icon) |
No edit summary Tag: Manual revert |
||
(24 intermediate revisions by 6 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", | ||
["Museum"] = "svg", | |||
-- Items | -- Items | ||
["Amulet of Fishing"] = "svg", | ["Amulet of Fishing"] = "svg", | ||
Line 101: | Line 103: | ||
["Mark"] = "svg", | ["Mark"] = "svg", | ||
["Astro"] = "svg", | ["Astro"] = "svg", | ||
-- Curses & spells, included to override the type level override above | -- Curses & spells, included to override the type level override above | ||
["Madness"] = "png", | ["Madness"] = "png", | ||
Line 184: | Line 182: | ||
["Steel Sieve"] = "png", | ["Steel Sieve"] = "png", | ||
["Steel Trowel"] = "png", | ["Steel Trowel"] = "png", | ||
["Aranite Brush"] = "png", | |||
["Aranite Shovel"] = "png", | |||
["Aranite Sieve"] = "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 197: | 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 239: | Line 252: | ||
["Possessed Barrel"] = "svg", | ["Possessed Barrel"] = "svg", | ||
["Lich"] = "svg", | ["Lich"] = "svg", | ||
["Earth Golem (AoD)"] = "svg", | |||
["Magic Golem"] = "svg", | ["Magic Golem"] = "svg", | ||
["Magic Mirror"] = "svg", | ["Magic Mirror"] = "svg", | ||
Line 271: | Line 285: | ||
["Winter"] = "png", | ["Winter"] = "png", | ||
["Nightfall"] = "png", | ["Nightfall"] = "png", | ||
["Solar Eclipse | ["Solar Eclipse"] = "png" | ||
} | } | ||
} | } | ||
Line 295: | Line 308: | ||
["Golbin Raid"] = {'Golden Golbin', 'pet'}, | ["Golbin Raid"] = {'Golden Golbin', 'pet'}, | ||
["Throne of the Herald Expansion"] = 'TotH', | ["Throne of the Herald Expansion"] = 'TotH', | ||
["Atlas of Discovery Expansion"] = 'AoD', | |||
["Dig Site Map"] = {'Extra Archaeology Map Slot', 'upgrade'}, | |||
-- Spellbooks | -- Spellbooks | ||
["Ancient Magicks"] = {'Ancient', 'spellType'}, | ["Ancient Magicks"] = {'Ancient', 'spellType'}, | ||
Line 302: | Line 317: | ||
["Auroras"] = {'Aurora', 'spellType'}, | ["Auroras"] = {'Aurora', 'spellType'}, | ||
-- Shop purchases | -- Shop purchases | ||
['Extra Bank Slot'] = {'Bank Slot', 'upgrade'}, | |||
['Basic Resupply'] = {'Lobster', 'item'}, | ['Basic Resupply'] = {'Lobster', 'item'}, | ||
['Standard Resupply'] = {'Crab', 'item'}, | ['Standard Resupply'] = {'Crab', 'item'}, | ||
Line 318: | 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 | |||
["Reduce Wave Skip Cost"] = {'Melvor Logo', ''}, | |||
["Food Bonus"] = {'Melvor Logo', ''}, | |||
["Ammo Gatherer"] = {'Melvor Logo', ''}, | |||
["Rune Pouch"] = {'Melvor Logo', ''}, | |||
["Increase Starting Prayer Points"] = {'Melvor Logo', ''}, | |||
["Unlock Combat Passive Slot"] = {'Melvor Logo', ''}, | |||
["Prayer"] = {'Prayer', 'skill'}, | |||
["Increase Prayer Level"] = {'Prayer', 'skill'}, | |||
["Increase Prayer Points gained per Wave Completion"] = {'Prayer', 'skill'}, | |||
["Faster Golbin Spawns"] = {'Timer', ''}, | |||
-- Alt.Magic spells using item icons | -- Alt.Magic spells using item icons | ||
['Item Alchemy'] = {'Item Alchemy III', 'spell'}, | ['Item Alchemy'] = {'Item Alchemy III', 'spell'}, | ||
Line 395: | 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 427: | Line 459: | ||
["Lemonade (Full)"] = "Lemonade", | ["Lemonade (Full)"] = "Lemonade", | ||
["Birthday Present (Artisan)"] = "Christmas Present (Yellow)", | ["Birthday Present (Artisan)"] = "Christmas Present (Yellow)", | ||
["Birthday Present ( | ["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 449: | Line 487: | ||
["Trickery Temple"] = {'Lost Temple', 'poi'}, | ["Trickery Temple"] = {'Lost Temple', 'poi'}, | ||
["Golem Territory"] = {'Monuments', 'poi'} | ["Golem Territory"] = {'Monuments', 'poi'} | ||
}, | |||
['mark'] = { | |||
["Tortoise"] = {'Golbin Thief', 'mark'} | |||
} | } | ||
} | } | ||
Line 455: | Line 496: | ||
['Alt Magic'] = 'Alternative Magic', | ['Alt Magic'] = 'Alternative Magic', | ||
['Alt. Magic'] = 'Alternative Magic', | ['Alt. Magic'] = 'Alternative Magic', | ||
['Spider2'] = 'Brown Spider' | ['Spider2'] = 'Brown Spider', | ||
['Earth Golem (AoD)'] = 'Earth Golem (AoD)' | |||
} | } | ||
--When calling for an icon for Key + Type, the link goes to Value | --When calling for an icon for Key + Type, the link goes to Value | ||
local typeLinkOverrides = { | local typeLinkOverrides = { | ||
[' | ['biome'] = { | ||
['Grasslands'] = 'Biomes', | |||
[' | ['Forest'] = 'Biomes', | ||
[' | ['Mountains'] = 'Biomes', | ||
[' | ['Water'] = 'Biomes', | ||
[' | ['Swamp'] = 'Biomes', | ||
[' | ['Valley'] = 'Biomes', | ||
['Arid Plains'] = 'Biomes', | |||
['Jungle'] = 'Biomes', | |||
['Desert'] = 'Biomes', | |||
['Snowlands'] = 'Biomes' | |||
}, | }, | ||
['resource'] = { | ['resource'] = { | ||
Line 481: | Line 527: | ||
['Leather'] = '', | ['Leather'] = '', | ||
['Clothing'] = '' | ['Clothing'] = '' | ||
}, | |||
['spellType'] = { | |||
-- Spellbooks | |||
['Standard'] = 'Standard Magic', | |||
['Ancient'] = 'Ancient Magicks', | |||
['Archaic'] = 'Archaic Magicks', | |||
['Curse'] = 'Curses', | |||
['Aurora'] = 'Auroras' | |||
}, | }, | ||
['township'] = { | ['township'] = { | ||
Line 493: | Line 547: | ||
['Solar Eclipse'] = 'Seasons' | ['Solar Eclipse'] = 'Seasons' | ||
}, | }, | ||
[' | ['upgrade'] = { | ||
[' | -- Shop purchases | ||
[' | ['Extra Bank Slot'] = 'Bank Slot', | ||
[' | ['Reduce Wave Skip Cost'] = '', | ||
[' | ['Food Bonus'] = '', | ||
[' | ['Ammo Gatherer'] = '', | ||
[' | ['Rune Pouch'] = '', | ||
[' | ['Increase Starting Prayer Points'] = '', | ||
[' | ['Unlock Combat Passive Slot'] = '', | ||
[' | ['Prayer'] = '', | ||
[' | ['Increase Prayer Level'] = '', | ||
['Increase Prayer Points gained per Wave Completion'] = '', | |||
['Faster Golbin Spawns'] = '', | |||
['Golbin Crate'] = '' | |||
} | } | ||
} | } | ||
--If no other text override was specified for the given link, use these | -- If no other text override was specified for the given link, use these | ||
local txtOverrides = { | local txtOverrides = { | ||
['Spider2'] = 'Brown Spider' | ['Spider2'] = 'Brown Spider', | ||
['Earth Golem (AoD)'] = 'Earth Golem' | |||
} | } | ||
--Ambiguous overrides section | -- Ambiguous overrides section | ||
local ambiguousOverrides = { | local ambiguousOverrides = { | ||
['Golbin'] = true, | ['Golbin'] = true, | ||
Line 525: | Line 583: | ||
['Spectre'] = true, | ['Spectre'] = true, | ||
['Siren'] = true, | ['Siren'] = true, | ||
['Lightning Spirit'] = true | ['Lightning Spirit'] = true, | ||
['Ritual Site'] = true, | |||
['Lost Temple'] = true, | |||
['Shipwreck Cove'] = true | |||
} | |||
-- For ambiguous overrides, determines the type text to be used in the page link | |||
local ambiguousTypeMap = { | |||
['mark'] = 'item', | |||
['combatArea'] = 'Combat Area', | |||
['poi'] = 'Dig Site' | |||
} | |||
-- Defines icon types for which a section or anchor on a static page should be linked to, rather | |||
-- than the usual page linking | |||
local sectionLinks = { | |||
['agility'] = { | |||
['link'] = 'Agility', | |||
['img'] = {'Agility', 'skill'}, | |||
['exclude'] = {} | |||
}, | |||
['poi'] = { | |||
['link'] = 'Cartography', | |||
['exclude'] = { | |||
['Ancient Market'] = true, | |||
['Ritual Site'] = true, | |||
['Melantis'] = true, | |||
['Cathedral'] = true, | |||
['Monuments'] = true, | |||
['Coral Wreckage'] = true, | |||
['Shipwreck Cove'] = true, | |||
['Watchtower'] = true, | |||
['Sacrificial Site'] = true, | |||
['Old Village'] = true, | |||
['Bazaar'] = true, | |||
['Glacia City Ruins'] = true, | |||
['Castle Ruins'] = true, | |||
['Ancient Forge'] = true, | |||
['Quarry'] = true, | |||
['Secret Mines'] = true, | |||
['Lost Temple'] = true, | |||
['Stoneworkers'] = true | |||
} | |||
} | |||
} | } | ||
--When calling for an icon for Key, add a css class | |||
-- When calling for an icon for Key, add a css class | |||
local imgClassOverrides = { | local imgClassOverrides = { | ||
-- Was previously used for Township stat icons prior to v1.1.2 | -- Was previously used for Township stat icons prior to v1.1.2 | ||
Line 558: | Line 660: | ||
img = sgsub(img, '/Training', '') | img = sgsub(img, '/Training', '') | ||
img = sgsub(img, '/Guide', '') | img = sgsub(img, '/Guide', '') | ||
-- Remove '#' from links to facilitate linking to things with hashes in | |||
-- | -- their names (e.g. item 'Birthday Cake Piece #1'). Links to sections | ||
-- of a page should instead be performed using the 'section' parameter. | |||
link = sgsub(link, '#', '') | |||
-- Handle types for which links should be to a section of a static page | |||
local sl = sectionLinks[iconType] | |||
if sl ~= nil and not sl.exclude[link] then | |||
if text == nil or text == '' then | if text == nil or text == '' then | ||
text = link | text = link | ||
end | end | ||
linkSection = string.gsub(link, ' ', '') | linkSection = string.gsub(link, ' ', '') | ||
link = | -- Link overwriting must occur after text & linkSection have been set | ||
link = sl.link | |||
if sl.img ~= nil then | |||
img = sl.img[1] | |||
if sl.img[2] ~= nil then | |||
iconType = sl.img[2] | |||
end | |||
end | |||
end | end | ||
--MANUAL OVERRIDES | --MANUAL OVERRIDES | ||
local origType = iconType | |||
local ovrImg = imgOverrides[link] | local ovrImg = imgOverrides[link] | ||
local ovrTypeImg = typeImgOverrides[iconType] | local ovrTypeImg = typeImgOverrides[iconType] | ||
Line 631: | Line 744: | ||
-- 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 the link requires disambiguation or a section, the modify the link accordingly | -- If the link requires disambiguation or a section, the modify the link accordingly | ||
-- while preserving the displayed text | -- while preserving the displayed text | ||
local isAmbig, hasSection = ambiguousOverrides[link], linkSection ~= nil and linkSection ~= '' | local isAmbig, hasSection = ambiguousOverrides[link], linkSection ~= nil and linkSection ~= '' | ||
Line 639: | Line 752: | ||
hasText = true | hasText = true | ||
end | end | ||
link = link .. | if isAmbig then | ||
link = link .. ' (' .. (ambiguousTypeMap[origType] or origType) .. ')' | |||
end | |||
if hasSection then | |||
link = link .. '#' .. linkSection | |||
end | |||
end | end | ||
Line 731: | Line 849: | ||
end | end | ||
function p._Currency(fileName, link, altText, | function p._Currency(fileName, link, altText, amount, maxAmount) | ||
local | local ret = {} | ||
table.insert(ret, '<span style="display:inline-block">') | |||
-- Currency icon | |||
if | if fileName ~= nil then | ||
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 | |||
if tonumber(amount) ~= nil then | |||
if | local function numColour(amount) | ||
if tonumber(amount) < 0 then | |||
if | 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 | ||
table.insert(ret, '</span>') | |||
return table.concat(ret) | |||
end | end | ||
Line 771: | 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 | ||
edits