from retail

This commit is contained in:
Bunny67
2022-05-19 22:04:17 +03:00
parent 9465daedd8
commit e7e789686a
86 changed files with 9118 additions and 5486 deletions
+67 -36
View File
@@ -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 {