really helpful thread. thank you for sharing this.
since all we like efficiency, do CVars-checking will help as well? or useless thoughts?
Lua Code:
local f = CreateFrame('Frame')
local a = f:CreateAnimationGroup()
a:CreateAnimation():SetDuration(1/3)
a:SetLooping('REPEAT')
a:SetScript('OnLoop', function ()
-- LF Nameplates
end)
local cvars = {
nameplateShowFriends = true, nameplateShowFriendlyPets = true, nameplateShowFriendlyGuardians = true, nameplateShowFriendlyTotems = true,
nameplateShowEnemies = true, nameplateShowEnemyPets = true, nameplateShowEnemyGuardians = true, nameplateShowEnemyTotems = true,
}
local function check ()
for cvar in next, cvars do if ( GetCVarBool(cvar) ) then return a:Play() end end
return a:Stop()
end
hooksecurefunc('SetCVar', function (cvar) if ( cvars[cvar] ) then return check() end end)