Removed debug message and prevented infinite tooltip recipe adding

Wobin [04-13-14 - 13:31]
Removed debug message and prevented infinite tooltip recipe adding
Filename
SousChef.lua
diff --git a/SousChef.lua b/SousChef.lua
index a7c7962..465096e 100644
--- a/SousChef.lua
+++ b/SousChef.lua
@@ -41,18 +41,18 @@ local function MatchInGlobalCookbook(bag, slot)
 end

 local function AddDetails(row)
-	if not row.dataEntry or not row.dataEntry.data then return false end
+	if not row.dataEntry or not row.dataEntry.data or row.AddedRecipes then return false end
 	local bagId = row.dataEntry.data.bagId
 	local slotIndex = row.dataEntry.data.slotIndex
 	if ((GetItemCraftingInfo(bagId, slotIndex)) ~= CRAFTING_TYPE_PROVISIONING) then	return false end

 	local usableIngredient = ReverseCookbook[GetItemID(GetItemLink(bagId, slotIndex))]
-	if usableIngredient then
-		d(row)
+	if usableIngredient then
 		ItemTooltip:AddLine("Used in:")
 		for i,v in ipairs(usableIngredient) do
 			ItemTooltip:AddLine(v)
 		end
+		row.AddedRecipes = true
 	end
 	return false
 end
@@ -68,11 +68,9 @@ local function AddRankToSlot(row)
 	local rankIcon = slotLines[row:GetName()]
 	if(not rankIcon) then
 		rankIcon =  WINDOW_MANAGER:CreateControl(row:GetName() .. "SousChef", row, CT_TEXTURE)
-		slotLines[row:GetName()] = rankIcon
-		if not rowHandler[row] then
-			rowHandler[row] = row:GetHandler("OnMouseEnter")
-			ZO_PreHookHandler(row, "OnMouseDown", AddDetails)
-		end
+		slotLines[row:GetName()] = rankIcon
+		ZO_PreHookHandler(row, "OnMouseDown", AddDetails)
+		ZO_PreHookHandler(row, "OnMouseUp", function(self) self.AddedRecipes = nil end )
 	end

 	-- Allow for ingeniousclown's Inventory Grid View