Anonymous

Module:Icons: Difference between revisions

From Melvor Idle
m
Fix extension override handling for skill reqs
No edit summary
m (Fix extension override handling for skill reqs)
 
Line 199: Line 199:
local realm = realmID or 'melvorD:Melvor'
local realm = realmID or 'melvorD:Melvor'
local link = fixPagename(skill)
local link = fixPagename(skill)
local ext = typeExtOverrides['skill'][skill] or extOverrides.type['skill']


local img = mw.html.create('span')
local img = mw.html.create('span')
Line 207: Line 206:
size = size or 25
size = size or 25
img :wikitext('[[File:'):wikitext(link):wikitext('_(skill).'):wikitext(ext)
img :wikitext('[[File:'):wikitext(link):wikitext('_(skill).png')
:wikitext('|'):wikitext(size):wikitext('x'):wikitext(size):wikitext('px')
:wikitext('|'):wikitext(size):wikitext('x'):wikitext(size):wikitext('px')
:wikitext('|link='):wikitext(link):wikitext(']]')
:wikitext('|link='):wikitext(link):wikitext(']]')
Line 225: Line 224:
local realm = realmID or 'melvorD:Melvor'
local realm = realmID or 'melvorD:Melvor'
local link = fixPagename(skill)
local link = fixPagename(skill)
local ext = typeExtOverrides['skill'][skill] or extOverrides.type['skill']
local altText = (showText and '') or skill
local altText = (showText and '') or skill
if level == nil then  
if level == nil then  
Line 239: Line 237:
end
end
img :wikitext('[[File:'):wikitext(link):wikitext('_(skill).'):wikitext(ext)
img :wikitext('[[File:'):wikitext(link):wikitext('_(skill).png')
:wikitext('|25x25px|link='):wikitext(link)
:wikitext('|25x25px|link='):wikitext(link)
:wikitext('|alt='):wikitext(altText)
:wikitext('|alt='):wikitext(altText)