View Single Post
02/09/17, 09:28 PM   #12
Phinix
 
Phinix's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 186
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?
  Reply With Quote