Skip to content

Commit

Permalink
Heal Prediction: fix lookAhead being ignored on multiple frames
Browse files Browse the repository at this point in the history
Related to #11.
6310e2a

If there was more than one unitframe with the same GUID, the Heal Prediction bar would always assume no lookAhead on the previous unitframes. After some investigation, I concluded that HealComm4 element from ElvUI was somehow conflicting with PZ, and since it is only being used for ElvUI HP, it is best to disable it completely and solely rely on PZ element.

Another alternative that gave satisfying results would be defining self.HealCommTimeframe, although it would be wasting cpu for no reason.
  • Loading branch information
Zidras committed Aug 28, 2022
1 parent aada8a7 commit cfee0c8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,10 @@ local function Update(self, event, unit, absorb)

local unitGUID = UnitGUID(unit)
local lookAhead = element.lookAhead or 5
local timeWindow = lookAhead and (GetTime() + lookAhead) or nil

local myIncomingHeal = (HealComm:GetHealAmount(unitGUID, HealComm.ALL_HEALS, GetTime() + lookAhead, UnitGUID("player")) or 0) * (HealComm:GetHealModifier(unitGUID) or 1) or 0
local allIncomingHeal = (HealComm:GetHealAmount(unitGUID, HealComm.ALL_HEALS, GetTime() + lookAhead) or 0) * (HealComm:GetHealModifier(unitGUID) or 1) or 0
local myIncomingHeal = ((HealComm:GetHealAmount(unitGUID, HealComm.ALL_HEALS, timeWindow, UnitGUID("player")) or 0) * (HealComm:GetHealModifier(unitGUID) or 1)) or 0
local allIncomingHeal = ((HealComm:GetHealAmount(unitGUID, HealComm.ALL_HEALS, timeWindow) or 0) * (HealComm:GetHealModifier(unitGUID) or 1)) or 0
absorb = absorb or SA.UnitTotal(UnitGUID(unit)) or 0
local healAbsorb = SA.UnitTotalHealAbsorbs(UnitGUID(unit)) or 0
local health, maxHealth = UnitHealth(unit), UnitHealthMax(unit)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ function ZUF:Configure_HealComm(frame)
if db.enable ~= E.db.pz.unitframe.units[frame.unitframeType].absorbPrediction.enable then db.enable = true end -- workaround because RaidGroup1Button1 and PartyGroup1Button1 db.enable were being rewritten to false for some reason
end

if frame:IsElementEnabled("HealComm4") then
frame:DisableElement("HealComm4") -- disable stock ElvUI element since it was messing with the heal prediction (lookAhead, tags, statusbar). HealthPrediction is provided by PZ and is meant to be a full replacement.
end

if db and db.enable then

local pred = frame.HealCommBar
Expand Down

1 comment on commit cfee0c8

@Ithiloneth
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great - but I can't seem to find any information on where this element becomes available through the UI for modification?
Preferable would be having the following logic available, where a time frame can be given for the player (self) and for other players (others) separately.
But even just being able to section out HoTs from Direct Heals would make a massive difference in QoL for healers.

For self:
HoTs
Direct Heals

For others:
HoTs
Direct Heals

image

image

Please sign in to comment.