Anonymous

Module:Icons: Difference between revisions

From Melvor Idle
Use mw.html for mastery icon
(Remove unused funtion)
(Use mw.html for mastery icon)
Line 1,141: Line 1,141:
local altTextMastery = (showText and '') or ' Mastery'
local altTextMastery = (showText and '') or ' Mastery'


local result = 'Level '..level..' '
    local result = mw.html.create('span')
result = result..p.Icon({linkname, img=iconname, type='item', notext=true, nospan=true, alt=altTextItem})..p.Icon({'Mastery', notext=true, nospan=true, alt=altTextMastery})
    result
if showText then result = result..'[['..linkname..']] [[Mastery]]' end
        :addClass('img-text')
result = '<span class="img-text">'..result..'</span>'
        :wikitext('Level ' .. level .. ' ')
return result
        :node(p.Icon({linkname, img=iconname, type='item', notext=true, nospan=true, alt=altTextItem}))
        :node(p.Icon({'Mastery', notext=true, nospan=true, alt=altTextMastery}))
 
    if showText then
        result
            :wikitext('[[' .. linkname .. ']] ')
            :wikitext('[[Mastery]]')
    end
 
    return tostring(result)
end
end


2,874

edits