From 7a2f9b9a32ae19cbb511be51a922528e0f3179b4 Mon Sep 17 00:00:00 2001 From: Kevin Lyles Date: Wed, 30 Sep 2009 14:33:08 -0500 Subject: [PATCH] Re-added display of parsed info, with a hotkey to show it --- Upgrade.lua | 11 +++++++ WeightsWatcher.lua | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++- config.xml | 20 +++++++++++-- defaults.lua | 3 +- 4 files changed, 111 insertions(+), 4 deletions(-) diff --git a/Upgrade.lua b/Upgrade.lua index aeb4967..45a48d2 100644 --- a/Upgrade.lua +++ b/Upgrade.lua @@ -135,6 +135,15 @@ function noop_major_up(vars) return vars end +function upgradeAccountToDebugKey(vars) + if vars.options.tooltip.showDebugInfo == nil then + vars.options.tooltip.showDebugInfo = "Never" + end + + vars.dataMinorVersion = 13 + return vars +end + function upgradeAccountToTriggers(vars) if vars.savedTriggers then for _, class in ipairs(vars.savedTriggers) do @@ -859,6 +868,7 @@ upgradeAccountFunctions = { [9] = upgradeAccountToWorkingMeleeDamage, [10] = upgradeAccountToUseEffectRatio, [11] = upgradeAccountToTriggers, + [12] = upgradeAccountToDebugKey, }, } @@ -888,6 +898,7 @@ downgradeAccountFunctions = { [10] = noop_down, [11] = noop_down, [12] = downgradeAccountFromTriggers, + [13] = noop_down, }, } diff --git a/WeightsWatcher.lua b/WeightsWatcher.lua index 4506cf6..84a8279 100644 --- a/WeightsWatcher.lua +++ b/WeightsWatcher.lua @@ -602,6 +602,7 @@ function WeightsWatcher.displayItemStats(tooltip, ttname) bareLink = splitItemLink(link) local bareItemInfo = ww_bareItemCache[bareLink] + showDebugInfo = keyDetectors[ww_vars.options.tooltip.showDebugInfo]() showWeights = keyDetectors[ww_vars.options.tooltip.showWeights]() showIdealWeights = keyDetectors[ww_vars.options.tooltip.showIdealWeights]() showIdealGems = keyDetectors[ww_vars.options.tooltip.showIdealGems]() @@ -634,6 +635,64 @@ function WeightsWatcher.displayItemStats(tooltip, ttname) end end + if showDebugInfo then + for name, value in pairs(bareItemInfo.nonStats) do + if value == true then + tooltip:AddLine(name) + else + tooltip:AddDoubleLine(name, value) + end + end + for name, value in pairs(bareItemInfo.normalStats) do + tooltip:AddDoubleLine(name, value) + end + if #(bareItemInfo.useEffects) > 0 then + tooltip:AddLine("Use effects:") + for _, useEffect in pairs(bareItemInfo.useEffects) do + tooltip:AddDoubleLine(" " .. useEffect.value .. " " .. useEffect.stat, useEffect.duration .. "/" .. useEffect.cooldown) + end + end + if #(bareItemInfo.stackingEquipEffects) > 0 then + tooltip:AddLine("Stacking equip effects:") + for _, effect in pairs(bareItemInfo.stackingEquipEffects) do + tooltip:AddDoubleLine(" " .. effect.value .. " " .. effect.stat, effect.numStacks) + for trigger in pairs(effect.triggers) do + tooltip:AddLine(" on " .. trigger) + end + end + end + + local itemInfo = ww_itemCache[link] + + if #(bareItemInfo.sockets) > 0 then + tooltip:AddLine("Sockets:") + for _, stat in pairs(bareItemInfo.sockets) do + tooltip:AddLine(" " .. stat) + end + if bareItemInfo.socketBonusStat then + if itemInfo.socketBonusActive then + tooltip:AddDoubleLine("Socket Bonus:", "Active") + else + tooltip:AddDoubleLine("Socket Bonus:", "Inactive") + end + for name, value in pairs(bareItemInfo.socketBonusStat) do + tooltip:AddDoubleLine(" " .. name, value) + end + end + if #(itemInfo.gemStats) > 0 then + tooltip:AddLine("Gem Stats:") + for _, gems in pairs(itemInfo.gemStats) do + for _, gem in ipairs(gems) do + tooltip:AddLine(" " .. gem[2] .. " (" .. gem[1] .. ")") + for stat, value in pairs(gem[3]) do + tooltip:AddDoubleLine(" " .. stat, value) + end + end + end + end + end + end + if showWeights then for _, class in ipairs(ww_charVars.activeWeights) do if ww_vars.weightsList[class] then @@ -717,7 +776,22 @@ function WeightsWatcher.displayItemStats(tooltip, ttname) ttleft = getglobal(ttname .. "TextLeft" .. i) origTextL = ttleft:GetText() textL = WeightsWatcher.preprocess(origTextL:lower()) - if rawget(ww_unparsed_lines, textL) or rawget(ww_unweighted_lines, textL) then + 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 @@ -753,6 +827,11 @@ function WeightsWatcher.displayItemStats(tooltip, ttname) elseif ww_vars.options.tooltip.showWeights ~= "Never" then tooltip:AddLine("") end + if not showDebugInfo then + if ww_vars.options.tooltip.showDebugInfo ~= "Never" then + tooltip:AddLine("") + end + end end tooltip:Show() diff --git a/config.xml b/config.xml index 3e09300..af44756 100644 --- a/config.xml +++ b/config.xml @@ -118,7 +118,7 @@ - + @@ -572,9 +572,25 @@ - + + + + + + self.label:SetText("Show parser debug information:") + self.dropdown:SetText("showDebugInfo") + + + + + + diff --git a/defaults.lua b/defaults.lua index c1e0822..5b8291a 100644 --- a/defaults.lua +++ b/defaults.lua @@ -232,7 +232,7 @@ classNameOptions = { defaultVars = { dataMajorVersion = 1, - dataMinorVersion = 12, + dataMinorVersion = 13, weightsList = { [1] = "DEATHKNIGHT", [2] = "DRUID", @@ -747,6 +747,7 @@ defaultVars = { normalizeWeights = true, showAlternateGems = "Alt", showClassNames = "Others", + showDebugInfo = "Never", showDifferences = true, showIdealGems = "Control", showIdealGemStats = "Always", -- 1.7.9.5