nameplates: add option to estimate other debuffs

This commit is contained in:
shagu
2020-05-15 16:10:35 +02:00
parent 19a7c57f51
commit 86fbc00940
3 changed files with 22 additions and 17 deletions
+1
View File
@@ -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")
+1
View File
@@ -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")
+20 -17
View File
@@ -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