from retail
This commit is contained in:
@@ -385,10 +385,10 @@ function OptionsPrivate.GetAnimationOptions(data)
|
||||
return (data.animation.start.type ~= "custom" or not OptionsPrivate.Private.EnsureRegion(id).Color)
|
||||
end,
|
||||
get = function()
|
||||
return data.animation.start.colorR,
|
||||
data.animation.start.colorG,
|
||||
data.animation.start.colorB,
|
||||
data.animation.start.colorA;
|
||||
return data.animation.start.colorR or 1,
|
||||
data.animation.start.colorG or 1,
|
||||
data.animation.start.colorB or 1,
|
||||
data.animation.start.colorA or 1;
|
||||
end,
|
||||
set = function(info, r, g, b, a)
|
||||
data.animation.start.colorR = r;
|
||||
@@ -661,10 +661,10 @@ function OptionsPrivate.GetAnimationOptions(data)
|
||||
return (data.animation.main.type ~= "custom" or not OptionsPrivate.Private.EnsureRegion(id).Color)
|
||||
end,
|
||||
get = function()
|
||||
return data.animation.main.colorR,
|
||||
data.animation.main.colorG,
|
||||
data.animation.main.colorB,
|
||||
data.animation.main.colorA;
|
||||
return data.animation.main.colorR or 1,
|
||||
data.animation.main.colorG or 1,
|
||||
data.animation.main.colorB or 1,
|
||||
data.animation.main.colorA or 1;
|
||||
end,
|
||||
set = function(info, r, g, b, a)
|
||||
data.animation.main.colorR = r;
|
||||
@@ -910,10 +910,10 @@ function OptionsPrivate.GetAnimationOptions(data)
|
||||
return (data.animation.finish.type ~= "custom" or not OptionsPrivate.Private.EnsureRegion(id).Color)
|
||||
end,
|
||||
get = function()
|
||||
return data.animation.finish.colorR,
|
||||
data.animation.finish.colorG,
|
||||
data.animation.finish.colorB,
|
||||
data.animation.finish.colorA;
|
||||
return data.animation.finish.colorR or 1,
|
||||
data.animation.finish.colorG or 1,
|
||||
data.animation.finish.colorB or 1,
|
||||
data.animation.finish.colorA or 1;
|
||||
end,
|
||||
set = function(info, r, g, b, a)
|
||||
data.animation.finish.colorR = r;
|
||||
|
||||
@@ -885,15 +885,18 @@ local getHelper = {
|
||||
local function CreateGetAll(subOption)
|
||||
return function(data, info, ...)
|
||||
local isToggle = nil
|
||||
local isColor = nil
|
||||
|
||||
local allChildren = CopyTable(getHelper)
|
||||
local enabledChildren = CopyTable(getHelper)
|
||||
for child in OptionsPrivate.Private.TraverseLeafs(data) do
|
||||
if isToggle == nil then
|
||||
if isToggle == nil or isColor == nil then
|
||||
local childOptions = getChildOption(OptionsPrivate.EnsureOptions(child, subOption), info)
|
||||
isToggle = childOptions and childOptions.type == "toggle"
|
||||
isColor = childOptions and childOptions.type == "color"
|
||||
end
|
||||
|
||||
|
||||
local childOptions = OptionsPrivate.EnsureOptions(child, subOption)
|
||||
local childOption = childOptions;
|
||||
local childOptionTable = {[0] = childOption};
|
||||
@@ -915,6 +918,9 @@ local function CreateGetAll(subOption)
|
||||
end
|
||||
|
||||
if not allChildren:GetSame() and not enabledChildren:GetSame() then
|
||||
if isColor then
|
||||
return 0, 0, 0, 1
|
||||
end
|
||||
return nil;
|
||||
end
|
||||
break;
|
||||
|
||||
@@ -245,6 +245,52 @@ function OptionsPrivate.GetInformationOptions(data)
|
||||
end
|
||||
end
|
||||
|
||||
-- Saved Data
|
||||
local savedDataCount = 0
|
||||
for child in OptionsPrivate.Private.TraverseLeafsOrAura(data) do
|
||||
OptionsPrivate.Private.SaveAuraEnvironment(data.id)
|
||||
if child.information.saved then
|
||||
savedDataCount = savedDataCount + 1
|
||||
end
|
||||
end
|
||||
if savedDataCount > 0 then
|
||||
args.savedDataTitle = {
|
||||
type = "header",
|
||||
name = L["Saved Data"],
|
||||
width = WeakAuras.doubleWidth,
|
||||
order = order,
|
||||
}
|
||||
order = order + 1
|
||||
|
||||
for child in OptionsPrivate.Private.TraverseLeafsOrAura(data) do
|
||||
if child.information.saved then
|
||||
args["savedData." .. child.uid] = {
|
||||
type = "description",
|
||||
name = L["%s stores around %s KB of data"]:format(child.id, ceil((#child.information.saved) / 1024)),
|
||||
width = savedDataCount > 1 and WeakAuras.doubleWidth or WeakAuras.normalWidth,
|
||||
order = order,
|
||||
}
|
||||
order = order + 1
|
||||
end
|
||||
end
|
||||
|
||||
args.savedDataClear = {
|
||||
type = "execute",
|
||||
name = L["Clear Saved Data"],
|
||||
width = savedDataCount > 1 and WeakAuras.doubleWidth or WeakAuras.normalWidth,
|
||||
order = order,
|
||||
func = function()
|
||||
for child in OptionsPrivate.Private.TraverseLeafsOrAura(data) do
|
||||
OptionsPrivate.Private.ClearAuraEnvironmentSavedData(child.id)
|
||||
WeakAuras.Add(child)
|
||||
OptionsPrivate.ClearOptions(child.id)
|
||||
end
|
||||
WeakAuras.ClearAndUpdateOptions(data.id)
|
||||
end
|
||||
}
|
||||
order = order + 1
|
||||
end
|
||||
|
||||
-- Debug Log
|
||||
args.debugLogTitle = {
|
||||
type = "header",
|
||||
|
||||
Reference in New Issue
Block a user