This commit is contained in:
Bunny67
2020-08-08 15:48:17 +03:00
parent 13550c449c
commit 073ca1ffe3
15 changed files with 406 additions and 132 deletions
+21 -4
View File
@@ -93,6 +93,7 @@ function WeakAuras.ConstructOptions(prototype, data, startorder, triggernum, tri
local order = startorder or 10;
local isCollapsedFunctions;
local positionsForCollapseAnchor = {}
for index, arg in pairs(prototype.args) do
local hidden = nil;
if(arg.collapse and isCollapsedFunctions[arg.collapse] and type(arg.enable) == "function") then
@@ -104,6 +105,7 @@ function WeakAuras.ConstructOptions(prototype, data, startorder, triggernum, tri
hidden = function() return not arg.enable(trigger) end;
elseif(arg.collapse and isCollapsedFunctions[arg.collapse]) then
hidden = isCollapsedFunctions[arg.collapse]
positionsForCollapseAnchor[arg.collapse] = order
end
local name = arg.name;
local validate = arg.validate;
@@ -117,16 +119,19 @@ function WeakAuras.ConstructOptions(prototype, data, startorder, triggernum, tri
order = order,
image = function()
local collapsed = WeakAuras.IsCollapsed("trigger", name, "", true)
return collapsed and "Interface\\AddOns\\WeakAuras\\Media\\Textures\\edit" or "Interface\\AddOns\\WeakAuras\\Media\\Textures\\editdown"
return collapsed and "collapsed" or "expanded"
end,
imageWidth = 24,
imageHeight = 24,
imageWidth = 15,
imageHeight = 15,
func = function(info, button, secondCall)
if not secondCall then
local collapsed = WeakAuras.IsCollapsed("trigger", name, "", true)
WeakAuras.SetCollapsed("trigger", name, "", not collapsed)
end
end,
arg = {
expanderName = triggernum .. "#" .. tostring(prototype) .. "#" .. name
}
}
order = order + 1;
@@ -905,7 +910,19 @@ function WeakAuras.ConstructOptions(prototype, data, startorder, triggernum, tri
end
end
WeakAuras.option = options;
for name, order in pairs(positionsForCollapseAnchor) do
options[name .. "anchor"] = {
type = "description",
name = "",
control = "WeakAurasExpandAnchor",
order = order + 0.5,
arg = {
expanderName = triggernum .. "#" .. tostring(prototype) .. "#" .. name
},
hidden = isCollapsedFunctions[name]
}
end
return options;
end