Several changes

Fix stale debuff icons/tooltips on target frame after target swap
Fix debuffs not showing on nameplates for timer-less spells (e.g. Hurricane)
Fix buffwatch timer visually speeding up when another debuff fades
Remove 50ms aura cache (slotMapCache/auraFC) - caused stale debuff data
Remove "Show Only Own Debuffs" from unitframes and nameplates GUI
Force selfdebuff=0 for unitframes/nameplates on login to reset old SavedVariables
This commit is contained in:
Meow
2026-03-31 19:51:36 +02:00
parent 70b44774ee
commit aa2cb95ec2
4 changed files with 47 additions and 70 deletions
+3 -9
View File
@@ -277,14 +277,8 @@ pfUI:RegisterModule("buffwatch", "vanilla:tbc", function ()
and data[3] and data[3] ~= "" -- buff has a name
and data[4] and data[4] ~= "" -- buff has a texture
then
-- For player: no slot in uuid (slots shift when other buffs expire)
-- For target: include slot (multiple players can have same debuff, slot identifies who)
local uuid
if frame.unit == "player" or (frame.config and frame.config.selfdebuff == "1") then
uuid = data[4] .. data[3] -- texture + name only (stable in selfdebuff mode)
else
uuid = data[4] .. data[3] .. data[2] -- texture + name + slot
end
-- No slot in uuid: slots shift when debuffs expire causing timer resets
local uuid = data[4] .. data[3] -- texture + name only
-- update bar data
frame.bars[bar] = frame.bars[bar] or CreateStatusBar(bar, frame)
@@ -518,4 +512,4 @@ pfUI:RegisterModule("buffwatch", "vanilla:tbc", function ()
pfUI.uf.target.debuffbar:SetPoint("BOTTOM", pfUI.uf.target, "TOP", 0, border*2+1)
UpdateMovable(pfUI.uf.target.debuffbar)
end
end)
end)
+36 -27
View File
@@ -327,28 +327,39 @@ pfUI:RegisterModule("nameplates", "vanilla", function ()
local function PlateCacheDebuffs(self, unitstr, verify)
if not self.debuffcache then self.debuffcache = {} end
if not libdebuff then return end -- Safety check
if not libdebuff then return end
local now = GetTime()
-- Clear existing cache slots
for id = 1, 16 do
local effect, _, texture, stacks, _, duration, timeleft
if unitstr and C.nameplates.selfdebuff == "1" then
effect, _, texture, stacks, _, duration, timeleft = libdebuff:UnitOwnDebuff(unitstr, id)
else
effect, _, texture, stacks, _, duration, timeleft = libdebuff:UnitDebuff(unitstr, id)
if self.debuffcache[id] then
self.debuffcache[id].empty = true
end
end
if effect and timeleft and timeleft > 0 then
local start = GetTime() - ( (duration or 0) - ( timeleft or 0) )
local stop = GetTime() + ( timeleft or 0 )
self.debuffcache[id] = self.debuffcache[id] or {}
self.debuffcache[id].effect = effect
self.debuffcache[id].texture = texture
self.debuffcache[id].stacks = stacks
self.debuffcache[id].duration = duration or 0
self.debuffcache[id].start = start
self.debuffcache[id].stop = stop
self.debuffcache[id].empty = nil
-- Get GUID - unitstr may already be a GUID from plate.parent:GetName(1)
local guid = unitstr
if unitstr and not string.find(unitstr, "^0x") and GetUnitGUID then
guid = GetUnitGUID(unitstr) or unitstr
end
if guid then
for id = 1, 16 do
local effect, _, texture, stacks, dtype, duration, timeleft
effect, _, texture, stacks, dtype, duration, timeleft = libdebuff:UnitDebuff(guid, id)
if effect and texture then
local stop = (timeleft and timeleft > 0) and (now + timeleft) or nil
local start = stop and (stop - (duration or 0)) or now
self.debuffcache[id] = self.debuffcache[id] or {}
self.debuffcache[id].effect = effect
self.debuffcache[id].texture = texture
self.debuffcache[id].stacks = stacks
self.debuffcache[id].duration = duration or 0
self.debuffcache[id].start = start
self.debuffcache[id].stop = stop
self.debuffcache[id].empty = nil
end
end
end
@@ -359,15 +370,15 @@ pfUI:RegisterModule("nameplates", "vanilla", function ()
-- break on unknown data
if not self.debuffcache then return end
if not self.debuffcache[id] then return end
if not self.debuffcache[id].stop then return end
-- break on timeout debuffs
if self.debuffcache[id].empty then return end
if self.debuffcache[id].stop < GetTime() then return end
if self.debuffcache[id].stop and self.debuffcache[id].stop < GetTime() then return end
-- return cached debuff
local c = self.debuffcache[id]
return c.effect, c.rank, c.texture, c.stacks, c.dtype, c.duration, (c.stop - GetTime())
local timeleft = c.stop and (c.stop - GetTime()) or -1
return c.effect, c.rank, c.texture, c.stacks, c.dtype, c.duration, timeleft
end
local function CreateDebuffIcon(plate, index)
@@ -994,8 +1005,8 @@ nameplates:RegisterEvent("ZONE_CHANGED_NEW_AREA")
-- yet updated. So while being inside this event, we cannot trust the unitstr.
if event == "PLAYER_TARGET_CHANGED" then unitstr = nil end
-- remove unitstr on unit name mismatch
if unitstr and UnitName(unitstr) ~= name then unitstr = nil end
-- remove unitstr on unit name mismatch (skip for GUIDs - they're always valid)
if unitstr and not string.find(unitstr, "^0x") and UnitName(unitstr) ~= name then unitstr = nil end
-- use mobhealth values if addon is running
if (MobHealth3 or MobHealthFrame) and target and name == UnitName('target') and MobHealth_GetTargetCurHP() then
@@ -1193,13 +1204,11 @@ nameplates:RegisterEvent("ZONE_CHANGED_NEW_AREA")
plate:CacheDebuffs(unitstr, verify)
end
-- update all debuff icons
-- update all debuff icons - use direct UnitDebuff when unitstr available
for i = 1, 16 do
local effect, rank, texture, stacks, dtype, duration, timeleft
if unitstr and C.nameplates.selfdebuff == "1" and libdebuff then
effect, rank, texture, stacks, dtype, duration, timeleft = libdebuff:UnitOwnDebuff(unitstr, i)
elseif unitstr and libdebuff then
if unitstr and libdebuff then
effect, rank, texture, stacks, dtype, duration, timeleft = libdebuff:UnitDebuff(unitstr, i)
elseif plate.verify == verify then
effect, rank, texture, stacks, dtype, duration, timeleft = plate:UnitDebuff(i)