mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-10 15:40:01 +00:00
Make nameplate castbars event-driven; unthrottle target bar
Previously every visible plate polled C_Spell.UnitCastingInfo each throttled tick just to detect casts. Now cast state is event-driven: - SPELL_START_OTHER (nampower) stamps a per-GUID castState cache (spellId, timing, channel flag from spellType); SPELL_FAILED_OTHER clears it; normal completion expires at endTime. GetCastInfo just reads the cache, so all call sites (castbar update, non-target detection, casting name-color) stop polling. - plateByGuid routes events to plates in O(1) and bounds the cache to on-screen casters; NAME_PLATE_UNIT_ADDED seeds an already-casting unit with one poll. - The vestigial nameplate.castUpdate flag now fires on cast start to bypass the throttle for an immediate bar. With the poll gone, per-tick work is a cache read + SetValue, so the dedicated target castbar frame now runs unthrottled (every frame) for the smoothest sweep, and the non-target nameplates_castbar default rises 50 -> 100 FPS. Known limits: other-unit cast pushback isn't reported by nampower, and a mob-cancelled channel with no fail event lingers until endTime.
This commit is contained in:
@@ -160,7 +160,7 @@ libthrottle:SetScript("OnEvent", function()
|
||||
-- Set defaults for custom fields if missing
|
||||
if not _G.pfUI_throttle.nameplates_target_custom then _G.pfUI_throttle.nameplates_target_custom = "50" end
|
||||
if not _G.pfUI_throttle.nameplates_custom then _G.pfUI_throttle.nameplates_custom = "10" end
|
||||
if not _G.pfUI_throttle.nameplates_castbar_custom then _G.pfUI_throttle.nameplates_castbar_custom = "50" end
|
||||
if not _G.pfUI_throttle.nameplates_castbar_custom then _G.pfUI_throttle.nameplates_castbar_custom = "100" end
|
||||
if not _G.pfUI_throttle.nameplates_mass_custom then _G.pfUI_throttle.nameplates_mass_custom = "7" end
|
||||
if not _G.pfUI_throttle.tooltip_cursor_custom then _G.pfUI_throttle.tooltip_cursor_custom = "10" end
|
||||
if not _G.pfUI_throttle.chat_tab_custom then _G.pfUI_throttle.chat_tab_custom = "10" end
|
||||
|
||||
Reference in New Issue
Block a user