Drive power from UNIT_POWER_UPDATE and UNIT_MAXPOWER

1.12's UNIT_MANA, UNIT_RAGE and the rest fire for every power a unit
has, not only the one it shows, so a druid in cat or bear form redrew
every frame showing them, health colours and texts included, on each
mana tick. ClassicAPI's generic power events name the power in arg2.

Unit frames register them on their own token and redraw only for the
power their bar shows, or for mana under a druid mana bar. They fire
for tokens only, so the GUID-followed target-of-X frames keep the
per-type events; those now share one list with UNIT_AURA, so a frame
swaps auras and power on the same check.

energytick counts gains on the power it tracks alone, so a cat druid's
mana regen is no longer read as energy. It forgets the power while
hidden, so a bear's mana ticks are not measured against rage, and
re-baselines on a shift, so leaving cat form is not a fake mana gain.

The equipment manager's dining trigger wakes on mana changes only.
This commit is contained in:
Brues
2026-10-31 11:55:54 -05:00
parent b6f58b0e04
commit 480889cb05
3 changed files with 40 additions and 20 deletions
+4 -3
View File
@@ -1517,10 +1517,10 @@ pfUI:RegisterModule("equipmentmanager", function()
-- constantly in combat, so only listen while a dining trigger exists.
if dining then
engineEvents:RegisterUnitEvent("UNIT_HEALTH", "player")
engineEvents:RegisterUnitEvent("UNIT_MANA", "player")
engineEvents:RegisterUnitEvent("UNIT_POWER_UPDATE", "player")
else
engineEvents:UnregisterEvent("UNIT_HEALTH")
engineEvents:UnregisterEvent("UNIT_MANA")
engineEvents:UnregisterEvent("UNIT_POWER_UPDATE")
end
if poll and not engine.poll then
@@ -1554,7 +1554,8 @@ pfUI:RegisterModule("equipmentmanager", function()
engine.ready = true
Schedule()
end)
else
elseif event ~= "UNIT_POWER_UPDATE" or arg2 == "MANA" then
-- the dining set waits on mana alone, not on rage or energy
Schedule()
end
end)