diff ReagentMaker.lua @ 15:cc56799582f2

Use local references to global functions to speed up scanning
author contrebasse
date Wed, 06 Apr 2011 00:28:13 +0200
parents 5eb02d3e1647
children 5336b3a19d4f
line wrap: on
line diff
--- a/ReagentMaker.lua	Tue Apr 05 21:59:01 2011 +0200
+++ b/ReagentMaker.lua	Wed Apr 06 00:28:13 2011 +0200
@@ -205,27 +205,30 @@
 	end
 
 	-- Tooltips
-	A.tooltipRecipe:SetOwner(btn)
-	if A.data[reagentID].spell then
-		A.tooltipRecipe:SetHyperlink(GetSpellLink(A.data[reagentID].spellID))
-	else
-		A.tooltipRecipe:SetHyperlink(GetTradeSkillRecipeLink(A.findSkillIndex(reagentID)))
+	local reagentIndex = A.findSkillIndex(reagentID)
+	if reagentIndex then
+		A.tooltipRecipe:SetOwner(btn)
+		if A.data[reagentID].spell then
+			A.tooltipRecipe:SetHyperlink(GetSpellLink(A.data[reagentID].spellID))
+		else
+			A.tooltipRecipe:SetHyperlink(GetTradeSkillRecipeLink(reagentIndex))
+		end
+		A.tooltipRecipe:Show()
+		A.tooltipRecipe:ClearAllPoints()
+		--A.tooltipRecipe:SetPoint("TOPLEFT",btn,"TOPRIGHT")
+		A.tooltipRecipe:SetPoint("BOTTOMLEFT",GameTooltip,"BOTTOMRIGHT")
+
+		--[[
+		if #(A.data[reagentID]) == 1 then
+			A.tooltipReagent:SetOwner(A.tooltipRecipe)
+			local name, link, quality, iLevel, reqLevel, class, subclass, maxStack, equipSlot, texture, vendorPrice = GetItemInfo(A.data[reagentID][1][1])
+			A.tooltipReagent:SetHyperlink(link)
+			A.tooltipReagent:Show()
+			A.tooltipReagent:ClearAllPoints()
+			A.tooltipReagent:SetPoint("BOTTOMLEFT",A.tooltipRecipe,"BOTTOMRIGHT")
+		end
+		--]]
 	end
-	A.tooltipRecipe:Show()
-	A.tooltipRecipe:ClearAllPoints()
-	--A.tooltipRecipe:SetPoint("TOPLEFT",btn,"TOPRIGHT")
-	A.tooltipRecipe:SetPoint("BOTTOMLEFT",GameTooltip,"BOTTOMRIGHT")
-
-	--[[
-	if #(A.data[reagentID]) == 1 then
-		A.tooltipReagent:SetOwner(A.tooltipRecipe)
-		local name, link, quality, iLevel, reqLevel, class, subclass, maxStack, equipSlot, texture, vendorPrice = GetItemInfo(A.data[reagentID][1][1])
-		A.tooltipReagent:SetHyperlink(link)
-		A.tooltipReagent:Show()
-		A.tooltipReagent:ClearAllPoints()
-		A.tooltipReagent:SetPoint("BOTTOMLEFT",A.tooltipRecipe,"BOTTOMRIGHT")
-	end
-	--]]
 end
 
 function A.btnLeft(btn)