Module:TooltipText

local getArgs = require('Module:Arguments').getArgs local loader = require('Module:Loader')

local string, table, yesno, uitext, cache = loader.require('String', 'Table', 'Yesno', 'UIText', 'Cache') local slotAliases = loader.loadData('Inventory slot/Aliases')

local invslotCache = cache.invslotCache -- local slotAliasesCache = cache.slotAliasesCache local itemVariantsCache = cache.itemVariantsCache

local p = {}

local function tooltip(title, text, display) return ' ' .. ' ' .. mw.getCurrentFrame:preprocess('') .. ' ' end

function p.makeItem(f) local args = getArgs(f) id = args[1] -- local alt = slotAliasesCache:get(id, 1) local alt = slotAliases[id] local item = alt and invslotCache:get(alt, 1) or invslotCache:get(id, 1) if not item then return mw.getCurrentFrame:preprocess('') end return tooltip(item.title, item.text, args['display'] or id) end

return p