Module:Calculator/AgilityObstacle: Difference between revisions

m
Fix derp again
(Adjust to new Icons.Currency function)
m (Fix derp again)
 
(One intermediate revision by the same user not shown)
Line 10: Line 10:


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


2,647

edits