Optimize and harden raid frames

This commit is contained in:
Dusk-92
2026-08-30 09:13:12 +02:00
parent 38674064d6
commit f4685c9e01
8 changed files with 123 additions and 99 deletions
+4 -3
View File
@@ -18,7 +18,7 @@ local backdrop = {
}
-- basic unitstrings
unitstrings = {
local unitstrings = {
["pet"] = true, ["player"] = true, ["target"] = true, ["mouseover"] = true
}
@@ -31,12 +31,13 @@ for i=1,40 do unitstrings["raidpet" .. i] = true end
-- cached aggro detection function
local aggrodata = { }
local function UnitHasAggro(unit)
if aggrodata[unit] and GetTime() < aggrodata[unit].check + 1 then
local now = GetTime()
if aggrodata[unit] and now < aggrodata[unit].check + 1 then
return aggrodata[unit].state
end
aggrodata[unit] = aggrodata[unit] or { }
aggrodata[unit].check = GetTime()
aggrodata[unit].check = now
aggrodata[unit].state = 0
if UnitExists(unit) and UnitIsFriend(unit, "player") then