diff SecureMenu.lua @ 32:416c307fd00b

Add recipe tooltip for the crafted reagent in the external window
author contrebasse
date Thu, 28 Apr 2011 23:39:30 +0200
parents 22fa64c9b2de
children 218e1dd1b821
line wrap: on
line diff
--- a/SecureMenu.lua	Thu Apr 28 21:43:06 2011 +0200
+++ b/SecureMenu.lua	Thu Apr 28 23:39:30 2011 +0200
@@ -38,10 +38,18 @@
 		GameTooltip:Show()
 		GameTooltip:ClearAllPoints()
 		GameTooltip:SetPoint("TOPRIGHT",self,"TOPLEFT",10,0)
+		if self.spellLink then
+			A.tooltipRecipe:SetOwner(GameTooltip)
+			A.tooltipRecipe:SetHyperlink(self.spellLink)
+			A.tooltipRecipe:Show()
+			A.tooltipRecipe:ClearAllPoints()
+			A.tooltipRecipe:SetPoint("TOPRIGHT",GameTooltip,"BOTTOMRIGHT")
+		end
 	end
 end)
 MenuFrame:SetScript("OnLeave",function()
 	GameTooltip:Hide()
+	A.tooltipRecipe:Hide()
 end)
 A.MenuFrame = MenuFrame
 
@@ -287,6 +295,7 @@
 
 	-- Save vars to show the tooltip later
 	MenuFrame.reagentLink = link
+	MenuFrame.spellLink = A.data[itemID].spellLink
 	
 	-- Loop over the available recipes
 	for _,reagent in ipairs(A.data[itemID]) do