mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-22 15:46:56 +00:00
unitframes: display duration for own buffs on tbc
This commit is contained in:
+11
-1
@@ -15,11 +15,19 @@ local glow2 = {
|
||||
}
|
||||
|
||||
local function BuffOnUpdate()
|
||||
if ( this.tick or 1) > GetTime() then return else this.tick = GetTime() + .4 end
|
||||
local timeleft = GetPlayerBuffTimeLeft(GetPlayerBuff(PLAYER_BUFF_START_ID+this.id,"HELPFUL"))
|
||||
CooldownFrame_SetTimer(this.cd, GetTime(), timeleft, 1)
|
||||
end
|
||||
|
||||
local function TargetBuffOnUpdate()
|
||||
local name, rank, icon, count, duration, timeleft = _G.UnitBuff("target", this.id)
|
||||
if duration and timeleft then
|
||||
CooldownFrame_SetTimer(this.cd, GetTime() + timeleft - duration, duration, 1)
|
||||
else
|
||||
CooldownFrame_SetTimer(this.cd, 0, 0, 0)
|
||||
end
|
||||
end
|
||||
|
||||
local function BuffOnEnter()
|
||||
local parent = this:GetParent()
|
||||
if not parent.label then return end
|
||||
@@ -587,6 +595,8 @@ function pfUI.uf:UpdateConfig()
|
||||
|
||||
if f:GetName() == "pfPlayer" then
|
||||
f.buffs[i]:SetScript("OnUpdate", BuffOnUpdate)
|
||||
elseif f:GetName() == "pfTarget" and pfUI.expansion == "tbc" then
|
||||
f.buffs[i]:SetScript("OnUpdate", TargetBuffOnUpdate)
|
||||
end
|
||||
|
||||
f.buffs[i]:SetScript("OnEnter", BuffOnEnter)
|
||||
|
||||
Reference in New Issue
Block a user