From 777cf011747f77dc6d3449c199923b2b6982e84d Mon Sep 17 00:00:00 2001 From: Parnic Date: Fri, 2 Sep 2022 14:27:33 -0500 Subject: [PATCH] Add feature flag for Heal Prediction And turn it on for Wrath Classic, because apparently it works there. --- IceHUD.lua | 1 + modules/PlayerHealth.lua | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/IceHUD.lua b/IceHUD.lua index 0b45605..f0d7382 100644 --- a/IceHUD.lua +++ b/IceHUD.lua @@ -51,6 +51,7 @@ IceHUD.UsesUIPanelButtonTemplate = IceHUD.WowVer >= 50000 or IceHUD.WowClassic o IceHUD.EventExistsSpellcastInterruptible = IceHUD.WowVer >= 30200 and not IceHUD.WowClassicWrath IceHUD.DeathKnightUnholyFrostRunesSwapped = IceHUD.WowVer < 70300 and not IceHUD.WowClassicWrath IceHUD.UseFallbackPaladinGCDSpell = IceHUD.WowClassic or IceHUD.WowClassicBC or IceHUD.WowClassicWrath +IceHUD.SupportsHealPrediction = IceHUD.WowVer >= 40000 or IceHUD.WowClassicWrath IceHUD.UnitPowerEvent = "UNIT_POWER_UPDATE" diff --git a/modules/PlayerHealth.lua b/modules/PlayerHealth.lua index 523109d..8556a1c 100644 --- a/modules/PlayerHealth.lua +++ b/modules/PlayerHealth.lua @@ -105,7 +105,7 @@ function PlayerHealth.prototype:Enable(core) self:RegisterEvent("UNIT_EXITED_VEHICLE", "ExitingVehicle") end - if IceHUD.WowVer < 40000 then + if not IceHUD.SupportsHealPrediction then HealComm = LibStub("LibHealComm-4.0", true) if HealComm then HealComm.RegisterCallback(self, "HealComm_HealStarted", function(event, casterGUID, spellID, spellType, endTime, ...) self:HealComm_HealEvent(event, casterGUID, spellID, spellType, endTime, ...) end) @@ -169,7 +169,7 @@ function PlayerHealth.prototype:HealComm_ModifierChanged(event, guid) end function PlayerHealth.prototype:IncomingHealPrediction(event, unit) - if IceHUD.WowVer >= 40000 then + if IceHUD.SupportsHealPrediction then if unit and unit ~= self.unit then return end @@ -321,7 +321,7 @@ function PlayerHealth.prototype:GetOptions() self:Update() end, disabled = function() - return not (self.moduleSettings.enabled and (IceHUD.WowVer >= 40000 or HealComm)) + return not (self.moduleSettings.enabled and (IceHUD.SupportsHealPrediction or HealComm)) end, order = 43.6 } @@ -942,7 +942,7 @@ function PlayerHealth.prototype:CreateHealBar() self:UpdateBar(1, "undef") - if not self.moduleSettings.showIncomingHeals or (IceHUD.WowVer < 40000 and not HealComm) then + if not self.moduleSettings.showIncomingHeals or (not IceHUD.SupportsHealPrediction and not HealComm) then self.healFrame.bar:Hide() end end