5.20.0
This commit is contained in:
@@ -222,6 +222,23 @@ local function DeleteConditionsForTrigger(data, triggernum)
|
||||
end
|
||||
end
|
||||
|
||||
local function FixUpProgressSourceAfterDelete(data, triggernum)
|
||||
local function FixUpProgressSource(data)
|
||||
if data.progressSource then
|
||||
local trigger, property = unpack(data.progressSource)
|
||||
if trigger > triggernum then
|
||||
data.progressSource = {trigger - 1, property}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
FixUpProgressSource(data)
|
||||
|
||||
for _, subRegionData in ipairs(data.subRegions) do
|
||||
FixUpProgressSource(subRegionData)
|
||||
end
|
||||
end
|
||||
|
||||
local function moveTriggerDownConditionCheck(check, i)
|
||||
if (check.trigger == i) then
|
||||
check.trigger = i + 1;
|
||||
@@ -244,6 +261,23 @@ local function moveTriggerDownImpl(data, i)
|
||||
moveTriggerDownConditionCheck(condition.check, i);
|
||||
end
|
||||
|
||||
local function fixUpProgressSource(data)
|
||||
if data.progressSource then
|
||||
local trigger, property = unpack(data.progressSource)
|
||||
if trigger == i then
|
||||
data.progressSource = {i + 1, property}
|
||||
elseif trigger == i + 1 then
|
||||
data.progressSource = {i, property}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
fixUpProgressSource(data)
|
||||
|
||||
for _, subRegionData in ipairs(data.subRegions) do
|
||||
fixUpProgressSource(subRegionData)
|
||||
end
|
||||
|
||||
return true;
|
||||
end
|
||||
|
||||
@@ -352,6 +386,7 @@ function OptionsPrivate.AddTriggerMetaFunctions(options, data, triggernum)
|
||||
if #child.triggers > 1 and #child.triggers >= triggernum then
|
||||
tremove(child.triggers, triggernum)
|
||||
DeleteConditionsForTrigger(child, triggernum)
|
||||
FixUpProgressSourceAfterDelete(child, triggernum)
|
||||
WeakAuras.Add(child)
|
||||
OptionsPrivate.RemoveCollapsed(collapsedId, "trigger", {triggernum})
|
||||
OptionsPrivate.ClearOptions(child.id)
|
||||
|
||||
Reference in New Issue
Block a user