WeakAuras

WeakAuras

206M Downloads

Error when Opening World Map before having opened /wa

K1rawastaken opened this issue ยท 1 comments

commented

Description

Upon a fresh reload or login, when opening the world map the game lags for 2 seconds and an error is shown. The only way I have found to circumvent this error is opening /wa before opening the world map. Which leads me to believe that some parts of the WeakAuras Core are not initialized per default, but only upon opening the WA settings.

WeakAuras Version

WeakAuras 5.0.2.

World of Warcraft Flavor

Wrath of the Lich King Classic

Tested with only WeakAuras

  • Yes
  • No

Lua Error

Message: Interface\AddOns\WeakAuras\AuraEnvironment.lua:526: attempt to index upvalue 'current_aura_env' (a nil value)
Time: Wed Oct 26 15:46:26 2022
Count: 1
Stack: Interface\AddOns\WeakAuras\AuraEnvironment.lua:526: attempt to index upvalue 'current_aura_env' (a nil value)
[string "@interface\AddOns\WeakAuras\AuraEnvironment.lua"]:526: in function <Interface\AddOns\WeakAuras\AuraEnvironment.lua:515>
[string "return function() local CLASS = aura_env.id:gsub("General Options %- ", "")
aura_env.CLASS = CLASS

LWA = LWA or {}
LWA[CLASS] = LWA[CLASS] or {}

local LWA = LWA[CLASS]

LWA.env = aura_env
LWA.resources = LWA.resources or {}
LWA.configs = LWA.configs or {}
LWA.config = nil

LWA.configs["general"] = aura_env.config

LWA.CLASS = CLASS
LWA.MAX_WIDTH = 405
LWA.RESOURCES_HEIGHT = 0

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

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()
    
    if config.primary.resources_position == 1 then -- Above
        h = h + config.primary.spacing + LWA.RESOURCES_HEIGHT
    end
end

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

end

function LWA.GetConfig(grp, force)
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,
},
side = {
width = 32,
height = 32,
spacing = 0,
margin = 0,
grow_horizontal = 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 force or not LWA.config or WeakAuras.IsOptionsOpen() then
    LWA

Reproduction Steps

  1. Login to Character
  2. Open World Map
  3. BOOM Error

similarly:

  1. /reload
  2. open World Map
  3. Boom Error

Last Good Version

No response

Screenshots

No response

Export String

No response

commented

That was a error caused by luxthos aura, which as far as I know is already fixed.