diff --git a/WeakAuras/AuraEnvironment.lua b/WeakAuras/AuraEnvironment.lua index 6175036..cb63dd4 100644 --- a/WeakAuras/AuraEnvironment.lua +++ b/WeakAuras/AuraEnvironment.lua @@ -243,13 +243,13 @@ function Private.RestoreAuraEnvironment(id) end function Private.ClearAuraEnvironmentSavedData(id) - if environment_initialized[id] then + if environment_initialized[id] == 2 then aura_environments[id].saved = nil end end function Private.ClearAuraEnvironment(id) - if environment_initialized[id] then + if environment_initialized[id] == 2 then Private.SaveAuraEnvironment(id) environment_initialized[id] = nil aura_environments[id] = nil diff --git a/WeakAuras/BuffTrigger2.lua b/WeakAuras/BuffTrigger2.lua index 3688f18..97630a0 100644 --- a/WeakAuras/BuffTrigger2.lua +++ b/WeakAuras/BuffTrigger2.lua @@ -2165,13 +2165,13 @@ local function createScanFunc(trigger) if trigger.ownOnly then ret = ret .. [[ - if matchData.unitCaster ~= 'player' and matchData.unitCaster ~= 'pet' then + if matchData.unitCaster ~= 'player' and matchData.unitCaster ~= 'pet' and matchData.unitCaster ~= 'vehicle' then return false end ]] elseif trigger.ownOnly == false then ret = ret .. [[ - if matchData.unitCaster == 'player' or matchData.unitCaster == 'pet' then + if matchData.unitCaster == 'player' or matchData.unitCaster == 'pet' or matchData.unitCaster == 'vehicle' then return false end ]] diff --git a/WeakAuras/RegionTypes/RegionPrototype.lua b/WeakAuras/RegionTypes/RegionPrototype.lua index a106747..717ae18 100644 --- a/WeakAuras/RegionTypes/RegionPrototype.lua +++ b/WeakAuras/RegionTypes/RegionPrototype.lua @@ -815,7 +815,6 @@ function WeakAuras.regionPrototype.AddExpandFunction(data, region, cloneId, pare return; end region.toShow = false; - region:SetScript("OnUpdate", nil) Private.PerformActions(data, "finish", region); if (not Private.Animate("display", data.uid, "finish", data.animation.finish, region, false, hideRegion, nil, cloneId)) then @@ -871,7 +870,6 @@ function WeakAuras.regionPrototype.AddExpandFunction(data, region, cloneId, pare return; end region.toShow = false; - region:SetScript("OnUpdate", nil) Private.PerformActions(data, "finish", region); if (not Private.Animate("display", data.uid, "finish", data.animation.finish, region, false, hideRegion, nil, cloneId)) then diff --git a/WeakAuras/WeakAuras.lua b/WeakAuras/WeakAuras.lua index 400ea76..0aef82b 100644 --- a/WeakAuras/WeakAuras.lua +++ b/WeakAuras/WeakAuras.lua @@ -1208,7 +1208,7 @@ loadedFrame:SetScript("OnEvent", function(self, event, addon) end elseif event == "PLAYER_LOGOUT" then for id in pairs(db.displays) do - Private.SaveAuraEnvironment(id) + Private.ClearAuraEnvironment(id) end else local callback @@ -2183,6 +2183,7 @@ end function Private.AddMany(tbl, takeSnapshots) local idtable = {}; + local anchorTargets = {} for _, data in ipairs(tbl) do -- There was an unfortunate bug in update.lua in 2022 that resulted -- in auras having a circular dependencies @@ -2192,6 +2193,9 @@ function Private.AddMany(tbl, takeSnapshots) tDeleteItem(data.controlledChildren, data.id) end idtable[data.id] = data; + if data.anchorFrameType == "SELECTFRAME" and data.anchorFrameFrame and data.anchorFrameFrame:sub(1, 10) == "WeakAuras:" then + anchorTargets[data.anchorFrameFrame:sub(11)] = true + end end local order = loadOrder(tbl, idtable) @@ -2204,6 +2208,14 @@ function Private.AddMany(tbl, takeSnapshots) groups[data] = true end end + + for id in pairs(anchorTargets) do + local data = idtable[id] + if data and (data.parent == nil or idtable[data.parent].regionType ~= "dynamicgroup") then + Private.EnsureRegion(id) + end + end + for data in pairs(groups) do if data.type == "dynamicgroup" then if Private.regions[data.id] then @@ -3752,6 +3764,19 @@ end do local visibleFakeStates = {} + + local function OnDelete(_, uid, id) + visibleFakeStates[id] = nil + end + + local function OnRename(_, uid, oldId, newId) + visibleFakeStates[newId] = visibleFakeStates[oldId] + visibleFakeStates[oldId] = nil + end + + Private.callbacks:RegisterCallback("Delete", OnDelete) + Private.callbacks:RegisterCallback("Rename", OnRename) + local UpdateFakeTimesHandle local function UpdateFakeTimers()