Added new throttle option for nameplate castbar

This commit is contained in:
Meow
2026-03-21 08:05:45 +01:00
parent 1402818e62
commit a7bfff5d33
3 changed files with 52 additions and 4 deletions
+13 -3
View File
@@ -1279,17 +1279,27 @@ nameplates:RegisterEvent("ZONE_CHANGED_NEW_AREA")
local isCasting = nameplate.castbar and nameplate.castbar:IsShown()
local throttle
if target or isCasting then
if target then
throttle = pfUI.throttle:Get("nameplates_target") -- Default: 50 FPS
elseif visiblePlateCount > 20 then
throttle = pfUI.throttle:Get("nameplates_mass") -- Default: 7 FPS for mass pulls
else
throttle = pfUI.throttle:Get("nameplates") -- Default: 10 FPS
end
-- castbar has its own throttle (independent of target throttle)
local castbarThrottle = pfUI.throttle:Get("nameplates_castbar") -- Default: 20 FPS
local castbarReady = (nameplate.castLastTick or 0) + castbarThrottle <= now
if nameplate.castUpdate and castbarReady then
nameplate.castLastTick = now
elseif nameplate.castUpdate and not castbarReady then
nameplate.castUpdate = nil -- defer castUpdate until castbar throttle allows it
end
-- Check for pending event updates (these bypass throttle for immediate response)
-- castUpdate is now handled by its own throttle above, not the general bypass
local hasEventUpdate = nameplate.eventcache or nameplate.auraUpdate or nameplate.castUpdate or nameplate.targetUpdate or nameplate.comboUpdate
-- Event updates bypass throttle
if not hasEventUpdate and (nameplate.lasttick or 0) + throttle > now then return end
nameplate.lasttick = now