mirror of
https://github.com/brues-code/pfUI.git
synced 2026-11-02 00:46:57 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user