Skip to content

Commit

Permalink
[oUF] HealPrediction: Revert back to old HealPrediction for Cataclysm…
Browse files Browse the repository at this point in the history
… due to issues with Power Word: Barrier
  • Loading branch information
EsreverWoW committed May 4, 2024
1 parent aada827 commit 4cccf8e
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 33 deletions.
2 changes: 1 addition & 1 deletion ShestakUI/Libs/oUF/Elements/HealPrediction.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
local _, ns = ...
local oUF = ns.oUF

if(oUF:IsClassic() and not oUF:IsCata()) then return end
if(oUF:IsClassic()) then return end

local UnitGetTotalAbsorbs = UnitGetTotalAbsorbs
local UnitGetTotalHealAbsorbs = UnitGetTotalHealAbsorbs
Expand Down
37 changes: 20 additions & 17 deletions ShestakUI/Libs/oUF/Elements/HealPrediction_Classic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
local _, ns = ...
local oUF = ns.oUF

if(oUF:IsMainline() or oUF:IsCata()) then return end
if(oUF:IsMainline()) then return end

local HealComm = LibStub("LibHealComm-4.0")
local HealComm = not oUF:IsCata() and LibStub("LibHealComm-4.0")

local function Update(self, event, unit)
if(self.unit ~= unit) then return end
Expand All @@ -14,10 +14,9 @@ local function Update(self, event, unit)
if(hp.PreUpdate) then hp:PreUpdate(unit) end

local GUID = UnitGUID(unit)
local OverTimeHeals = (HealComm:GetHealAmount(GUID, HealComm.OVERTIME_AND_BOMB_HEALS) or 0) * (HealComm:GetHealModifier(GUID) or 1)
local OverTimeHeals = HealComm and ((HealComm:GetHealAmount(GUID, HealComm.OVERTIME_AND_BOMB_HEALS) or 0) * (HealComm:GetHealModifier(GUID) or 1)) or 0
local DirectHeals = UnitGetIncomingHeals(unit) or 0
local IncomingHeals = DirectHeals >= DirectHeals + OverTimeHeals and DirectHeals or DirectHeals + OverTimeHeals
-- local IncomingHeals = (HealComm:GetHealAmount(GUID, HealComm.ALL_HEALS) or 0) * (HealComm:GetHealModifier(GUID) or 1)
local Health = UnitHealth(unit)
local MaxHealth = UnitHealthMax(unit)

Expand Down Expand Up @@ -47,7 +46,7 @@ local function Enable(self)
if(element) then
element.__owner = self
element.ForceUpdate = ForceUpdate
element.healType = element.healType or HealComm.ALL_HEALS
element.healType = element.healType or HealComm and HealComm.ALL_HEALS

self:RegisterEvent('UNIT_MAXHEALTH', Path)
self:RegisterEvent('UNIT_HEALTH_FREQUENT', Path)
Expand All @@ -71,12 +70,14 @@ local function Enable(self)
HealCommUpdate(guid)
end

HealComm.RegisterCallback(element, 'HealComm_HealStarted', HealComm_Heal_Update)
HealComm.RegisterCallback(element, 'HealComm_HealUpdated', HealComm_Heal_Update)
HealComm.RegisterCallback(element, 'HealComm_HealDelayed', HealComm_Heal_Update)
HealComm.RegisterCallback(element, 'HealComm_HealStopped', HealComm_Heal_Update)
HealComm.RegisterCallback(element, 'HealComm_ModifierChanged', HealComm_Modified)
HealComm.RegisterCallback(element, 'HealComm_GUIDDisappeared', HealComm_Modified)
if(HealComm) then
HealComm.RegisterCallback(element, 'HealComm_HealStarted', HealComm_Heal_Update)
HealComm.RegisterCallback(element, 'HealComm_HealUpdated', HealComm_Heal_Update)
HealComm.RegisterCallback(element, 'HealComm_HealDelayed', HealComm_Heal_Update)
HealComm.RegisterCallback(element, 'HealComm_HealStopped', HealComm_Heal_Update)
HealComm.RegisterCallback(element, 'HealComm_ModifierChanged', HealComm_Modified)
HealComm.RegisterCallback(element, 'HealComm_GUIDDisappeared', HealComm_Modified)
end

if(not element.maxOverflow) then
element.maxOverflow = 1.05
Expand Down Expand Up @@ -109,12 +110,14 @@ local function Disable(self)
element.otherBar:Hide()
end

HealComm.UnregisterCallback(element, 'HealComm_HealStarted')
HealComm.UnregisterCallback(element, 'HealComm_HealUpdated')
HealComm.UnregisterCallback(element, 'HealComm_HealDelayed')
HealComm.UnregisterCallback(element, 'HealComm_HealStopped')
HealComm.UnregisterCallback(element, 'HealComm_ModifierChanged')
HealComm.UnregisterCallback(element, 'HealComm_GUIDDisappeared')
if(HealComm) then
HealComm.UnregisterCallback(element, 'HealComm_HealStarted')
HealComm.UnregisterCallback(element, 'HealComm_HealUpdated')
HealComm.UnregisterCallback(element, 'HealComm_HealDelayed')
HealComm.UnregisterCallback(element, 'HealComm_HealStopped')
HealComm.UnregisterCallback(element, 'HealComm_ModifierChanged')
HealComm.UnregisterCallback(element, 'HealComm_GUIDDisappeared')
end

self:UnregisterEvent('UNIT_MAXHEALTH', Path)
self:UnregisterEvent('UNIT_HEALTH_FREQUENT', Path)
Expand Down
6 changes: 1 addition & 5 deletions ShestakUI/Modules/UnitFrames/Layout.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1252,18 +1252,14 @@ local function Shared(self, unit)

-- Incoming heals and heal/damage absorbs
if C.raidframe.plugins_healcomm == true then
if T.Classic and not T.Cata then
if T.Classic then
local healBar = CreateFrame("StatusBar", nil, self)
healBar:SetAllPoints(self.Health)
healBar:SetStatusBarTexture(C.media.texture)
healBar:SetStatusBarColor(0, 1, 0, 0.2)
self.HealPrediction = healBar
else
T.CreateHealthPrediction(self)

if T.Classic then
self.HealthPrediction.frequentUpdates = true
end
end
end

Expand Down
6 changes: 1 addition & 5 deletions ShestakUI/Modules/UnitFrames/RaidDPS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -250,18 +250,14 @@ local function Shared(self, unit)

-- Incoming heals and heal/damage absorbs
if C.raidframe.plugins_healcomm == true then
if T.Classic and not T.Cata then
if T.Classic then
local healBar = CreateFrame("StatusBar", nil, self)
healBar:SetAllPoints(self.Health)
healBar:SetStatusBarTexture(C.media.texture)
healBar:SetStatusBarColor(0, 1, 0, 0.2)
self.HealPrediction = healBar
else
T.CreateHealthPrediction(self)

if T.Classic then
self.HealthPrediction.frequentUpdates = true
end
end
end

Expand Down
6 changes: 1 addition & 5 deletions ShestakUI/Modules/UnitFrames/RaidHeal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -249,18 +249,14 @@ local function Shared(self, unit)

-- Incoming heals and heal/damage absorbs
if C.raidframe.plugins_healcomm == true then
if T.Classic and not T.Cata then
if T.Classic then
local healBar = CreateFrame("StatusBar", nil, self)
healBar:SetAllPoints(self.Health)
healBar:SetStatusBarTexture(C.media.texture)
healBar:SetStatusBarColor(0, 1, 0, 0.2)
self.HealPrediction = healBar
else
T.CreateHealthPrediction(self)

if T.Classic then
self.HealthPrediction.frequentUpdates = true
end
end
end

Expand Down

0 comments on commit 4cccf8e

Please sign in to comment.