From e8dcc61db13c9440735b1466e888a73e24709c3c Mon Sep 17 00:00:00 2001 From: Scott Sibley Date: Tue, 21 Jun 2011 01:27:12 +0000 Subject: [PATCH] Bug fix to prevent left and right segments from updating if leftUpdating and/or rightUpdating are/is true. --- Modules/UnitTooltip/UnitTooltip.lua | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/Modules/UnitTooltip/UnitTooltip.lua b/Modules/UnitTooltip/UnitTooltip.lua index 810ac91..77800de 100644 --- a/Modules/UnitTooltip/UnitTooltip.lua +++ b/Modules/UnitTooltip/UnitTooltip.lua @@ -698,16 +698,19 @@ return Colorize(format("%s: %d%% (%.2f%%)", L["Threat"], threatpct, rawthreatpct }, [35] = { name = L["Feats"], - left = [[return L["Feats:"]; ]], + left = [[ +if not UnitIsPlayer(unit) then return end +return L["Feats:"]; +]], right = [[ -if not UnitIsPlayer(unit) then self:Stop(); return lastFeats end +if not UnitIsPlayer(unit) then return lastFeats end local feats = UnitFeats(unit) local txt if feats and feats > 0 then self:Stop() txt = feats else - txt = "Loading Achievements..." + txt = L["Loading Achievements..."] end lastFeats = txt return txt @@ -718,9 +721,12 @@ return txt }, [36] = { name = L["PVP Rank"], - left = [[return L["PVP Rank:"]; ]], + left = [[ +if not UnitExists(unit) or not UnitIsPlayer(unit) then lastPVPRank = nil; return end +return L["PVP Rank:"]; +]], right = [[ -if not UnitIsPlayer(unit) then self:Stop(); return lastPVPRank end +if not UnitExists(unit) or not UnitIsPlayer(unit) then return lastPVPRank end local pvp = UnitPVPStats(unit); local txt; if pvp then @@ -849,8 +855,7 @@ return text update = 300, leftUpdating = true, cols = 100 - }, - + } } for i, v in ipairs(defaultLines) do @@ -989,9 +994,11 @@ function mod:CreateLines() v.value = v.left v.outlined = v.leftOutlined llines[j].leftObj = v.left and WidgetText:New(mod.core, v.name .. " (left)", copy(v), 0, 0, v.layer or 0, StarTip.db.profile.errorLevel, updateWidget) + if v.left and not v.leftUpdating then llines[j].leftObj.timer:Set(0) end v.value = v.right v.outlined = v.rightOutlined llines[j].rightObj = v.right and WidgetText:New(mod.core, v.name .. " (right)", copy(v), 0, 0, v.layer or 0, StarTip.db.profile.errorLevel, updateWidget) + if v.right and not v.rightUpdating then llines[j].rightObj.timer:Set(0) end end end self:ClearLines() -- 1.7.9.5