unitframes: always refresh player buff durations

This commit is contained in:
shagu
2017-09-10 14:20:58 +02:00
parent f446689681
commit a2518da6cd
+7 -5
View File
@@ -436,6 +436,13 @@ function pfUI.uf:CreateUnitFrame(unit, id, config, tick)
f.buffs[i]:SetWidth(f.config.buffsize)
f.buffs[i]:SetHeight(f.config.buffsize)
if f:GetName() == "pfPlayer" then
f.buffs[i]:SetScript("OnUpdate", function()
local timeleft = GetPlayerBuffTimeLeft(GetPlayerBuff(this:GetID()-1,"HELPFUL"))
CooldownFrame_SetTimer(this.cd, GetTime(), timeleft, 1)
end)
end
f.buffs[i]:SetScript("OnEnter", function()
if not this:GetParent().label then return end
@@ -675,11 +682,6 @@ function pfUI.uf:RefreshUnit(unit, component)
if texture then
unit.buffs[i]:Show()
if unit:GetName() == "pfPlayer" then
local timeleft = GetPlayerBuffTimeLeft(GetPlayerBuff(unit.buffs[i]:GetID()-1,"HELPFUL"))
CooldownFrame_SetTimer(unit.buffs[i].cd, GetTime(), timeleft, 1)
end
if stacks > 1 then
unit.buffs[i].stacks:SetText(stacks)
else