Anonymous

Module:Icons: Difference between revisions

From Melvor Idle
Moved getExpansionIcon here and directly keyed it off of ID
(Add overrides for new v1.1 potions)
(Moved getExpansionIcon here and directly keyed it off of ID)
(One intermediate revision by the same user not shown)
Line 3: Line 3:


local Shared = require("Module:Shared")
local Shared = require("Module:Shared")
local GameData = require("Module:GameData")


-- Locally index some functions for performance
-- Locally index some functions for performance
Line 540: Line 541:
function p.RC(amt, maxamt)
function p.RC(amt, maxamt)
return p._Currency('Raid_Coins.svg', 'Currency#Raid Coins', amt, maxamt)
return p._Currency('Raid_Coins.svg', 'Currency#Raid Coins', amt, maxamt)
end
--Adding a shortcut function for this
function p.TotH()
return p.Icon({'Throne of the Herald Expansion', ext='svg', notext=true, img='TotH'})
end
function p.getExpansionIcon(id)
local ns, _ = GameData.getLocalID(id)
if ns == 'melvorTotH' then
return p.TotH()..' '
else
return ''
end
end
end


return p
return p