diff --git a/.pkgmeta b/.pkgmeta index f982595..acb9499 100644 --- a/.pkgmeta +++ b/.pkgmeta @@ -25,4 +25,5 @@ externals: Libs/LibDataBroker-1.1: https://github.com/tekkub/libdatabroker-1-1.git Libs/LibDBIcon-1.0: https://repos.wowace.com/wow/libdbicon-1-0/trunk/LibDBIcon-1.0 Libs/LibTranslit-1.0: https://github.com/Vardex/LibTranslit.git + Libs/LibHealComm-4.0: https://github.com/Azilroka/LibHealComm-4.0.git Libs/LibClassicDurations: https://repos.curseforge.com/wow/libclassicdurations diff --git a/Aptechka-Classic.toc b/Aptechka-Classic.toc index f62ea91..8e70ffa 100644 --- a/Aptechka-Classic.toc +++ b/Aptechka-Classic.toc @@ -27,6 +27,7 @@ Libs\LibAuraTypes\LibAuraTypes.lua Libs\LibTargetedCasts\LibTargetedCasts.lua Libs\LibTargeted\LibTargeted.lua +Libs\LibHealComm-4.0\LibHealComm-4.0.xml Libs\LibClassicDurations\LibClassicDurations.xml helpers.lua diff --git a/Aptechka-TBC.toc b/Aptechka-TBC.toc index ab8527f..2bed8dc 100644 --- a/Aptechka-TBC.toc +++ b/Aptechka-TBC.toc @@ -1,4 +1,4 @@ -## Interface: 20502 +## Interface: 20501 ## Title: Aptechka ## Notes: Raid Frames ## Version: @project-version@ @@ -26,6 +26,8 @@ Libs\LibAuraTypes\LibAuraTypes.lua Libs\LibTargetedCasts\LibTargetedCasts.lua Libs\LibTargeted\LibTargeted.lua +Libs\LibHealComm-4.0\LibHealComm-4.0.xml + helpers.lua config.lua config.tbc.lua diff --git a/Aptechka.lua b/Aptechka.lua index 0161e28..d0b4eb3 100644 --- a/Aptechka.lua +++ b/Aptechka.lua @@ -37,6 +37,7 @@ if apiLevel <= 2 then UnitHasVehicleUI = dummyFalse UnitInVehicle = dummyFalse UnitUsingVehicle = dummyFalse + UnitGetIncomingHeals = dummy0 UnitGetTotalAbsorbs = dummy0 UnitGetTotalHealAbsorbs = dummy0 UnitPhaseReason = dummyFalse @@ -373,7 +374,22 @@ function Aptechka.PLAYER_LOGIN(self,event,arg1) end if config.enableIncomingHeals then - self:RegisterEvent("UNIT_HEAL_PREDICTION") + if apiLevel <= 2 then + HealComm = LibStub:GetLibrary("LibHealComm-4.0",true); + local incomingHealIgnoreHots = true + if HealComm then + if incomingHealIgnoreHots then + HealComm.AptechkaHealType = HealComm.CASTED_HEALS + else + HealComm.AptechkaHealType = HealComm.ALL_HEALS + HealComm.RegisterCallback(self, "HealComm_HealUpdated", "HealUpdated"); -- hots + end + HealComm.RegisterCallback(self, "HealComm_HealStarted", "HealUpdated"); + HealComm.RegisterCallback(self, "HealComm_HealStopped", "HealUpdated"); + end + else + self:RegisterEvent("UNIT_HEAL_PREDICTION") + end end if LibClassicDurations then @@ -994,6 +1010,24 @@ function Aptechka.UNIT_HEAL_PREDICTION(self,event,unit) end if apiLevel <= 2 then + function Aptechka:HealUpdated(event, casterGUID, spellID, healType, endTime, ...) + for i=1,select('#', ...) do + local targetGUID = select(i, ...) + local unit = guidMap[targetGUID] + if unit then + Aptechka:UNIT_HEAL_PREDICTION(nil, unit, targetGUID) + end + end + end + + local incomingHealTimeframe = 3 + + GetIncomingHealsCustom = function (unit, excludePlayer) + local guid = UnitGUID(unit) + local heal = HealComm:GetHealAmount(guid, HealComm.AptechkaHealType, GetTime()+incomingHealTimeframe) + return heal or 0 + end + function Aptechka.UNIT_HEAL_PREDICTION(self,event,unit) self:UNIT_HEALTH(event, unit)