From 6fb47c7b708687502ddbf254abea2db49b702234 Mon Sep 17 00:00:00 2001 From: shagu Date: Tue, 9 Oct 2018 20:38:31 +0200 Subject: [PATCH] unitframes: manually update player debuffs --- api/unitframes.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/api/unitframes.lua b/api/unitframes.lua index e81040c1..679d814b 100644 --- a/api/unitframes.lua +++ b/api/unitframes.lua @@ -403,6 +403,7 @@ function pfUI.uf:UpdateConfig() if f:GetName() == "pfPlayer" then f.buffs[i]:SetScript("OnUpdate", function() + if ( this.tick or 1) > GetTime() then return else this.tick = GetTime() + .4 end local timeleft = GetPlayerBuffTimeLeft(GetPlayerBuff(this:GetID()-1,"HELPFUL")) CooldownFrame_SetTimer(this.cd, GetTime(), timeleft, 1) end) @@ -502,6 +503,15 @@ function pfUI.uf:UpdateConfig() f.debuffs[i]:SetWidth(f.config.debuffsize) f.debuffs[i]:SetHeight(f.config.debuffsize) f.debuffs[i]:SetNormalTexture(nil) + + if f:GetName() == "pfPlayer" then + f.debuffs[i]:SetScript("OnUpdate", function() + if ( this.tick or 1) > GetTime() then return else this.tick = GetTime() + .4 end + local timeleft = GetPlayerBuffTimeLeft(GetPlayerBuff(this:GetID()-1,"HARMFUL")) + CooldownFrame_SetTimer(this.cd, GetTime(), timeleft, 1) + end) + end + f.debuffs[i]:SetScript("OnEnter", function() if not this:GetParent().label then return end GameTooltip:SetOwner(this, "ANCHOR_BOTTOMRIGHT")