Drive the rez icon from ClassicAPI's incoming resurrections

ClassicAPI's UnitHasIncomingResurrection sees every resurrection cast in
view from SMSG_SPELL_START and ends it with the cast, and
INCOMING_RESURRECT_CHANGED signals each change. libpredict's own
tracking goes: the ress tables and 60s timers, parsing Resurrection and
RES/RESNO messages, clearing on UNIT_HEALTH, and the rez branches of the
cast handlers, along with UNIT_SPELLCAST_STOP and the foreign cast
targets only rez used. libpredict still announces the player's own
resurrections to HealComm and CTRA for clients without ClassicAPI.

The native state ends with the cast, so a rez that landed would vanish
before the target accepts it. libpredict records the SPELL_RESURRECT
combat log event per GUID and keeps the offer until the target is alive
again or the 60s accept popup runs out, unlike Grid2, which cannot tell
a landed rez from a cancelled one. UnitHasResurrection answers both.

The unit frames show the icon in RefreshIndicators, refreshed by
INCOMING_RESURRECT_CHANGED on the frame's own unit and by libpredict for
offers, instead of polling libpredict every 0.1s.
This commit is contained in:
Brues
2026-10-29 23:49:28 -05:00
parent 8c22fdb850
commit 26c55bddb0
3 changed files with 63 additions and 171 deletions
+7 -4
View File
@@ -1051,6 +1051,8 @@ function pfUI.uf.OnEvent()
this.update_pvp = true
elseif event == "UNIT_COMBAT" then
CombatFeedback_OnCombatEvent(arg2, arg3, arg4, arg5)
elseif event == "INCOMING_RESURRECT_CHANGED" then
this.update_indicators = true
else
this.update_base = true
end
@@ -1221,10 +1223,6 @@ function pfUI.uf.OnUpdate()
this.incHeal:Hide()
end
end
-- update ressurections
local ress = libpredict:UnitHasIncomingResurrection(unit)
this.ressIcon:SetShown(ress and UnitIsDeadOrGhost(unit))
end
end
end
@@ -1302,6 +1300,7 @@ local UNIT_EVENTS = {
"UNIT_PORTRAIT_UPDATE", "UNIT_MODEL_CHANGED",
"UNIT_FACTION",
"UNIT_AURA", -- frame=buff, frame=debuff
"INCOMING_RESURRECT_CHANGED", -- frame=ressIcon
}
-- Point this frame's unit-event subscriptions at `unitstr`, or drop them when
@@ -1649,6 +1648,10 @@ function pfUI.uf:RefreshIndicators(unit)
unit.pvpIcon:SetShown(unit.config.showPVP == "1" and UnitIsPVP(unitstr))
end
if unit.ressIcon then -- Resurrection Icon
unit.ressIcon:SetShown(libpredict:UnitHasResurrection(unitstr))
end
if unit.restIcon and unit:GetName() == "pfPlayer" then -- Rest Icon
unit.restIcon:SetShown(C.unitframes.player.showRest == "1" and UnitIsUnit(unitstr, "player") and IsResting())
end