WeakAuras

WeakAuras

200M Downloads

Lots of errors as of today, causing performance issues

sintaxx opened this issue ยท 4 comments

commented

Description

noticed a huge performance hit whenever killing/looting/talking to NPC/ moving around in a populated area, enabled script errors and noticed its WeakAuras, so i disabled every addon except WA, and it still has the errors.

WeakAuras Version

5.0.3

World of Warcraft Flavor

Wrath of the Lich King Classic

Tested with only WeakAuras

  • Yes
  • No

Lua Error

Message: [string "return function() local classes = {..."]:313: attempt to index local 'resRegion' (a nil value)
Time: Wed Oct 26 16:11:42 2022
Count: 84
Stack: [string "return function() local classes = {..."]:313: attempt to index local 'resRegion' (a nil value)
[string "=[C]"]: ?
[string "return function() local classes = {
WARRIOR = "Warrior",
PALADIN = "Paladin",
HUNTER = "Hunter",
ROGUE = "Rogue",
PRIEST = "Priest",
DEATHKNIGHT = "Death Knight",
SHAMAN = "Shaman",
MAGE = "Mage",
WARLOCK = "Warlock",
DRUID = "Druid",
}
local CLASS = classes[UnitClassBase("player")]

local CLASS_OPTIONS = "Class Options - " .. CLASS
local CORE_GROUP = "Core - " .. CLASS
local RESOURCES_GROUP = "Resources - " .. CLASS
local DYNAMIC_LEFT_GROUP = "Dynamic Effects - " .. CLASS
local DYNAMIC_RIGHT_GROUP = "Dynamic Spells - " .. CLASS
local LEFT_SIDE_GROUP = "Left Side - " .. CLASS
local RIGHT_SIDE_GROUP = "Right Side - " .. CLASS
local MAINTENANCE_GROUP = "Maintenance - " .. CLASS

LWA = LWA or {}

LWA.env = aura_env
LWA.config = nil
LWA.CLASS = CLASS
LWA.RESOURCES_HEIGHT = 0

local function tclone(t1)
local t = {}

if t1 then
    for k, v in pairs(t1) do
        if "table" == type(v) then
            v = tclone(v)
        end
        
        if "string" == type(k) then
            t[k] = v
        else
            tinsert(t, v)
        end
    end
end

return t

end

local function tmerge(...)
local ts = {...}
local t = tclone(ts[1])
local t2

for i = 2, #ts do
    t2 = ts[i] or {}
    
    for k, v in pairs(t2) do
        if "table" == type(v) then
            v = tclone(v)
            
            if t[k] and #t[k] == 0 then
                t[k] = tmerge(t[k], v)
            else
                t[k] = v
            end
        else
            t[k] = v
        end
    end
end

return t

end

local function SetRegionSize(r, w, h)
r:SetRegionWidth(w)
r:SetRegionHeight(h)
end

local function ResizeAnchorFrame()
local config = LWA.GetConfig()
local h = 0
local cr = WeakAuras.GetRegion(CORE_GROUP)

if cr and cr:IsVisible() then
    h = cr:GetHeight()
end

SetRegionSize(LWA.env.region, LWA.GetMaxWidth(), max(1, h, config.primary.height + config.primary.spacing + LWA.RESOURCES_HEIGHT))

end

function LWA.GetConfig(grp)
local default = {
style = {
border_size = 0,
border_color = { [1] = 0, [2] = 0, [3] = 0, [4] = 1 },
apply_border = true,
zoom = 30,
},
primary = {
nb = 6,
width = 48,
height = 48,
spacing = 0,
resources_position = 2, -- Below
},
secondary = {
width = 32,
height = 32,
spacing = 0,
},
dynamic = {
width = 32,
height = 32,
spacing = 0,
margin = 0,
swap = false,
},
side = {
width = 32,
height = 32,
spacing = 0,
margin = 0,
},
maintenance = {
width = 32,
height = 32,
spacing = 0,
margin = 0,
},
ooc_alpha = {
alpha = 1,
ignore_enemy = true,
ignore_friendly = true,
},
resources = {
health_bar = {
format = 1
},
mana_bar = {
format = 1
}
},
}

if not LWA.config or WeakAuras.IsOptionsOpen() then
    LWA.config = tmerge(
        default,
        LWA.env.config,
        (WeakAuras.GetData(CLASS_OPTIONS) or {}).config
    )
end

if grp then
    return LWA.config[grp] or {}
end

return LWA.config

end

function LW

Reproduction Steps

noticed a huge performance hit whenever killing/looting/talking to NPC/ moving around in a populated area, enabled script errors and noticed its WeakAuras, so i disabled every addon except WA, and it still has the errors.

Last Good Version

No response

Screenshots

No response

Export String

No response

commented

That's a error in your auras

commented

I did not see the string mentioning any specific aura, i also did not see the string mentioned in the instructions for posting in the errors, how do i know which aura it is ?

commented

@sintaxx These are Luxthos' WA which you haven't updated in a while by the looks of it.

commented

@sintaxx These are Luxthos' WA which you haven't updated in a while by the looks of it.

thank you, i'll look into updating them, i just installed them for my hunter a few weeks ago