diff --git a/ShestakUI/Libs/oUF/Elements/HealPrediction.lua b/ShestakUI/Libs/oUF/Elements/HealPrediction.lua index af37c653f..d7b6b2ab1 100644 --- a/ShestakUI/Libs/oUF/Elements/HealPrediction.lua +++ b/ShestakUI/Libs/oUF/Elements/HealPrediction.lua @@ -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 diff --git a/ShestakUI/Libs/oUF/Elements/HealPrediction_Classic.lua b/ShestakUI/Libs/oUF/Elements/HealPrediction_Classic.lua index 749294f31..0961ce65d 100644 --- a/ShestakUI/Libs/oUF/Elements/HealPrediction_Classic.lua +++ b/ShestakUI/Libs/oUF/Elements/HealPrediction_Classic.lua @@ -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 @@ -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) @@ -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) @@ -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 @@ -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) diff --git a/ShestakUI/Modules/UnitFrames/Layout.lua b/ShestakUI/Modules/UnitFrames/Layout.lua index 3d7244d0c..b6f0737ce 100644 --- a/ShestakUI/Modules/UnitFrames/Layout.lua +++ b/ShestakUI/Modules/UnitFrames/Layout.lua @@ -1252,7 +1252,7 @@ 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) @@ -1260,10 +1260,6 @@ local function Shared(self, unit) self.HealPrediction = healBar else T.CreateHealthPrediction(self) - - if T.Classic then - self.HealthPrediction.frequentUpdates = true - end end end diff --git a/ShestakUI/Modules/UnitFrames/RaidDPS.lua b/ShestakUI/Modules/UnitFrames/RaidDPS.lua index bb1f48df2..c89108147 100644 --- a/ShestakUI/Modules/UnitFrames/RaidDPS.lua +++ b/ShestakUI/Modules/UnitFrames/RaidDPS.lua @@ -250,7 +250,7 @@ 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) @@ -258,10 +258,6 @@ local function Shared(self, unit) self.HealPrediction = healBar else T.CreateHealthPrediction(self) - - if T.Classic then - self.HealthPrediction.frequentUpdates = true - end end end diff --git a/ShestakUI/Modules/UnitFrames/RaidHeal.lua b/ShestakUI/Modules/UnitFrames/RaidHeal.lua index 81a5892f6..24c0288f1 100644 --- a/ShestakUI/Modules/UnitFrames/RaidHeal.lua +++ b/ShestakUI/Modules/UnitFrames/RaidHeal.lua @@ -249,7 +249,7 @@ 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) @@ -257,10 +257,6 @@ local function Shared(self, unit) self.HealPrediction = healBar else T.CreateHealthPrediction(self) - - if T.Classic then - self.HealthPrediction.frequentUpdates = true - end end end