Module:Icons: Difference between revisions

Added override handling for the dig sites & combat areas that share names
m (Fix extension override)
(Added override handling for the dig sites & combat areas that share names)
Line 562: Line 562:
['Spectre'] = true,
['Spectre'] = true,
['Siren'] = true,
['Siren'] = true,
['Lightning Spirit'] = true
['Lightning Spirit'] = true,
['Ritual Site'] = true,
['Lost Temple'] = true,
['Shipwreck Cove'] = true
}
}
--When calling for an icon for Key, add a css class
--When calling for an icon for Key, add a css class
Line 608: Line 611:


--MANUAL OVERRIDES
--MANUAL OVERRIDES
local origType = iconType
local ovrImg = imgOverrides[link]
local ovrImg = imgOverrides[link]
local ovrTypeImg = typeImgOverrides[iconType]
local ovrTypeImg = typeImgOverrides[iconType]
Line 668: Line 672:
-- There are a couple specific double overrides to be included that don't fit in the above lists
-- There are a couple specific double overrides to be included that don't fit in the above lists


-- If the link requires disambiguation or a section, the modify the link accordingly without
-- If the link requires disambiguation or a section, the modify the link accordingly
-- while preserving the displayed text
-- while preserving the displayed text
local isAmbig, hasSection = ambiguousOverrides[link], linkSection ~= nil and linkSection ~= ''
local isAmbig, hasSection = ambiguousOverrides[link], linkSection ~= nil and linkSection ~= ''
Line 676: Line 680:
hasText = true
hasText = true
end
end
link = link .. (isAmbig and ' ('..(iconType == 'mark' and 'item' or iconType)..')' or '') .. (hasSection and '#' .. linkSection or '')
local lTypeStr = origType
if origType == 'mark' then
lTypeStr = 'item'
elseif origType == 'combatArea' then
lTypeStr = 'Combat Area'
elseif origType == 'poi' then
lTypeStr = 'Dig Site'
end
link = link .. (isAmbig and ' ('..lTypeStr..')' or '') .. (hasSection and '#' .. linkSection or '')
end
end