Ok now I actually read the code. I'm sure this error has something to do with right-click menu actions and keybind actions (they're implemented by the same class). This IGV_OnMouseEnter_postHook looks like it wraps the original handler, so that the original - which generates the list of actions - is now being called from add-on code (and those actions are mostly anonymous functions with add-on code in their closure now), making it ineligible to call protected functions directly.
Since this hook only needs to adjust tooltip placement, it should probably be done via customTooltipAnchor:
Lua Code:
-- from ZO_InventorySlot_OnMouseEnter
if buttonPart.customTooltipAnchor then
buttonPart.customTooltipAnchor(tooltipUsed, buttonPart, ComparativeTooltip1, ComparativeTooltip2)
else
ZO_Tooltips_SetupDynamicTooltipAnchors(tooltipUsed, buttonPart.tooltipAnchor or buttonPart, ComparativeTooltip1, ComparativeTooltip2)
end
Here's a possible replacement, untested (I still haven't bothered to get IGV
):
Lua Code:
local function igvTooltipAnchor(tooltip, inventorySlot, comparativeTooltip1, comparativeTooltip2)
-- call the regular one, not ideal but probably better than copying most of the code here :)
ZO_Tooltips_SetupDynamicTooltipAnchors(tooltip, inventorySlot, comparativeTooltip1, comparativeTooltip2)
-- custom setup
if inventorySlot.isGrid then
local gridSize = InventoryGridViewSettings:GetGridSize()
local col = ((inventorySlot:GetLeft() - 1432) / gridSize) + 1
local offsetX = -(gridSize * col - gridSize)
tooltip:SetOwner(inventorySlot, RIGHT, offsetX, 0)
end
end
-- I guess there's some place all inventory slots get that isGrid flag,
-- so add the custom placement handler there:
inventorySlot.customTooltipAnchor = igvTooltipAnchor