Module:Calculator/AgilityObstacle: Difference between revisions

m
Fix derp again
(Update for v1.3)
m (Fix derp again)
(3 intermediate revisions by the same user not shown)
Line 8: Line 8:
local Shared = require('Module:Shared')
local Shared = require('Module:Shared')
local Icons = require('Module:Icons')
local Icons = require('Module:Icons')
local iconTable = {
    ['GP']  = function(amount) return Icons._Currency('GP', amount) end,
    ['SC']  = function(amount) return Icons._Currency('SC', amount) end,
    ['AP']  = function(amount) return Icons._Currency('AP', amount) end,
    ['ASC'] = function(amount) return Icons._Currency('ASC', amount) end,
}


local function getItemIcon(itemName, amount)
local function getItemIcon(itemName, amount)
if itemName == 'GP' then
local iconFunc = iconTable[itemName]
return Icons.GP(amount)
    if iconFunc then
end
        return iconFunc(amount)
    else
if itemName == 'SC' then
        return Icons.Icon({itemName, type='item', qty = amount, notext=true})
return Icons.SC(amount)
    end
end
return Icons.Icon({itemName, type='item', qty = amount, notext=true})
end
end


2,869

edits