Anonymous

Module:Icons: Difference between revisions

From Melvor Idle
Add function to return skill icon based on realm
No edit summary
(Add function to return skill icon based on realm)
Line 1,128: Line 1,128:
end
end


-- Returns a skill icon based on the realm.
function p._SkillRealmIcon(skill, realmID)
local realm = realmID or 'melvorD:Melvor'
local link = fixPagename(skill)
local ext = typeExtOverrides['skill'][skill] or extOverrides.type['skill']
local img = mw.html.create('span')
if realm == 'melvorItA:Abyssal' then
img:addClass('abyss-icon')
end
img :wikitext('[[File:'):wikitext(link):wikitext('_(skill).'):wikitext(ext)
:wikitext('|25x25px|link='):wikitext(link):wikitext(']]')
return tostring(img)
end
function p._SkillReqNew(skill, level, showText, realmID)
local realm = realmID or 'melvorD:Melvor'
--melvorItA:Abyssal
--melvorD:Melvor
local altText = (showText and '') or skill
local result = p.Icon({skill, type='skill', notext=(showText and '' or true), nospan=true, alt=altText})
if level == nil then
level = 'Unknown [[Category:Pages with script errors]]'
end
result = result.." Level "..level
local html = mw.html.create('span')
:addClass('img-text')
result = '<span class="img-text">'..result..'</span>'
return result
end
function p.SkillReqNew(frame)
end


function p._MasteryReq(itemName, level, showText)
function p._MasteryReq(itemName, level, showText)
2,875

edits