From 0c4814732cbc03ff10aec59a3f15459ecd1dcfc5 Mon Sep 17 00:00:00 2001 From: Parnic Date: Mon, 6 Sep 2010 03:05:16 +0000 Subject: [PATCH] - updated to use UnitGetIncomingHeals instead of LibHealComm when running cataclysm client. doesn't seem to work with HoTs at the moment, so that's something to keep an eye on as the beta progresses --- modules/PlayerHealth.lua | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/modules/PlayerHealth.lua b/modules/PlayerHealth.lua index 263e084..592e3db 100644 --- a/modules/PlayerHealth.lua +++ b/modules/PlayerHealth.lua @@ -88,13 +88,17 @@ function PlayerHealth.prototype:Enable(core) self:RegisterEvent("UNIT_ENTERED_VEHICLE", "EnteringVehicle") self:RegisterEvent("UNIT_EXITED_VEHICLE", "ExitingVehicle") - if AceLibrary:HasInstance("LibHealComm-4.0") then - HealComm = AceLibrary("LibHealComm-4.0") - HealComm.RegisterCallback(self, "HealComm_HealStarted", function(event, casterGUID, spellID, spellType, endTime, ...) self:HealComm_HealEvent(event, casterGUID, spellID, spellType, endTime, ...) end) - HealComm.RegisterCallback(self, "HealComm_HealUpdated", function(event, casterGUID, spellID, spellType, endTime, ...) self:HealComm_HealEvent(event, casterGUID, spellID, spellType, endTime, ...) end) - HealComm.RegisterCallback(self, "HealComm_HealDelayed", function(event, casterGUID, spellID, spellType, endTime, ...) self:HealComm_HealEvent(event, casterGUID, spellID, spellType, endTime, ...) end) - HealComm.RegisterCallback(self, "HealComm_HealStopped", function(event, casterGUID, spellID, spellType, interrupted, ...) self:HealComm_HealEvent(event, casterGUID, spellID, spellType, interrupted, ...) end) - HealComm.RegisterCallback(self, "HealComm_ModifierChanged", function(event, guid) self:HealComm_ModifierChanged(event, guid) end) + if IceHUD.WowVer < 40000 then + if AceLibrary:HasInstance("LibHealComm-4.0") then + HealComm = AceLibrary("LibHealComm-4.0") + HealComm.RegisterCallback(self, "HealComm_HealStarted", function(event, casterGUID, spellID, spellType, endTime, ...) self:HealComm_HealEvent(event, casterGUID, spellID, spellType, endTime, ...) end) + HealComm.RegisterCallback(self, "HealComm_HealUpdated", function(event, casterGUID, spellID, spellType, endTime, ...) self:HealComm_HealEvent(event, casterGUID, spellID, spellType, endTime, ...) end) + HealComm.RegisterCallback(self, "HealComm_HealDelayed", function(event, casterGUID, spellID, spellType, endTime, ...) self:HealComm_HealEvent(event, casterGUID, spellID, spellType, endTime, ...) end) + HealComm.RegisterCallback(self, "HealComm_HealStopped", function(event, casterGUID, spellID, spellType, interrupted, ...) self:HealComm_HealEvent(event, casterGUID, spellID, spellType, interrupted, ...) end) + HealComm.RegisterCallback(self, "HealComm_ModifierChanged", function(event, guid) self:HealComm_ModifierChanged(event, guid) end) + end + else + self:RegisterEvent("UNIT_HEAL_PREDICTION", "IncomingHealPrediction") end if (self.moduleSettings.hideBlizz) then @@ -135,6 +139,17 @@ function PlayerHealth.prototype:HealComm_ModifierChanged(event, guid) end end +function PlayerHealth.prototype:IncomingHealPrediction(unit) + if IceHUD.WowVer >= 40000 then + if unit and unit ~= self.unit then + return + end + + incomingHealAmt = UnitGetIncomingHeals(self.unit) + self:Update() + end +end + -- OVERRIDE function PlayerHealth.prototype:GetOptions()