from retail
This commit is contained in:
@@ -54,40 +54,8 @@ local function getWidth(data, region)
|
||||
end
|
||||
end
|
||||
|
||||
-- Create region options table
|
||||
local function createOptions(id, data)
|
||||
-- Region options
|
||||
local options = {
|
||||
__title = L["Group Settings"],
|
||||
__order = 1,
|
||||
groupIcon = {
|
||||
type = "input",
|
||||
width = WeakAuras.doubleWidth - 0.15,
|
||||
name = L["Group Icon"],
|
||||
desc = L["Set Thumbnail Icon"],
|
||||
order = 0.50,
|
||||
get = function()
|
||||
return data.groupIcon and tostring(data.groupIcon) or ""
|
||||
end,
|
||||
set = function(info, v)
|
||||
data.groupIcon = v
|
||||
WeakAuras.Add(data)
|
||||
WeakAuras.UpdateThumbnail(data)
|
||||
end
|
||||
},
|
||||
chooseIcon = {
|
||||
type = "execute",
|
||||
width = 0.15,
|
||||
name = L["Choose"],
|
||||
order = 0.51,
|
||||
func = function()
|
||||
OptionsPrivate.OpenIconPicker(data, { [data.id] = {"groupIcon"} }, true)
|
||||
end,
|
||||
imageWidth = 24,
|
||||
imageHeight = 24,
|
||||
control = "WeakAurasIcon",
|
||||
image = "Interface\\AddOns\\WeakAuras\\Media\\Textures\\browse",
|
||||
},
|
||||
local function createDistributeAlignOptions(id, data)
|
||||
return {
|
||||
align_h = {
|
||||
type = "select",
|
||||
width = WeakAuras.normalWidth,
|
||||
@@ -551,7 +519,45 @@ local function createOptions(id, data)
|
||||
WeakAuras.Add(data);
|
||||
OptionsPrivate.ResetMoverSizer();
|
||||
end
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
-- Create region options table
|
||||
local function createOptions(id, data)
|
||||
-- Region options
|
||||
local options = {
|
||||
__title = L["Group Settings"],
|
||||
__order = 1,
|
||||
groupIcon = {
|
||||
type = "input",
|
||||
width = WeakAuras.doubleWidth - 0.15,
|
||||
name = L["Group Icon"],
|
||||
desc = L["Set Thumbnail Icon"],
|
||||
order = 0.50,
|
||||
get = function()
|
||||
return data.groupIcon and tostring(data.groupIcon) or ""
|
||||
end,
|
||||
set = function(info, v)
|
||||
data.groupIcon = v
|
||||
WeakAuras.Add(data)
|
||||
WeakAuras.UpdateThumbnail(data)
|
||||
end
|
||||
},
|
||||
chooseIcon = {
|
||||
type = "execute",
|
||||
width = 0.15,
|
||||
name = L["Choose"],
|
||||
order = 0.51,
|
||||
func = function()
|
||||
OptionsPrivate.OpenIconPicker(data, { [data.id] = {"groupIcon"} }, true)
|
||||
end,
|
||||
imageWidth = 24,
|
||||
imageHeight = 24,
|
||||
control = "WeakAurasIcon",
|
||||
image = "Interface\\AddOns\\WeakAuras\\Media\\Textures\\browse",
|
||||
},
|
||||
-- Alignment/Distribute options are added below
|
||||
scale = {
|
||||
type = "range",
|
||||
width = WeakAuras.normalWidth,
|
||||
@@ -581,8 +587,33 @@ local function createOptions(id, data)
|
||||
},
|
||||
};
|
||||
|
||||
for k, v in pairs(OptionsPrivate.commonOptions.BorderOptions(id, data, nil, nil, 70)) do
|
||||
options[k] = v
|
||||
local hasSubGroups = false
|
||||
local hasDynamicSubGroup = false
|
||||
for index, childId in pairs(data.controlledChildren) do
|
||||
local childData = WeakAuras.GetData(childId);
|
||||
if childData.controlledChildren then
|
||||
hasSubGroups = true
|
||||
end
|
||||
if childData.regionType == "dynamicgroup" then
|
||||
hasDynamicSubGroup = true
|
||||
end
|
||||
|
||||
if hasSubGroups and hasDynamicSubGroup then
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if not hasSubGroups then
|
||||
for k, v in pairs(createDistributeAlignOptions(id, data)) do
|
||||
options[k] = v
|
||||
end
|
||||
end
|
||||
|
||||
if not hasDynamicSubGroup then
|
||||
for k, v in pairs(OptionsPrivate.commonOptions.BorderOptions(id, data, nil, nil, 70)) do
|
||||
options[k] = v
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user