Skip to content

Commit

Permalink
Revert "Removed LibHealComm for 2.5.2"
Browse files Browse the repository at this point in the history
This reverts commit e31a965.
  • Loading branch information
d87 committed Feb 14, 2022
1 parent 5970f69 commit cd98bcc
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 2 deletions.
1 change: 1 addition & 0 deletions .pkgmeta
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions Aptechka-Classic.toc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion Aptechka-TBC.toc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Interface: 20502
## Interface: 20501
## Title: Aptechka
## Notes: Raid Frames
## Version: @project-version@
Expand Down Expand Up @@ -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
Expand Down
36 changes: 35 additions & 1 deletion Aptechka.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ if apiLevel <= 2 then
UnitHasVehicleUI = dummyFalse
UnitInVehicle = dummyFalse
UnitUsingVehicle = dummyFalse
UnitGetIncomingHeals = dummy0
UnitGetTotalAbsorbs = dummy0
UnitGetTotalHealAbsorbs = dummy0
UnitPhaseReason = dummyFalse
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit cd98bcc

Please sign in to comment.