mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-07 22:20:00 +00:00
thirdparty: debufftimers detection
This commit is contained in:
+1
-1
@@ -686,7 +686,7 @@ function pfUI.uf:RefreshUnit(unit, component)
|
||||
if unit.label == "player" then
|
||||
local timeleft = GetPlayerBuffTimeLeft(GetPlayerBuff(unit.debuffs[i]:GetID() - 1, "HARMFUL"),"HARMFUL")
|
||||
CooldownFrame_SetTimer(unit.debuffs[i].cd, GetTime(), timeleft, 1)
|
||||
elseif pfUI.debuffs then
|
||||
elseif pfUI.debuffs and pfUI.debuffs.active then
|
||||
local effect = pfUI.debuffs:GetDebuffName(unit.label .. unit.id, unit.debuffs[i]:GetID())
|
||||
local start, duration, timeleft = pfUI.debuffs:GetDebuffInfo(unit.label .. unit.id, effect)
|
||||
CooldownFrame_SetTimer(unit.debuffs[i].cd, start, duration, 1)
|
||||
|
||||
@@ -11,6 +11,8 @@ pfUI:RegisterModule("debuffs", function ()
|
||||
pfUI.debuffs:RegisterEvent("PLAYER_TARGET_CHANGED")
|
||||
pfUI.debuffs:RegisterEvent("UNIT_AURA")
|
||||
|
||||
pfUI.debuffs.active = true
|
||||
|
||||
-- CHAT_MSG_SPELL_PERIODIC_HOSTILEPLAYER_DAMAGE // CHAT_MSG_SPELL_PERIODIC_CREATURE_DAMAGE
|
||||
pfUI.debuffs.AURAADDEDOTHERHARMFUL = gsub(gsub(gsub(gsub(gsub(AURAADDEDOTHERHARMFUL, "%(", "%%("), "%)", "%%)"), "%d%$",""), "%%s", "(.+)"), "%%d", "(%%d+)")
|
||||
|
||||
|
||||
@@ -462,7 +462,7 @@ pfUI:RegisterModule("nameplates", function ()
|
||||
this.debuffs[j].icon:SetTexture(icon)
|
||||
this.debuffs[j].icon:SetTexCoord(.078, .92, .079, .937)
|
||||
|
||||
if pfUI.debuffs and name then
|
||||
if pfUI.debuffs and pfUI.debuffs.active and name then
|
||||
this.debuffs[j].cd = this.debuffs[j].cd or CreateFrame("Model", nil, this.debuffs[j], "CooldownFrameTemplate")
|
||||
local start, duration, timeleft = pfUI.debuffs:GetDebuffInfo("target", name)
|
||||
CooldownFrame_SetTimer(this
|
||||
|
||||
@@ -744,4 +744,23 @@ pfUI:RegisterModule("thirdparty", function ()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
do -- DebuffTimers Integration
|
||||
if AUF_Tooltip then
|
||||
if pfUI.debuffs then
|
||||
pfUI.debuffs.active = nil
|
||||
end
|
||||
else
|
||||
local pfHookDebuffTimers = CreateFrame("Frame", nil)
|
||||
pfHookDebuffTimers:RegisterEvent("VARIABLES_LOADED")
|
||||
pfHookDebuffTimers:SetScript("OnEvent",function()
|
||||
if AUF_Tooltip then
|
||||
pfHookDebuffTimers:UnregisterEvent("VARIABLES_LOADED")
|
||||
if pfUI.debuffs then
|
||||
pfUI.debuffs.active = nil
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user