mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-30 11:10:00 +00:00
performance improvement
Implemented throttle to update nameplates of non-targets to 0.2 times per second and target to 0.05 seconds
This commit is contained in:
@@ -878,12 +878,19 @@ pfUI:RegisterModule("nameplates", "vanilla", function ()
|
||||
end
|
||||
|
||||
nameplates.OnUpdate = function(frame)
|
||||
local update
|
||||
local frame = frame or this
|
||||
local nameplate = frame.nameplate
|
||||
|
||||
-- Throttle: Update target more frequently than other nameplates
|
||||
local target = UnitExists("target") and frame:GetAlpha() == 1 or nil
|
||||
local throttle = target and 0.05 or 0.2
|
||||
|
||||
if (nameplate.lasttick or 0) + throttle > GetTime() then return end
|
||||
nameplate.lasttick = GetTime()
|
||||
|
||||
local update
|
||||
local original = nameplate.original
|
||||
local name = original.name:GetText()
|
||||
local target = UnitExists("target") and frame:GetAlpha() == 1 or nil
|
||||
local mouseover = UnitExists("mouseover") and original.glow:IsShown() or nil
|
||||
local namefightcolor = C.nameplates.namefightcolor == "1"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user