Refactor progress handling
probably some regressions
This commit is contained in:
@@ -91,21 +91,21 @@ local function createOptions(id, data)
|
||||
width = WeakAuras.normalWidth,
|
||||
name = L["Bar Color"],
|
||||
hasAlpha = true,
|
||||
order = 39.1
|
||||
order = 39.3
|
||||
},
|
||||
backgroundColor = {
|
||||
type = "color",
|
||||
width = WeakAuras.normalWidth,
|
||||
name = L["Background Color"],
|
||||
hasAlpha = true,
|
||||
order = 39.2
|
||||
order = 39.5
|
||||
},
|
||||
alpha = {
|
||||
type = "range",
|
||||
control = "WeakAurasSpinBox",
|
||||
width = WeakAuras.normalWidth,
|
||||
name = L["Bar Alpha"],
|
||||
order = 39.3,
|
||||
order = 39.6,
|
||||
min = 0,
|
||||
max = 1,
|
||||
bigStep = 0.01,
|
||||
@@ -157,7 +157,7 @@ local function createOptions(id, data)
|
||||
displayIcon = {
|
||||
type = "input",
|
||||
width = WeakAuras.normalWidth - 0.15,
|
||||
name = L["Fallback"],
|
||||
name = L["Manual"],
|
||||
disabled = function() return not data.icon end,
|
||||
order = 40.5,
|
||||
get = function()
|
||||
@@ -385,8 +385,6 @@ local function createOptions(id, data)
|
||||
},
|
||||
};
|
||||
|
||||
options = OptionsPrivate.Private.regionPrototype.AddAdjustedDurationOptions(options, data, 36.5);
|
||||
|
||||
local overlayInfo = OptionsPrivate.Private.GetOverlayInfo(data);
|
||||
if (overlayInfo and next(overlayInfo)) then
|
||||
options["overlayheader"] = {
|
||||
@@ -450,6 +448,7 @@ local function createOptions(id, data)
|
||||
|
||||
return {
|
||||
aurabar = options,
|
||||
progressOptions = OptionsPrivate.commonOptions.ProgressOptions(data),
|
||||
position = OptionsPrivate.commonOptions.PositionOptions(id, data),
|
||||
};
|
||||
end
|
||||
|
||||
@@ -36,7 +36,7 @@ local function createOptions(id, data)
|
||||
displayIcon = {
|
||||
type = "input",
|
||||
width = WeakAuras.normalWidth - 0.15,
|
||||
name = L["Fallback Icon"],
|
||||
name = L["Manual Icon"],
|
||||
order = 4,
|
||||
get = function()
|
||||
return data.displayIcon and tostring(data.displayIcon) or "";
|
||||
@@ -230,8 +230,7 @@ local function createOptions(id, data)
|
||||
name = L["Enable Swipe"],
|
||||
order = 11.1,
|
||||
desc = L["Enable the \"Swipe\" radial overlay"],
|
||||
disabled = function() return not OptionsPrivate.Private.CanHaveDuration(data); end,
|
||||
get = function() return OptionsPrivate.Private.CanHaveDuration(data) and data.cooldown; end
|
||||
get = function() return data.cooldown; end
|
||||
},
|
||||
inverse = {
|
||||
type = "toggle",
|
||||
@@ -239,8 +238,7 @@ local function createOptions(id, data)
|
||||
name = L["Inverse"],
|
||||
order = 11.2,
|
||||
desc = L["Invert the direction of progress"],
|
||||
disabled = function() return not (OptionsPrivate.Private.CanHaveDuration(data) and data.cooldown); end,
|
||||
get = function() return data.inverse and OptionsPrivate.Private.CanHaveDuration(data) and data.cooldown; end,
|
||||
get = function() return data.inverse and data.cooldown; end,
|
||||
hidden = function() return not data.cooldown end
|
||||
},
|
||||
cooldownEdge = {
|
||||
@@ -249,7 +247,6 @@ local function createOptions(id, data)
|
||||
name = L["Show \"Edge\""],
|
||||
order = 11.4,
|
||||
desc = "|TInterface\\AddOns\\WeakAuras\\Media\\Textures\\edge-example:30|t\n"..L["Enable \"Edge\" part of the overlay"],
|
||||
disabled = function() return not OptionsPrivate.Private.CanHaveDuration(data) end,
|
||||
hidden = function() return not data.cooldown end,
|
||||
},
|
||||
endHeader = {
|
||||
@@ -276,6 +273,7 @@ local function createOptions(id, data)
|
||||
|
||||
return {
|
||||
icon = options,
|
||||
progressOptions = OptionsPrivate.commonOptions.ProgressOptions(data),
|
||||
position = OptionsPrivate.commonOptions.PositionOptions(id, data),
|
||||
};
|
||||
end
|
||||
|
||||
@@ -277,18 +277,12 @@ local function createOptions(id, data)
|
||||
hidden = function() return not data.slanted or data.orientation == "CLOCKWISE" or data.orientation == "ANTICLOCKWISE" end,
|
||||
values = OptionsPrivate.Private.slant_mode
|
||||
},
|
||||
spacer = {
|
||||
type = "header",
|
||||
name = "",
|
||||
order = 56
|
||||
},
|
||||
endHeader = {
|
||||
type = "header",
|
||||
order = 100,
|
||||
name = "",
|
||||
},
|
||||
};
|
||||
options = OptionsPrivate.Private.regionPrototype.AddAdjustedDurationOptions(options, data, 57);
|
||||
|
||||
local overlayInfo = OptionsPrivate.Private.GetOverlayInfo(data);
|
||||
if (overlayInfo and next(overlayInfo)) then
|
||||
@@ -332,6 +326,7 @@ local function createOptions(id, data)
|
||||
|
||||
return {
|
||||
progresstexture = options,
|
||||
progressOptions = OptionsPrivate.commonOptions.ProgressOptions(data),
|
||||
position = OptionsPrivate.commonOptions.PositionOptions(id, data),
|
||||
};
|
||||
end
|
||||
|
||||
@@ -288,7 +288,7 @@ local function createOptions(id, data)
|
||||
name = L["Animation Start"],
|
||||
min = 0,
|
||||
max = 1,
|
||||
--bigStep = 0.01,
|
||||
bigStep = 0.01,
|
||||
order = 13,
|
||||
isPercent = true
|
||||
},
|
||||
@@ -299,7 +299,7 @@ local function createOptions(id, data)
|
||||
name = L["Animation End"],
|
||||
min = 0,
|
||||
max = 1,
|
||||
--bigStep = 0.01,
|
||||
bigStep = 0.01,
|
||||
order = 14,
|
||||
isPercent = true
|
||||
},
|
||||
@@ -534,17 +534,11 @@ local function createOptions(id, data)
|
||||
}
|
||||
};
|
||||
|
||||
if OptionsPrivate.commonOptions then
|
||||
return {
|
||||
stopmotion = options,
|
||||
position = OptionsPrivate.commonOptions.PositionOptions(id, data, 2),
|
||||
};
|
||||
else
|
||||
return {
|
||||
stopmotion = options,
|
||||
position = WeakAuras.PositionOptions(id, data, 2),
|
||||
};
|
||||
end
|
||||
return {
|
||||
stopmotion = options,
|
||||
progressOptions = OptionsPrivate.commonOptions.ProgressOptions(data),
|
||||
position = OptionsPrivate.commonOptions.PositionOptions(id, data, 2),
|
||||
}
|
||||
end
|
||||
|
||||
local function createThumbnail()
|
||||
|
||||
Reference in New Issue
Block a user