Fix reported TBC issue of target health updates

For some reason, on TBC classic target health is not updating frequently. I waded through the official TBC source code, and it looks like if predictedHealth is enabled (which it is by default), then the default UI uses an OnUpdate handler to update the target's health bar. So now I'm doing the same.
This commit is contained in:
Parnic
2022-03-24 11:51:58 -05:00
parent b64294ca11
commit 53fdb48b05
2 changed files with 9 additions and 0 deletions

View File

@ -36,6 +36,7 @@ IceHUD.CanTrackOtherUnitBuffs = not IceHUD.WowClassic
IceHUD.CanTrackGCD = not IceHUD.WowClassic
IceHUD.GetSpellInfoReturnsFunnel = IceHUD.WowMain and IceHUD.WowVer < 60000
IceHUD.CanHookDestroyTotem = IceHUD.WowClassic or IceHUD.WowClassicBC
IceHUD.ShouldUpdateTargetHealthEveryTick = IceHUD.WowClassicBC and GetCVarBool("predictedHealth")
IceHUD.UnitPowerEvent = "UNIT_POWER_UPDATE"

View File

@ -642,6 +642,10 @@ function IceTargetHealth.prototype:Enable(core)
self:RegisterEvent("LFG_PROPOSAL_FAILED", "CheckPartyRole")
self:RegisterEvent("LFG_ROLE_UPDATE", "CheckPartyRole")
end
if IceHUD.ShouldUpdateTargetHealthEveryTick and self.unit == "target" then
self.frame:SetScript("OnUpdate", function() self:Update(self.unit) end)
end
end
if (self.moduleSettings.hideBlizz) then
@ -659,6 +663,10 @@ function IceTargetHealth.prototype:Disable(core)
UnregisterUnitWatch(self.frame)
if self.registerEvents and IceHUD.ShouldUpdateTargetHealthEveryTick and self.unit == "target" then
self.frame:SetScript("OnUpdate", nil)
end
if self.moduleSettings.hideBlizz then
self:ShowBlizz()
end