This commit is contained in:
Bunny67
2020-11-15 23:43:10 +03:00
parent ca4a2660ec
commit 7cbc40c959
70 changed files with 7175 additions and 3055 deletions
+100 -77
View File
@@ -114,48 +114,13 @@ local function createOptions(id, data)
name = L["Show Icon"],
order = 40.2,
},
auto = {
type = "toggle",
width = WeakAuras.normalWidth,
name = L["Auto"],
desc = L["Choose whether the displayed icon is automatic or defined manually"],
order = 40.3,
disabled = function() return not OptionsPrivate.Private.CanHaveAuto(data); end,
get = function() return OptionsPrivate.Private.CanHaveAuto(data) and data.auto end,
hidden = function() return not data.icon end,
},
displayIcon = {
type = "input",
width = WeakAuras.normalWidth,
name = L["Display Icon"],
hidden = function() return OptionsPrivate.Private.CanHaveAuto(data) and data.auto or not data.icon; end,
disabled = function() return not data.icon end,
order = 40.4,
get = function()
return data.displayIcon and tostring(data.displayIcon) or "";
end,
set = function(info, v)
data.displayIcon = v;
WeakAuras.Add(data);
WeakAuras.UpdateThumbnail(data);
end
},
chooseIcon = {
type = "execute",
width = WeakAuras.normalWidth,
name = L["Choose"],
hidden = function() return OptionsPrivate.Private.CanHaveAuto(data) and data.auto or not data.icon; end,
disabled = function() return not data.icon end,
order = 40.5,
func = function() OptionsPrivate.OpenIconPicker(data, "displayIcon"); end
},
icon_side = {
type = "select",
width = WeakAuras.normalWidth,
name = L["Icon Position"],
values = OptionsPrivate.Private.icon_side_types,
hidden = function() return data.orientation:find("VERTICAL") or not data.icon end,
order = 40.6,
order = 40.3,
},
icon_side2 = {
type = "select",
@@ -163,7 +128,7 @@ local function createOptions(id, data)
name = L["Icon Position"],
values = OptionsPrivate.Private.rotated_icon_side_types,
hidden = function() return data.orientation:find("HORIZONTAL") or not data.icon end,
order = 40.7,
order = 40.3,
get = function()
return data.icon_side;
end,
@@ -173,6 +138,54 @@ local function createOptions(id, data)
WeakAuras.UpdateThumbnail(data);
end
},
iconSource = {
type = "select",
width = WeakAuras.normalWidth,
name = L["Source"],
order = 40.4,
values = OptionsPrivate.Private.IconSources(data),
hidden = function() return not data.icon end,
},
displayIcon = {
type = "input",
width = WeakAuras.normalWidth - 0.15,
name = L["Fallback"],
disabled = function() return not data.icon end,
order = 40.5,
get = function()
return data.displayIcon and tostring(data.displayIcon) or "";
end,
set = function(info, v)
data.displayIcon = v;
WeakAuras.Add(data);
WeakAuras.UpdateThumbnail(data);
end,
hidden = function() return not data.icon end,
},
chooseIcon = {
type = "execute",
width = 0.15,
name = L["Choose"],
disabled = function() return not data.icon end,
order = 40.6,
func = function()
local path = {"displayIcon"}
local paths = {}
if data.controlledChildren then
for i, childId in pairs(data.controlledChildren) do
paths[childId] = path
end
else
paths[data.id] = path
end
OptionsPrivate.OpenIconPicker(data, paths)
end,
imageWidth = 24,
imageHeight = 24,
control = "WeakAurasIcon",
image = "Interface\\AddOns\\WeakAuras\\Media\\Textures\\browse",
hidden = function() return not data.icon end,
},
desaturate = {
type = "toggle",
width = WeakAuras.normalWidth,
@@ -214,37 +227,47 @@ local function createOptions(id, data)
type = "input",
name = L["Spark Texture"],
order = 44,
width = WeakAuras.doubleWidth,
disabled = function() return not data.spark end,
hidden = function() return not data.spark end,
},
sparkDesaturate = {
type = "toggle",
width = WeakAuras.normalWidth,
name = L["Desaturate"],
order = 44.1,
disabled = function() return not data.spark end,
hidden = function() return not data.spark end,
},
spaceSpark = {
type = "execute",
name = "",
width = WeakAuras.halfWidth,
order = 44.2,
image = function() return "", 0, 0 end,
width = WeakAuras.doubleWidth - 0.15,
disabled = function() return not data.spark end,
hidden = function() return not data.spark end,
},
sparkChooseTexture = {
type = "execute",
name = L["Choose"],
width = WeakAuras.halfWidth,
order = 44.3,
width = 0.15,
order = 44.1,
func = function()
OptionsPrivate.OpenTexturePicker(data, data, "sparkTexture", OptionsPrivate.Private.texture_types);
OptionsPrivate.OpenTexturePicker(data, {}, {
texture = "sparkTexture",
color = "sparkColor",
rotation = "sparkRotation",
mirror = "sparkMirror",
blendMode = "sparkBlendMode"
}, OptionsPrivate.Private.texture_types)
end,
disabled = function() return not data.spark end,
hidden = function() return not data.spark end,
imageWidth = 24,
imageHeight = 24,
control = "WeakAurasIcon",
image = "Interface\\AddOns\\WeakAuras\\Media\\Textures\\browse",
},
sparkDesaturate = {
type = "toggle",
width = WeakAuras.normalWidth,
name = L["Desaturate"],
order = 44.2,
disabled = function() return not data.spark end,
hidden = function() return not data.spark end,
},
spaceSpark = {
type = "execute",
name = "",
width = WeakAuras.normalWidth,
order = 44.3,
image = function() return "", 0, 0 end,
disabled = function() return not data.spark end,
hidden = function() return not data.spark end,
},
sparkColor = {
type = "color",
@@ -604,76 +627,76 @@ local templates = {
local anchorPoints = {
BOTTOMLEFT = {
display = { L["Bar"], L["Bottom Left"] },
display = { L["Background"], L["Bottom Left"] },
type = "point"
},
BOTTOM = {
display = { L["Bar"], L["Bottom"] },
display = { L["Background"], L["Bottom"] },
type = "point"
},
BOTTOMRIGHT = {
display = { L["Bar"], L["Bottom Right"] },
display = { L["Background"], L["Bottom Right"] },
type = "point"
},
RIGHT = {
display = { L["Bar"], L["Right"] },
display = { L["Background"], L["Right"] },
type = "point"
},
TOPRIGHT = {
display = { L["Bar"], L["Top Right"] },
display = { L["Background"], L["Top Right"] },
type = "point"
},
TOP = {
display = { L["Bar"], L["Top"] },
display = { L["Background"], L["Top"] },
type = "point"
},
TOPLEFT = {
display = { L["Bar"], L["Top Left"] },
display = { L["Background"], L["Top Left"] },
type = "point"
},
LEFT = {
display = { L["Bar"], L["Left"] },
display = { L["Background"], L["Left"] },
type = "point"
},
CENTER = {
display = { L["Bar"], L["Center"] },
display = { L["Background"], L["Center"] },
type = "point"
},
INNER_BOTTOMLEFT = {
display = { L["Bar Inner"], L["Bottom Left"] },
display = { L["Background Inner"], L["Bottom Left"] },
type = "point"
},
INNER_BOTTOM = {
display = { L["Bar Inner"], L["Bottom"] },
display = { L["Background Inner"], L["Bottom"] },
type = "point"
},
INNER_BOTTOMRIGHT = {
display = { L["Bar Inner"], L["Bottom Right"] },
display = { L["Background Inner"], L["Bottom Right"] },
type = "point"
},
INNER_RIGHT = {
display = { L["Bar Inner"], L["Right"] },
display = { L["Background Inner"], L["Right"] },
type = "point"
},
INNER_TOPRIGHT = {
display = { L["Bar Inner"], L["Top Right"] },
display = { L["Background Inner"], L["Top Right"] },
type = "point"
},
INNER_TOP = {
display = { L["Bar Inner"], L["Top"] },
display = { L["Background Inner"], L["Top"] },
type = "point"
},
INNER_TOPLEFT = {
display = { L["Bar Inner"], L["Top Left"] },
display = { L["Background Inner"], L["Top Left"] },
type = "point"
},
INNER_LEFT = {
display = { L["Bar Inner"], L["Left"] },
display = { L["Background Inner"], L["Left"] },
type = "point"
},
INNER_CENTER = {
display = { L["Bar Inner"], L["Center"] },
display = { L["Background Inner"], L["Center"] },
type = "point"
},
@@ -740,7 +763,7 @@ local function subCreateOptions(parentData, data, index, subIndex)
end,
__down = function()
if (OptionsPrivate.Private.ApplyToDataOrChildData(parentData, OptionsPrivate.MoveSubRegionDown, index, "aurabar_bar")) then
WeakAuras.ClearAndUpdateOptions(parentData.id, parentData)
WeakAuras.ClearAndUpdateOptions(parentData.id)
end
end,
__notcollapsable = true