17,101
edits
Falterfire (talk | contribs) (Added disambiguation override for Chick) |
(Implement RC function & standardise currency functions) |
||
Line 192: | Line 192: | ||
local showText = args.showText ~= nil and args.showText ~= '' and args.showText ~= 'false' | local showText = args.showText ~= nil and args.showText ~= '' and args.showText ~= 'false' | ||
return p._MasteryReq(itemName, level, showText) | return p._MasteryReq(itemName, level, showText) | ||
end | |||
function p._Currency(fileName, link, amt, maxAmt) | |||
local amtText = Shared.formatnum(amt) | |||
if maxAmt ~= nil and maxAmt ~= amt then | |||
amtText = amtText .. ' - ' .. Shared.formatnum(maxAmt) | |||
end | |||
local fileText = '' | |||
if fileName ~= nil then | |||
fileText = '[[File:' .. fileName .. '|25px' | |||
if link ~= nil then | |||
fileText = fileText .. '|link=' .. link | |||
end | |||
fileText = fileText .. ']] ' | |||
end | |||
return '<span style="display:inline-block">' .. fileText .. amtText .. '</span>' | |||
end | end | ||
function p.GP(amt, maxamt) | function p.GP(amt, maxamt) | ||
return p._Currency('Coins.svg', 'Coins', amt, maxamt) | |||
end | end | ||
function p.SC(amt, maxamt) | function p.SC(amt, maxamt) | ||
return p._Currency('Slayer Coins.svg', 'Currency#Slayer Coins', amt, maxamt) | |||
end | |||
function p.RC(amt, maxamt) | |||
return p._Currency('Raid_Coins.svg', 'Currency#Raid Coins', amt, maxamt) | |||
end | end | ||
return p | return p |