From fcdc2d52f7a81604c95fd52b786c6d84a1838924 Mon Sep 17 00:00:00 2001 From: "James D. Callahan III" Date: Thu, 3 Jun 2010 19:39:56 -0400 Subject: [PATCH] Re-enabled the updater - if the first return from GetTradeSkillLine() is not "UNKNOWN", allow the scan. --- ARL.lua | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/ARL.lua b/ARL.lua index b9cd51d..f00d8a0 100644 --- a/ARL.lua +++ b/ARL.lua @@ -788,33 +788,33 @@ function addon:TRADE_SKILL_CLOSE() end do - -- local last_update = 0 - -- local updater = CreateFrame("Frame", nil, UIParent) + local last_update = 0 + local updater = CreateFrame("Frame", nil, UIParent) - -- updater:Hide() - -- updater:SetScript("OnUpdate", - -- function(self, elapsed) - -- last_update = last_update + elapsed + updater:Hide() + updater:SetScript("OnUpdate", + function(self, elapsed) + last_update = last_update + elapsed - -- addon:Debug("Running the updater's OnUpdate") - -- if last_update >= 0.5 then - -- addon:Scan(false, true) - -- self:Hide() - -- end - -- end) + if last_update >= 0.5 then + local profession = GetTradeSkillLine() - function addon:TRADE_SKILL_UPDATE(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10) - -- if not self.Frame:IsVisible() then - -- return - -- end + if profession ~= "UNKNOWN" then + addon:Scan(false, true) + end + self:Hide() + end + end) - -- addon:Debug("Args are: %s, %s, %s, %s, %s, %s, %s, %s, %s, %s", tostring(arg1), tostring(arg2), tostring(arg3), tostring(arg4), - -- tostring(arg5), tostring(arg6), tostring(arg7), tostring(arg8), tostring(arg9), tostring(arg10)) + function addon:TRADE_SKILL_UPDATE(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10) + if not self.Frame:IsVisible() then + return + end - -- if not updater:IsVisible() then - -- last_update = 0 - -- updater:Show() - -- end + if not updater:IsVisible() then + last_update = 0 + updater:Show() + end end end -- 1.7.9.5