Documentation for this module may be created at Module:Tooltips/data/doc

local modIcon = {'[[File:Mod_TT_20px.png|12px|link=]]'}
local modules = {
Ability     = {n=[[Module:Ability]],    loc={'Ability'},          link='Link',
                icon = function(v, link)
                    return ('[[File:%s|19px|link=%s]]'):format((v or {DarkIcon='panel.png'}).DarkIcon, link)
                end,},
Mods        = {n=[[Module:Mods]],       loc={'Mods'},             link='Link',
                icon = function(v, link) 
                    return modIcon--'[[File:Mod_TT_20px.png|12px|link='..link..']]' 
                end,},
Warframes   = {n=[[Module:Warframes]],  loc={'Warframes'},
                icon = function(v, link) 
                    return ('[[File:%s|19px|link=%s]]'):format(v.Portrait, link)
                end,},
Void        = {n=[[Module:Void]],       loc={'RelicNames'},
                icon = function(v, link) 
                    return ('[[File:VoidRelic%sIcon64.png|x19px|link=%s]]'):format(({Lith='Iron', Meso='Bronze', Neo='Silver', Axi='Gold'})[v.Tier], link)
                 end,},
Weapons     = {n=[[Module:Weapons]],    loc={'Weapons'},    link='Link',
                icon = function(v, link) 
                    return ('[[File:%s|x19px|link=%s]]'):format(v.Image, link)
                end,},
DamageTypes = {n=[[Module:DamageTypes]],loc={'Types'}, loc2={'Health'}, 
                icon = function(v, link, k) 
                    return v.icon and ('[[File:%s|18px|link=%s]]'):format(v.icon or 'spacer.png', link)
                end,
                color = function(v, k) 
                    return (function(s)return s~='' and s or nil end)(v.color)
                end,},
Arcane      = {n=[[Module:Arcane]],     loc={'Arcanes'},
                icon = function(v, link) 
                    return ('[[File:%s|23px|link=%s]]'):format(v.Icon, link)
                end,},
}--could use a loop for ['n'], but this properly autodetects the links

local data = {index={}}
local function find(t,l)
    local tt = t
    for i, v in ipairs(l) do
        t=t[v]
    end
    return t or error('failed to find '..require'Module:Shared'.upk({l,'\nin\n',tt},2):gsub('\n','\n\n'))
end

for name, module in pairs(modules) do 
for i, locale in ipairs{module.loc,module.loc2,module.loc2,} do
for k,v in pairs(find(mw.loadData(module.n..'/data'), locale)) do -- find and iterate through names of objects
    local kk = k:gsub(' ?%(.+%)','')-- qwe (asd)
    data.index[kk]=data.index[kk]or{}
    table.insert(data.index[kk], 
        {
            name,-- Source module
            k~=kk and k or nil,-- Key in data table
            v[module.link],-- Link destination (page location)
            icon= module.icon and module.icon(v, v[module.link] or kk, k),-- Icon in wikitext
            color= module.color and module.color(v, k),
    }) -- add entry to table of 'what is this thing?'  
end
end
end

do
local priority = {
'Warframes',
'Ability',
'Mods',
'Weapons',
'Arcane',
'DamageTypes',
'Void',
}
for i,v in ipairs(priority) do priority[i]=nil priority[v]=i end
for k,v in pairs(data.index) do table.sort(v,function(a,b)return priority[a[1]] < priority[b[1]] or (priority[a[1]]==priority[b[1]] and #a<#b) end) end
end-- ^ sorts by priority then complexity

return data
Community content is available under CC-BY-SA unless otherwise noted.