From de6dfa6c88f188390017e1bf767ef521505664cd Mon Sep 17 00:00:00 2001 From: Kevin Lyles Date: Tue, 10 Aug 2010 16:28:07 -0500 Subject: [PATCH] Moved parser tooltip markings earlier to avoid trying to mark weights and such Also avoids nil errors on no left text, which can apparently be caused by some addons --- WeightsWatcher.lua | 74 ++++++++++++++++++++++++++-------------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/WeightsWatcher.lua b/WeightsWatcher.lua index 424d269..d2d8347 100644 --- a/WeightsWatcher.lua +++ b/WeightsWatcher.lua @@ -569,6 +569,43 @@ function WeightsWatcher.displayItemStats(tooltip, ttname) end end + local start, ttleft, origTextL, textL + local numUnweightedEffects = 0 + -- Skip item name and "currently equipped" + if WeightsWatcherHiddenTooltipTextLeft1:GetText() == CURRENTLY_EQUIPPED then + start = 3 + else + start = 2 + end + + for i = start, tooltip:NumLines() do + ttleft = getglobal(ttname .. "TextLeft" .. i) + origTextL = ttleft:GetText() + textL = WeightsWatcher.preprocess(origTextL:lower()) + if rawget(ww_unparsed_lines, textL) then + if showDebugInfo then + ttleft:SetText(origTextL .. " |cffff00ff(U)|r") + else + ttleft:SetText(origTextL .. " |cffff0000*|r") + end + numUnweightedEffects = numUnweightedEffects + 1 + elseif rawget(ww_ignored_lines, textL) then + if showDebugInfo then + ttleft:SetText(origTextL .. " |cffffff00(I)|r") + end + elseif rawget(ww_temp_ignored_lines, textL) then + if showDebugInfo then + ttleft:SetText(origTextL .. " |cffffff00(TI)|r") + end + elseif rawget(ww_unweighted_lines, textL) then + ttleft:SetText(origTextL .. " |cffff0000*|r") + numUnweightedEffects = numUnweightedEffects + 1 + end + end + if numUnweightedEffects > 0 then + tooltip:AddLine("|cffff0000* indicates unweighted effects|r (" .. numUnweightedEffects .. " total)") + end + if showDebugInfo then for name, value in pairs(bareItemInfo.nonStats) do if value == true then @@ -697,43 +734,6 @@ function WeightsWatcher.displayItemStats(tooltip, ttname) end end - local start, ttleft, origTextL, textL - local numUnweightedEffects = 0 - -- Skip item name and "currently equipped" - if WeightsWatcherHiddenTooltipTextLeft1:GetText() == CURRENTLY_EQUIPPED then - start = 3 - else - start = 2 - end - - for i = start, tooltip:NumLines() do - ttleft = getglobal(ttname .. "TextLeft" .. i) - origTextL = ttleft:GetText() - textL = WeightsWatcher.preprocess(origTextL:lower()) - if rawget(ww_unparsed_lines, textL) then - if showDebugInfo then - ttleft:SetText(origTextL .. " |cffff00ff(U)|r") - else - ttleft:SetText(origTextL .. " |cffff0000*|r") - end - numUnweightedEffects = numUnweightedEffects + 1 - elseif rawget(ww_ignored_lines, textL) then - if showDebugInfo then - ttleft:SetText(origTextL .. " |cffffff00(I)|r") - end - elseif rawget(ww_temp_ignored_lines, textL) then - if showDebugInfo then - ttleft:SetText(origTextL .. " |cffffff00(TI)|r") - end - elseif rawget(ww_unweighted_lines, textL) then - ttleft:SetText(origTextL .. " |cffff0000*|r") - numUnweightedEffects = numUnweightedEffects + 1 - end - end - if numUnweightedEffects > 0 then - tooltip:AddLine("|cffff0000* indicates unweighted effects|r (" .. numUnweightedEffects .. " total)") - end - if not ww_vars.options.tooltip.hideHints then if showWeights then if not ww_vars.options.tooltip.hideHints and #(bareItemInfo.sockets) > 0 then -- 1.7.9.5