from retail
This commit is contained in:
+66
-31
@@ -1112,6 +1112,7 @@ function Private.Login(initialTime, takeNewSnapshots)
|
||||
for _, region in pairs(Private.regions) do
|
||||
if (region.region and region.region.RunDelayedActions) then
|
||||
region.region:RunDelayedActions();
|
||||
coroutine.yield()
|
||||
end
|
||||
end
|
||||
end)
|
||||
@@ -2205,34 +2206,58 @@ function Private.AddMany(tbl, takeSnapshots)
|
||||
|
||||
local order = loadOrder(tbl, idtable)
|
||||
coroutine.yield()
|
||||
local groups = {}
|
||||
for _, data in ipairs(order) do
|
||||
WeakAuras.PreAdd(data)
|
||||
if data.regionType == "dynamicgroup" or data.regionType == "group" then
|
||||
groups[data] = true
|
||||
|
||||
if takeSnapshots then
|
||||
for _, data in ipairs(order) do
|
||||
Private.SetMigrationSnapshot(data.uid, data)
|
||||
coroutine.yield()
|
||||
end
|
||||
end
|
||||
|
||||
local groups = {}
|
||||
local bads = {}
|
||||
for _, data in ipairs(order) do
|
||||
if data.parent and bads[data.parent] then
|
||||
bads[data.id] = true
|
||||
else
|
||||
local ok = pcall(WeakAuras.PreAdd, data)
|
||||
if not ok then
|
||||
geterrorhandler()
|
||||
prettyPrint(L["Unable to modernize aura '%s'. This is probably due to corrupt data or a bad migration, please report this to the WeakAuras team."]:format(data.id))
|
||||
if data.regionType == "dynamicgroup" or data.regionType == "group" then
|
||||
prettyPrint(L["All children of this aura will also not be loaded, to minimize the chance of further corruption."])
|
||||
end
|
||||
bads[data.id] = true
|
||||
elseif data.regionType == "dynamicgroup" or data.regionType == "group" then
|
||||
groups[data] = true
|
||||
end
|
||||
coroutine.yield()
|
||||
end
|
||||
coroutine.yield()
|
||||
end
|
||||
|
||||
for _, data in ipairs(order) do
|
||||
WeakAuras.Add(data, takeSnapshots);
|
||||
coroutine.yield()
|
||||
if not bads[data.id] then
|
||||
WeakAuras.Add(data)
|
||||
coroutine.yield()
|
||||
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
|
||||
if data and not bads[data.id] 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] and Private.regions[data.id].region then
|
||||
Private.regions[data.id].region:ReloadControlledChildren()
|
||||
if not bads[data.id] then
|
||||
if data.type == "dynamicgroup" then
|
||||
if Private.regions[data.id] and Private.regions[data.id].region then
|
||||
Private.regions[data.id].region:ReloadControlledChildren()
|
||||
end
|
||||
else
|
||||
WeakAuras.Add(data)
|
||||
end
|
||||
else
|
||||
WeakAuras.Add(data)
|
||||
end
|
||||
coroutine.yield();
|
||||
end
|
||||
@@ -2762,13 +2787,9 @@ local function pAdd(data, simpleChange)
|
||||
end
|
||||
end
|
||||
|
||||
function WeakAuras.Add(data, takeSnapshot, simpleChange)
|
||||
local snapshot
|
||||
if takeSnapshot or (data.internalVersion or 0) < internalVersion then
|
||||
snapshot = CopyTable(data)
|
||||
end
|
||||
if takeSnapshot then
|
||||
Private.SetMigrationSnapshot(data.uid, snapshot)
|
||||
function WeakAuras.Add(data, simpleChange)
|
||||
if (data.internalVersion or 0) < internalVersion then
|
||||
Private.SetMigrationSnapshot(data.uid, data)
|
||||
end
|
||||
local ok, ret = pcall(WeakAuras.PreAdd, data)
|
||||
if not ok then
|
||||
@@ -3639,21 +3660,35 @@ local function SetFrameLevel(id, frameLevel)
|
||||
Private.frameLevels[id] = frameLevel;
|
||||
end
|
||||
|
||||
function Private.FixGroupChildrenOrderForGroup(data)
|
||||
SetFrameLevel(data.id, 0)
|
||||
local frameLevel, offset
|
||||
if data.regionType == "dynamicgroup" then
|
||||
frameLevel, offset = 5, 0
|
||||
local function FixGroupChildrenOrderImpl(data, frameLevel)
|
||||
SetFrameLevel(data.id, frameLevel)
|
||||
local offset
|
||||
if data.sharedFrameLevel then
|
||||
offset = 0
|
||||
else
|
||||
frameLevel, offset = 2, 4
|
||||
offset = 4
|
||||
end
|
||||
for _, childId in ipairs(data.controlledChildren) do
|
||||
local data = WeakAuras.GetData(childId)
|
||||
if data.regionType ~= "group" and data.regionType ~= "dynamicgroup" then
|
||||
SetFrameLevel(childId, frameLevel);
|
||||
frameLevel = frameLevel + offset;
|
||||
local childData = WeakAuras.GetData(childId)
|
||||
if childData.regionType ~= "group" and childData.regionType ~= "dynamicgroup" then
|
||||
frameLevel = frameLevel + offset
|
||||
SetFrameLevel(childId, frameLevel)
|
||||
else
|
||||
frameLevel = frameLevel + offset
|
||||
local endFrameLevel = FixGroupChildrenOrderImpl(childData, frameLevel)
|
||||
if not data.sharedFrameLevel then
|
||||
frameLevel = endFrameLevel
|
||||
end
|
||||
end
|
||||
end
|
||||
return frameLevel
|
||||
end
|
||||
|
||||
function Private.FixGroupChildrenOrderForGroup(data)
|
||||
if data.parent then
|
||||
return
|
||||
end
|
||||
FixGroupChildrenOrderImpl(data, 0)
|
||||
end
|
||||
|
||||
local function GetFrameLevelFor(id)
|
||||
|
||||
Reference in New Issue
Block a user