Moved parser tooltip markings earlier to avoid trying to mark weights and such
Kevin Lyles [08-10-10 - 21:28]
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
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