From 15dcd458322f542bb3503d34557cb50635e4eb82 Mon Sep 17 00:00:00 2001 From: ackis Date: Mon, 15 Jun 2009 16:50:50 +0000 Subject: [PATCH] Make scanvendor use the scanrecipe function. --- ARLDatamine.lua | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/ARLDatamine.lua b/ARLDatamine.lua index 384f81d..a7000f8 100644 --- a/ARLDatamine.lua +++ b/ARLDatamine.lua @@ -1894,20 +1894,22 @@ function addon:ScanVendor() local targetname = UnitName("target") -- Get its name local targetID = tonumber(string.sub(UnitGUID("target"),-12,-7),16) -- Get the NPC ID - ARLDatamineTT:SetOwner(WorldFrame, "ANCHOR_NONE") - GameTooltip_SetDefaultAnchor(ARLDatamineTT, UIParent) - -- Parse all the items on the merchant for i = 1, GetMerchantNumItems(), 1 do + + -- Get the name local name, _, _, _, numAvailable = GetMerchantItemInfo(i) - - if name then - ARLDatamineTT:SetMerchantItem(i) - self:ScanToolTip(name, recipe_list, reverse_lookup, true, false) - self:PrintScanResults() + -- Get rid of the first part of the item + local recipename = gsub(name,"%a+\: ","") + -- Find out what spell ID we're using + local spellid = reverse_lookup[recipename] + -- Do the scan if we have the spell ID + if (spellid) then + self:TooltipScanRecipe(spellid) + else + self:Print("Spell ID not found for: " .. name) end end - ARLDatamineTT:Hide() else self:Print(L["DATAMINER_VENDOR_NOTTARGETTED"]) end -- 1.7.9.5