mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 06:40:13 -05:00
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:
@ -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"
|
||||
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user