diff --git a/api/config.lua b/api/config.lua index a2e97dfc..f62e13cf 100644 --- a/api/config.lua +++ b/api/config.lua @@ -609,6 +609,7 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("nameplates", nil, "showcastbar", "1") pfUI:UpdateConfig("nameplates", nil, "spellname", "0") pfUI:UpdateConfig("nameplates", nil, "showdebuffs", "0") + pfUI:UpdateConfig("nameplates", nil, "guessdebuffs", "1") pfUI:UpdateConfig("nameplates", nil, "clickthrough", "0") pfUI:UpdateConfig("nameplates", nil, "rightclick", "1") pfUI:UpdateConfig("nameplates", nil, "clickthreshold", "0.5") diff --git a/modules/gui.lua b/modules/gui.lua index b1a98c7d..4d4fd29d 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -2030,6 +2030,7 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function () CreateConfig(U["nameplates"], T["Enable Castbars"], C.nameplates, "showcastbar", "checkbox") CreateConfig(U["nameplates"], T["Enable Spellname"], C.nameplates, "spellname", "checkbox") CreateConfig(U["nameplates"], T["Enable Debuffs"], C.nameplates, "showdebuffs", "checkbox") + CreateConfig(U["nameplates"], T["Estimate Debuffs"], C.nameplates, "guessdebuffs", "checkbox") CreateConfig(U["nameplates"], T["Enable Class Colors On Enemies"], C.nameplates, "enemyclassc", "checkbox") CreateConfig(U["nameplates"], T["Enable Class Colors On Friends"], C.nameplates, "friendclassc", "checkbox") CreateConfig(U["nameplates"], T["Raid Icon Size"], C.nameplates, "raidiconsize") diff --git a/modules/nameplates.lua b/modules/nameplates.lua index 3ad560a9..b4c91900 100644 --- a/modules/nameplates.lua +++ b/modules/nameplates.lua @@ -464,25 +464,28 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function () -- update debuffs if C.nameplates["showdebuffs"] == "1" then - -- update debuff caches - local verify = string.format("%s:%s", (name or ""), (level or "")) - if unitstr then - -- cache all debuffs - plate:CacheDebuffs(unitstr) - plate.debuffcache.valid = verify - elseif plate.debuffcache and plate.debuffcache.valid == verify then - -- delete timed out caches - for id, data in pairs(plate.debuffcache) do - if data.stop and data.stop < GetTime() then - table.remove(plate.debuffcache, id) + -- update cached debuffs + if C.nameplates["guessdebuffs"] == "1" then + local verify = string.format("%s:%s", (name or ""), (level or "")) + + if unitstr then + -- cache all debuffs + plate:CacheDebuffs(unitstr) + plate.debuffcache.valid = verify + elseif plate.debuffcache and plate.debuffcache.valid == verify then + -- delete timed out caches + for id, data in pairs(plate.debuffcache) do + if data.stop and data.stop < GetTime() then + table.remove(plate.debuffcache, id) + end + end + elseif plate.debuffcache then + -- nameplate changed, invalidating cache + for id = 1, 16 do + plate.debuffcache[id] = plate.debuffcache[id] or {} + plate.debuffcache[id].effect = nil end - end - elseif plate.debuffcache then - -- nameplate changed, invalidating cache - for id = 1, 16 do - plate.debuffcache[id] = plate.debuffcache[id] or {} - plate.debuffcache[id].effect = nil end end