mirror of
https://github.com/brues-code/pfUI.git
synced 2026-11-09 03:38:58 +00:00
Drive the haste and spell power text from events
Replace the 0.25s ticker with UNIT_SPELL_HASTE for haste and PLAYER_DAMAGE_DONE_MODS for spell power, which fires on the MOD_DAMAGE_DONE fields GetSpellBonusDamage reads.
This commit is contained in:
+8
-4
@@ -61,7 +61,7 @@ pfUI:RegisterModule("player", function ()
|
|||||||
MAGE = 7, WARLOCK = 6,
|
MAGE = 7, WARLOCK = 6,
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Compute and cache the haste/SP text; called from OnUpdate, throttled to 0.25s
|
-- Compute the haste/SP text; called on haste, spell power and config changes
|
||||||
local function UpdateInfoText()
|
local function UpdateInfoText()
|
||||||
local cfg = playerFrame.config
|
local cfg = playerFrame.config
|
||||||
if not cfg then
|
if not cfg then
|
||||||
@@ -124,9 +124,13 @@ pfUI:RegisterModule("player", function ()
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Haste / spell-power overlay text — refreshes 4×/sec on its own ticker,
|
-- PLAYER_DAMAGE_DONE_MODS fires on the MOD_DAMAGE_DONE fields that
|
||||||
-- independent of the unit frame's OnUpdate cadence.
|
-- GetSpellBonusDamage reads, so gear, buffs and talents all reach it.
|
||||||
C_Timer.NewTicker(0.25, UpdateInfoText)
|
pfUI.events:RegisterFrameEventAndCallback("PLAYER_ENTERING_WORLD", UpdateInfoText)
|
||||||
|
pfUI.events:RegisterFrameEventAndCallback("PLAYER_DAMAGE_DONE_MODS", UpdateInfoText)
|
||||||
|
pfUI.events:RegisterFrameEventAndCallback("UNIT_SPELL_HASTE", function(_, unit)
|
||||||
|
if unit == "player" then UpdateInfoText() end
|
||||||
|
end)
|
||||||
|
|
||||||
-- Replace default's RESET_INSTANCES button with an always working one
|
-- Replace default's RESET_INSTANCES button with an always working one
|
||||||
UnitPopupButtons["RESET_INSTANCES_FIX"] = { text = RESET_INSTANCES, dist = 0 }
|
UnitPopupButtons["RESET_INSTANCES_FIX"] = { text = RESET_INSTANCES, dist = 0 }
|
||||||
|
|||||||
Reference in New Issue
Block a user