From 93302baef1a121236344b2195c471e36660a7b92 Mon Sep 17 00:00:00 2001 From: shagu Date: Mon, 17 Jul 2017 11:54:04 +0200 Subject: [PATCH] thirdparty: debufftimers detection --- api/unitframes.lua | 2 +- modules/debuffs.lua | 2 ++ modules/nameplates.lua | 2 +- modules/thirdparty.lua | 19 +++++++++++++++++++ 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/api/unitframes.lua b/api/unitframes.lua index 7b4c81e8..006af917 100644 --- a/api/unitframes.lua +++ b/api/unitframes.lua @@ -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) diff --git a/modules/debuffs.lua b/modules/debuffs.lua index 567f5b4f..adc6de55 100644 --- a/modules/debuffs.lua +++ b/modules/debuffs.lua @@ -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+)") diff --git a/modules/nameplates.lua b/modules/nameplates.lua index 6b397756..6b6701c1 100644 --- a/modules/nameplates.lua +++ b/modules/nameplates.lua @@ -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 diff --git a/modules/thirdparty.lua b/modules/thirdparty.lua index e6f4626c..2575999f 100644 --- a/modules/thirdparty.lua +++ b/modules/thirdparty.lua @@ -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)