So In fixing this I am going back through my code and replacing hooks that don't need post processing with ZO_PreHook. I am wondering though, would it be "safe" to post-hook tooltips? It seems like everyone does, and it would need some fancy workaround to avoid the added lines going to the top of the tooltip instead of the bottom if using prehooks.
Here is what I am doing now:
Code:
local ESOMRLSetBagItemTooltip = ItemTooltip.SetBagItem
ItemTooltip.SetBagItem = function(control, bagId, slotIndex)
local itemLink = GetItemLink(bagId, slotIndex)
local itemId = GetItemIdFromLink(itemLink)
ESOMRLSetBagItemTooltip(control, bagId, slotIndex)
if ESOMRL.RecipeMaterials[itemId] ~= nil then
AddRecipeTooltipLine(control, itemId, itemLink, 1)
elseif ESOMRL.IngredientMaterials[itemId] ~= nil then
AddIngredientTooltipLine(control, itemId)
elseif ESOMRL.ResultMaterials[itemId] ~= nil then
AddRecipeTooltipLine(control, itemId, itemLink, 0)
end
end
Any reason this should cause problems?