beta
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -80,7 +80,7 @@ local function createOptions(id, data)
|
||||
__order = 1,
|
||||
groupIcon = {
|
||||
type = "input",
|
||||
width = WeakAuras.normalWidth,
|
||||
width = WeakAuras.doubleWidth - 0.15,
|
||||
name = L["Group Icon"],
|
||||
desc = L["Set Thumbnail Icon"],
|
||||
order = 0.5,
|
||||
@@ -95,10 +95,16 @@ local function createOptions(id, data)
|
||||
},
|
||||
chooseIcon = {
|
||||
type = "execute",
|
||||
width = WeakAuras.normalWidth,
|
||||
width = 0.15,
|
||||
name = L["Choose"],
|
||||
order = 0.51,
|
||||
func = function() OptionsPrivate.OpenIconPicker(data, "groupIcon", true) end
|
||||
func = function()
|
||||
OptionsPrivate.OpenIconPicker(data, { [data.id] = {"groupIcon"} }, true)
|
||||
end,
|
||||
imageWidth = 24,
|
||||
imageHeight = 24,
|
||||
control = "WeakAurasIcon",
|
||||
image = "Interface\\AddOns\\WeakAuras\\Media\\Textures\\browse",
|
||||
},
|
||||
-- grow options
|
||||
grow = {
|
||||
@@ -109,11 +115,15 @@ local function createOptions(id, data)
|
||||
values = OptionsPrivate.Private.grow_types,
|
||||
set = function(info, v)
|
||||
data.grow = v
|
||||
local selfPoint = selfPoints[data.grow] or selfPoints.default
|
||||
if type(selfPoint) == "function" then
|
||||
selfPoint = selfPoint(data)
|
||||
if v == "GRID" then
|
||||
data.selfPoint = gridSelfPoints[data.gridType]
|
||||
else
|
||||
local selfPoint = selfPoints[data.grow] or selfPoints.default
|
||||
if type(selfPoint) == "function" then
|
||||
selfPoint = selfPoint(data)
|
||||
end
|
||||
data.selfPoint = selfPoint
|
||||
end
|
||||
data.selfPoint = selfPoint
|
||||
WeakAuras.Add(data)
|
||||
WeakAuras.ClearAndUpdateOptions(data.id)
|
||||
OptionsPrivate.ResetMoverSizer()
|
||||
@@ -420,11 +430,11 @@ local function createOptions(id, data)
|
||||
};
|
||||
|
||||
OptionsPrivate.commonOptions.AddCodeOption(options, data, L["Custom Grow"], "custom_grow", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#grow",
|
||||
2, function() return data.grow ~= "CUSTOM" end, {"customGrow"}, nil, nil, nil, nil, nil, true)
|
||||
2, function() return data.grow ~= "CUSTOM" end, {"customGrow"}, false, { setOnParent = true })
|
||||
OptionsPrivate.commonOptions.AddCodeOption(options, data, L["Custom Sort"], "custom_sort", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#custom-sort",
|
||||
21, function() return data.sort ~= "custom" end, {"customSort"}, nil, nil, nil, nil, nil, true)
|
||||
21, function() return data.sort ~= "custom" end, {"customSort"}, false, { setOnParent = true })
|
||||
OptionsPrivate.commonOptions.AddCodeOption(options, data, L["Custom Anchor"], "custom_anchor_per_unit", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#group-by-frame",
|
||||
1.7, function() return not(data.grow ~= "CUSTOM" and data.useAnchorPerUnit and data.anchorPerUnit == "CUSTOM") end, {"customAnchorPerUnit"}, nil, nil, nil, nil, nil, true)
|
||||
1.7, function() return not(data.grow ~= "CUSTOM" and data.useAnchorPerUnit and data.anchorPerUnit == "CUSTOM") end, {"customAnchorPerUnit"}, false, { setOnParent = true })
|
||||
|
||||
local borderHideFunc = function() return data.useAnchorPerUnit or data.grow == "CUSTOM" end
|
||||
local disableSelfPoint = function() return data.grow ~= "CUSTOM" and data.grow ~= "GRID" and not data.useAnchorPerUnit end
|
||||
|
||||
@@ -62,7 +62,7 @@ local function createOptions(id, data)
|
||||
__order = 1,
|
||||
groupIcon = {
|
||||
type = "input",
|
||||
width = WeakAuras.normalWidth,
|
||||
width = WeakAuras.doubleWidth - 0.15,
|
||||
name = L["Group Icon"],
|
||||
desc = L["Set Thumbnail Icon"],
|
||||
order = 0.50,
|
||||
@@ -77,10 +77,16 @@ local function createOptions(id, data)
|
||||
},
|
||||
chooseIcon = {
|
||||
type = "execute",
|
||||
width = WeakAuras.normalWidth,
|
||||
width = 0.15,
|
||||
name = L["Choose"],
|
||||
order = 0.51,
|
||||
func = function() OptionsPrivate.OpenIconPicker(data, "groupIcon", true) end
|
||||
func = function()
|
||||
OptionsPrivate.OpenIconPicker(data, { [data.id] = {"groupIcon"} }, true)
|
||||
end,
|
||||
imageWidth = 24,
|
||||
imageHeight = 24,
|
||||
control = "WeakAurasIcon",
|
||||
image = "Interface\\AddOns\\WeakAuras\\Media\\Textures\\browse",
|
||||
},
|
||||
align_h = {
|
||||
type = "select",
|
||||
|
||||
@@ -20,20 +20,24 @@ local function createOptions(id, data)
|
||||
hasAlpha = true,
|
||||
order = 1
|
||||
},
|
||||
auto = {
|
||||
desaturate = {
|
||||
type = "toggle",
|
||||
width = WeakAuras.normalWidth,
|
||||
name = L["Automatic Icon"],
|
||||
name = L["Desaturate"],
|
||||
order = 2,
|
||||
disabled = function() return not OptionsPrivate.Private.CanHaveAuto(data); end,
|
||||
get = function() return OptionsPrivate.Private.CanHaveAuto(data) and data.auto; end
|
||||
},
|
||||
iconSource = {
|
||||
type = "select",
|
||||
width = WeakAuras.normalWidth,
|
||||
name = L["Icon Source"],
|
||||
order = 3,
|
||||
values = OptionsPrivate.Private.IconSources(data)
|
||||
},
|
||||
displayIcon = {
|
||||
type = "input",
|
||||
width = WeakAuras.normalWidth,
|
||||
name = L["Display Icon"],
|
||||
hidden = function() return OptionsPrivate.Private.CanHaveAuto(data) and data.auto; end,
|
||||
order = 3,
|
||||
width = WeakAuras.normalWidth - 0.15,
|
||||
name = L["Fallback Icon"],
|
||||
order = 4,
|
||||
get = function()
|
||||
return data.displayIcon and tostring(data.displayIcon) or "";
|
||||
end,
|
||||
@@ -45,17 +49,25 @@ local function createOptions(id, data)
|
||||
},
|
||||
chooseIcon = {
|
||||
type = "execute",
|
||||
width = WeakAuras.normalWidth,
|
||||
width = 0.15,
|
||||
name = L["Choose"],
|
||||
hidden = function() return OptionsPrivate.Private.CanHaveAuto(data) and data.auto; end,
|
||||
order = 4,
|
||||
func = function() OptionsPrivate.OpenIconPicker(data, "displayIcon"); end
|
||||
},
|
||||
desaturate = {
|
||||
type = "toggle",
|
||||
width = WeakAuras.normalWidth,
|
||||
name = L["Desaturate"],
|
||||
order = 5,
|
||||
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",
|
||||
},
|
||||
useTooltip = {
|
||||
type = "toggle",
|
||||
@@ -236,7 +248,7 @@ local function modifyThumbnail(parent, frame, data)
|
||||
end
|
||||
|
||||
if data then
|
||||
local name, icon = OptionsPrivate.Private.GetNameAndIcon(data);
|
||||
local name, icon = WeakAuras.GetNameAndIcon(data);
|
||||
frame:SetIcon(icon)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -17,23 +17,19 @@ local function createOptions(id, data)
|
||||
-- Option for modelIsDisplayInfo added below
|
||||
|
||||
-- Option for path/id added below
|
||||
space2 = {
|
||||
type = "execute",
|
||||
width = WeakAuras.normalWidth,
|
||||
name = "",
|
||||
order = 1.5,
|
||||
image = function() return "", 0, 0 end,
|
||||
hidden = function() return data.modelIsUnit end
|
||||
},
|
||||
chooseModel = {
|
||||
type = "execute",
|
||||
width = WeakAuras.normalWidth,
|
||||
width = 0.15,
|
||||
name = L["Choose"],
|
||||
order = 2,
|
||||
func = function()
|
||||
OptionsPrivate.OpenModelPicker(data);
|
||||
OptionsPrivate.OpenModelPicker(data, {});
|
||||
end,
|
||||
hidden = function() return data.modelIsUnit end
|
||||
disabled = function() return data.modelIsUnit end,
|
||||
imageWidth = 24,
|
||||
imageHeight = 24,
|
||||
control = "WeakAurasIcon",
|
||||
image = "Interface\\AddOns\\WeakAuras\\Media\\Textures\\browse",
|
||||
},
|
||||
advance = {
|
||||
type = "toggle",
|
||||
|
||||
@@ -44,32 +44,80 @@ local function setTextureFunc(textureWidget, texturePath, textureName)
|
||||
end
|
||||
end
|
||||
|
||||
local function textureNameHasData(textureName)
|
||||
local pattern = "%.x(%d+)y(%d+)f(%d+)%.[tb][gl][ap]"
|
||||
local rows, columns, frames = textureName:lower():match(pattern)
|
||||
return rows and columns and frames
|
||||
end
|
||||
|
||||
local function createOptions(id, data)
|
||||
local options = {
|
||||
__title = L["Stop Motion Settings"],
|
||||
__order = 1,
|
||||
foregroundTexture = {
|
||||
type = "input",
|
||||
width = WeakAuras.normalWidth,
|
||||
width = WeakAuras.normalWidth - 0.15,
|
||||
name = L["Texture"],
|
||||
order = 1,
|
||||
},
|
||||
chooseForegroundTexture = {
|
||||
type = "execute",
|
||||
width = 0.15,
|
||||
name = L["Choose"],
|
||||
order = 2,
|
||||
func = function()
|
||||
OptionsPrivate.OpenTexturePicker(data, {}, {
|
||||
texture = "foregroundTexture",
|
||||
color = "foregroundColor",
|
||||
rotation = "rotation",
|
||||
mirror = "mirror",
|
||||
blendMode = "blendMode"
|
||||
}, texture_types, setTextureFunc);
|
||||
end,
|
||||
imageWidth = 24,
|
||||
imageHeight = 24,
|
||||
control = "WeakAurasIcon",
|
||||
image = "Interface\\AddOns\\WeakAuras\\Media\\Textures\\browse",
|
||||
},
|
||||
backgroundTexture = {
|
||||
type = "input",
|
||||
width = WeakAuras.normalWidth,
|
||||
width = WeakAuras.normalWidth - 0.15,
|
||||
name = L["Background Texture"],
|
||||
order = 5,
|
||||
disabled = function() return data.sameTexture or data.hideBackground end,
|
||||
get = function() return data.sameTexture and data.foregroundTexture or data.backgroundTexture; end,
|
||||
},
|
||||
chooseForegroundTexture = {
|
||||
chooseBackgroundTexture = {
|
||||
type = "execute",
|
||||
width = WeakAuras.normalWidth,
|
||||
width = 0.15,
|
||||
name = L["Choose"],
|
||||
order = 12,
|
||||
order = 6,
|
||||
func = function()
|
||||
OptionsPrivate.OpenTexturePicker(data, data, "foregroundTexture", texture_types, setTextureFunc);
|
||||
end
|
||||
OptionsPrivate.OpenTexturePicker(data, {}, {
|
||||
texture = "backgroundTexture",
|
||||
color = "backgroundColor",
|
||||
rotation = "rotation",
|
||||
mirror = "mirror",
|
||||
blendMode = "blendMode"
|
||||
}, texture_types, setTextureFunc);
|
||||
end,
|
||||
disabled = function() return data.sameTexture or data.hideBackground; end,
|
||||
imageWidth = 24,
|
||||
imageHeight = 24,
|
||||
control = "WeakAurasIcon",
|
||||
image = "Interface\\AddOns\\WeakAuras\\Media\\Textures\\browse",
|
||||
},
|
||||
sameTextureSpace = {
|
||||
type = "description",
|
||||
width = WeakAuras.normalWidth,
|
||||
name = "",
|
||||
order = 13,
|
||||
},
|
||||
hideBackground = {
|
||||
type = "toggle",
|
||||
name = L["Hide"],
|
||||
order = 14,
|
||||
width = WeakAuras.halfWidth,
|
||||
},
|
||||
sameTexture = {
|
||||
type = "toggle",
|
||||
@@ -78,16 +126,6 @@ local function createOptions(id, data)
|
||||
order = 15,
|
||||
disabled = function() return data.hideBackground; end
|
||||
},
|
||||
chooseBackgroundTexture = {
|
||||
type = "execute",
|
||||
width = WeakAuras.halfWidth,
|
||||
name = L["Choose"],
|
||||
order = 17,
|
||||
func = function()
|
||||
WeakAuras.OpenTexturePick(data, data, "backgroundTexture", texture_types, setTextureFunc);
|
||||
end,
|
||||
disabled = function() return data.sameTexture or data.hideBackground; end
|
||||
},
|
||||
desaturateForeground = {
|
||||
type = "toggle",
|
||||
width = WeakAuras.normalWidth,
|
||||
@@ -98,21 +136,15 @@ local function createOptions(id, data)
|
||||
type = "toggle",
|
||||
name = L["Desaturate"],
|
||||
order = 17.6,
|
||||
width = WeakAuras.halfWidth,
|
||||
width = WeakAuras.normalWidth,
|
||||
disabled = function() return data.hideBackground; end
|
||||
},
|
||||
hideBackground = {
|
||||
type = "toggle",
|
||||
name = L["Hide"],
|
||||
order = 17.65,
|
||||
width = WeakAuras.halfWidth,
|
||||
},
|
||||
-- Foreground options for custom textures
|
||||
customForegroundHeader = {
|
||||
type = "header",
|
||||
name = L["Custom Foreground"],
|
||||
order = 17.70,
|
||||
hidden = function() return texture_data[data.foregroundTexture] end
|
||||
hidden = function() return texture_data[data.foregroundTexture] or textureNameHasData(data.foregroundTexture) end
|
||||
},
|
||||
customForegroundRows = {
|
||||
type = "range",
|
||||
@@ -121,7 +153,7 @@ local function createOptions(id, data)
|
||||
min = 1,
|
||||
max = 64,
|
||||
order = 17.71,
|
||||
hidden = function() return texture_data[data.foregroundTexture] end
|
||||
hidden = function() return texture_data[data.foregroundTexture] or textureNameHasData(data.foregroundTexture) end
|
||||
},
|
||||
customForegroundColumns = {
|
||||
type = "range",
|
||||
@@ -130,7 +162,7 @@ local function createOptions(id, data)
|
||||
min = 1,
|
||||
max = 64,
|
||||
order = 17.72,
|
||||
hidden = function() return texture_data[data.foregroundTexture] end
|
||||
hidden = function() return texture_data[data.foregroundTexture] or textureNameHasData(data.foregroundTexture) end
|
||||
},
|
||||
customForegroundFrames = {
|
||||
type = "range",
|
||||
@@ -140,7 +172,7 @@ local function createOptions(id, data)
|
||||
max = 4096,
|
||||
--bigStep = 0.01,
|
||||
order = 17.73,
|
||||
hidden = function() return texture_data[data.foregroundTexture] end
|
||||
hidden = function() return texture_data[data.foregroundTexture] or textureNameHasData(data.foregroundTexture) end
|
||||
},
|
||||
customForegroundSpace = {
|
||||
type = "execute",
|
||||
@@ -148,14 +180,14 @@ local function createOptions(id, data)
|
||||
name = "",
|
||||
order = 17.74,
|
||||
image = function() return "", 0, 0 end,
|
||||
hidden = function() return texture_data[data.foregroundTexture] end
|
||||
hidden = function() return texture_data[data.foregroundTexture] or textureNameHasData(data.foregroundTexture) end
|
||||
},
|
||||
-- Background options for custom textures
|
||||
customBackgroundHeader = {
|
||||
type = "header",
|
||||
name = L["Custom Background"],
|
||||
order = 18.00,
|
||||
hidden = function() return data.sameTexture or texture_data[data.backgroundTexture]
|
||||
hidden = function() return data.sameTexture or texture_data[data.backgroundTexture] or textureNameHasData(data.backgroundTexture)
|
||||
or data.hideBackground end
|
||||
},
|
||||
customBackgroundRows = {
|
||||
@@ -165,7 +197,7 @@ local function createOptions(id, data)
|
||||
min = 1,
|
||||
max = 64,
|
||||
order = 18.01,
|
||||
hidden = function() return data.sameTexture or texture_data[data.backgroundTexture]
|
||||
hidden = function() return data.sameTexture or texture_data[data.backgroundTexture] or textureNameHasData(data.backgroundTexture)
|
||||
or data.hideBackground end
|
||||
},
|
||||
customBackgroundColumns = {
|
||||
@@ -175,7 +207,7 @@ local function createOptions(id, data)
|
||||
min = 1,
|
||||
max = 64,
|
||||
order = 18.02,
|
||||
hidden = function() return data.sameTexture or texture_data[data.backgroundTexture]
|
||||
hidden = function() return data.sameTexture or texture_data[data.backgroundTexture] or textureNameHasData(data.backgroundTexture)
|
||||
or data.hideBackground end
|
||||
},
|
||||
customBackgroundFrames = {
|
||||
@@ -186,7 +218,7 @@ local function createOptions(id, data)
|
||||
max = 4096,
|
||||
step = 1,
|
||||
order = 18.03,
|
||||
hidden = function() return data.sameTexture or texture_data[data.backgroundTexture]
|
||||
hidden = function() return data.sameTexture or texture_data[data.backgroundTexture] or textureNameHasData(data.backgroundTexture)
|
||||
or data.hideBackground end
|
||||
},
|
||||
customBackgroundSpace = {
|
||||
@@ -195,7 +227,7 @@ local function createOptions(id, data)
|
||||
name = "",
|
||||
order = 18.04,
|
||||
image = function() return "", 0, 0 end,
|
||||
hidden = function() return data.sameTexture or texture_data[data.backgroundTexture]
|
||||
hidden = function() return data.sameTexture or texture_data[data.backgroundTexture] or textureNameHasData(data.backgroundTexture)
|
||||
or data.hideBackground end
|
||||
},
|
||||
blendMode = {
|
||||
@@ -338,11 +370,21 @@ local function modifyThumbnail(parent, region, data, fullModify, size)
|
||||
region.foregroundRows = tdata.rows;
|
||||
region.foregroundColumns = tdata.columns;
|
||||
else
|
||||
local lastFrame = data.customForegroundFrames - 1;
|
||||
region.startFrame = floor( (data.startPercent or 0) * lastFrame) + 1;
|
||||
region.endFrame = floor( (data.endPercent or 1) * lastFrame) + 1;
|
||||
region.foregroundRows = data.customForegroundRows;
|
||||
region.foregroundColumns = data.customForegroundColumns;
|
||||
local pattern = "%.x(%d+)y(%d+)f(%d+)%.[tb][gl][ap]"
|
||||
local rows, columns, frames = data.foregroundTexture:lower():match(pattern)
|
||||
if rows and columns and frames then
|
||||
local lastFrame = frames - 1;
|
||||
region.startFrame = floor( (data.startPercent or 0) * lastFrame) + 1;
|
||||
region.endFrame = floor( (data.endPercent or 1) * lastFrame) + 1;
|
||||
region.foregroundRows = rows;
|
||||
region.foregroundColumns = columns;
|
||||
else
|
||||
local lastFrame = data.customForegroundFrames - 1;
|
||||
region.startFrame = floor( (data.startPercent or 0) * lastFrame) + 1;
|
||||
region.endFrame = floor( (data.endPercent or 1) * lastFrame) + 1;
|
||||
region.foregroundRows = data.customForegroundRows;
|
||||
region.foregroundColumns = data.customForegroundColumns;
|
||||
end
|
||||
end
|
||||
|
||||
if (region.startFrame and region.endFrame) then
|
||||
|
||||
@@ -9,10 +9,31 @@ local function createOptions(id, data)
|
||||
__order = 1,
|
||||
texture = {
|
||||
type = "input",
|
||||
width = WeakAuras.doubleWidth,
|
||||
width = WeakAuras.doubleWidth - 0.15,
|
||||
name = L["Texture"],
|
||||
order = 1
|
||||
},
|
||||
chooseTexture = {
|
||||
type = "execute",
|
||||
name = L["Choose"],
|
||||
width = 0.15,
|
||||
order = 1.1,
|
||||
func = function()
|
||||
OptionsPrivate.OpenTexturePicker(data, {}, {
|
||||
texture = "texture",
|
||||
color = "color",
|
||||
rotate = "rotate",
|
||||
discrete_rotation = "discrete_rotation",
|
||||
rotation = "rotation",
|
||||
mirror = "mirror",
|
||||
blendMode = "blendMode"
|
||||
}, OptionsPrivate.Private.texture_types);
|
||||
end,
|
||||
imageWidth = 24,
|
||||
imageHeight = 24,
|
||||
control = "WeakAurasIcon",
|
||||
image = "Interface\\AddOns\\WeakAuras\\Media\\Textures\\browse",
|
||||
},
|
||||
desaturate = {
|
||||
type = "toggle",
|
||||
width = WeakAuras.normalWidth,
|
||||
@@ -22,19 +43,10 @@ local function createOptions(id, data)
|
||||
space2 = {
|
||||
type = "execute",
|
||||
name = "",
|
||||
width = WeakAuras.halfWidth,
|
||||
width = WeakAuras.normalWidth,
|
||||
order = 5,
|
||||
image = function() return "", 0, 0 end,
|
||||
},
|
||||
chooseTexture = {
|
||||
type = "execute",
|
||||
name = L["Choose"],
|
||||
width = WeakAuras.halfWidth,
|
||||
order = 7,
|
||||
func = function()
|
||||
OptionsPrivate.OpenTexturePicker(data, data, "texture", OptionsPrivate.Private.texture_types);
|
||||
end
|
||||
},
|
||||
color = {
|
||||
type = "color",
|
||||
width = WeakAuras.normalWidth,
|
||||
|
||||
Reference in New Issue
Block a user