From 80a4b3e08aeca6eda3ca1f3fee6cf35738e9eb99 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 28 Nov 2009 21:15:39 +0100 Subject: [PATCH] Check all lines, in case of interferring add-ons --- Molinari.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Molinari.lua b/Molinari.lua index 3de5456..607579b 100644 --- a/Molinari.lua +++ b/Molinari.lua @@ -38,10 +38,18 @@ local function Disenchantable(item) return (type == ARMOR or type == ENCHSLOT_WEAPON) and quality > 1 and quality < 5 and GetSpellInfo(13262) end +local function ScanTooltip() + local spell = nil + for index = 1, GameTooltip:NumLines() do + spell = spells[_G['GameTooltipTextLeft'..index]:GetText()] + end + return spell +end + GameTooltip:HookScript('OnTooltipSetItem', function(self) local item = self:GetItem() if(item and IsAltKeyDown() and not InCombatLockdown()) then - local spell = spells[GameTooltipTextLeft2:GetText()] or Disenchantable(item) + local spell = ScanTooltip() or Disenchantable(item) if(spell) then local slot = GetMouseFocus() button:SetAttribute('macrotext', macro:format(spell, slot:GetParent():GetID(), slot:GetID())) -- 1.7.9.5