Module:Abilities/icon: Difference between revisionsGive feedback
mNo edit summary |
mNo edit summary |
||
| Line 56: | Line 56: | ||
} | } | ||
function getScalarIcon(scaleType) | |||
function getScalarIcon(scaleType | return SCALING_ICON_MAP[scaleType] | ||
end | end | ||
function p. | -- get scaling icon attribute associated with a specified scale type | ||
function p.getScalarIconAttr(frame) | |||
local args = frame.args | local args = frame.args | ||
| Line 77: | Line 68: | ||
local attribute = args[2] | local attribute = args[2] | ||
local icon = getScalarIcon(scaleType, attribute) | |||
return icon[attribute] or 'Missing scaling attribute ' .. attribute .. ' for type ' .. scaleType | |||
end | end | ||
-- get scaling icon wikitext file associated with a specified scale type | |||
function p.getScalarIconFile(frame) | function p.getScalarIconFile(frame) | ||
local args = frame.args | local args = frame.args | ||
| Line 85: | Line 78: | ||
local icon = getScalarIcon(scaleType) | local icon = getScalarIcon(scaleType) | ||
if not icon then | if not icon then | ||
return string.format('[[Tooltip|?|Missing scaling type icon "%s" in Module:Abilities/icon]]', scaleType) | return string.format('[[Tooltip|?|Missing scaling type icon "%s" in Module:Abilities/icon]]', scaleType) | ||
| Line 94: | Line 86: | ||
end | end | ||
return '<span class="ac-scaling-- | return string.format( | ||
'<span class="ac-scaling--%s">[[%s|link=%s|%s]]</span>', | |||
icon.class, | |||
icon.icon, | |||
icon.link, | |||
icon.size | |||
) | |||
end | end | ||
return p | return p | ||