(feature/LibGlow) add Proc Glow (#35)
This commit is contained in:
@@ -407,6 +407,40 @@ function OptionsPrivate.GetActionOptions(data)
|
||||
end,
|
||||
disabled = function() return not data.actions.start.use_glow_color end,
|
||||
},
|
||||
start_glow_startAnim = {
|
||||
type = "toggle",
|
||||
width = WeakAuras.normalWidth,
|
||||
name = L["Start Animation"],
|
||||
order = 10.801,
|
||||
get = function()
|
||||
return data.actions.start.glow_startAnim and true or false
|
||||
end,
|
||||
hidden = function()
|
||||
return not data.actions.start.do_glow
|
||||
or data.actions.start.glow_action ~= "show"
|
||||
or data.actions.start.glow_frame_type == nil
|
||||
or data.actions.start.glow_type ~= "Proc"
|
||||
end,
|
||||
},
|
||||
start_glow_duration = {
|
||||
type = "range",
|
||||
control = "WeakAurasSpinBox",
|
||||
width = WeakAuras.normalWidth,
|
||||
name = L["Duration"],
|
||||
order = 10.802,
|
||||
softMin = 0.01,
|
||||
softMax = 3,
|
||||
step = 0.05,
|
||||
get = function()
|
||||
return data.actions.start.glow_duration or 1
|
||||
end,
|
||||
hidden = function()
|
||||
return not data.actions.start.do_glow
|
||||
or data.actions.start.glow_action ~= "show"
|
||||
or data.actions.start.glow_frame_type == nil
|
||||
or data.actions.start.glow_type ~= "Proc"
|
||||
end,
|
||||
},
|
||||
start_glow_lines = {
|
||||
type = "range",
|
||||
control = "WeakAurasSpinBox",
|
||||
@@ -424,6 +458,7 @@ function OptionsPrivate.GetActionOptions(data)
|
||||
or data.actions.start.glow_action ~= "show"
|
||||
or not data.actions.start.glow_type
|
||||
or data.actions.start.glow_type == "buttonOverlay"
|
||||
or data.actions.start.glow_type == "Proc"
|
||||
or data.actions.start.glow_frame_type == nil
|
||||
end,
|
||||
},
|
||||
@@ -444,6 +479,7 @@ function OptionsPrivate.GetActionOptions(data)
|
||||
or data.actions.start.glow_action ~= "show"
|
||||
or not data.actions.start.glow_type
|
||||
or data.actions.start.glow_type == "buttonOverlay"
|
||||
or data.actions.start.glow_type == "Proc"
|
||||
or data.actions.start.glow_frame_type == nil
|
||||
end,
|
||||
},
|
||||
@@ -851,6 +887,40 @@ function OptionsPrivate.GetActionOptions(data)
|
||||
end,
|
||||
disabled = function() return not data.actions.finish.use_glow_color end,
|
||||
},
|
||||
finish_glow_startAnim = {
|
||||
type = "toggle",
|
||||
width = WeakAuras.normalWidth,
|
||||
name = L["Start Animation"],
|
||||
order = 10.801,
|
||||
get = function()
|
||||
return data.actions.finish.glow_startAnim and true or false
|
||||
end,
|
||||
hidden = function()
|
||||
return not data.actions.finish.do_glow
|
||||
or data.actions.finish.glow_action ~= "show"
|
||||
or data.actions.finish.glow_frame_type == nil
|
||||
or data.actions.finish.glow_type ~= "Proc"
|
||||
end,
|
||||
},
|
||||
finish_glow_duration = {
|
||||
type = "range",
|
||||
control = "WeakAurasSpinBox",
|
||||
width = WeakAuras.normalWidth,
|
||||
name = L["Duration"],
|
||||
order = 10.802,
|
||||
softMin = 0.01,
|
||||
softMax = 3,
|
||||
step = 0.05,
|
||||
get = function()
|
||||
return data.actions.finish.glow_duration or 1
|
||||
end,
|
||||
hidden = function()
|
||||
return not data.actions.finish.do_glow
|
||||
or data.actions.finish.glow_action ~= "show"
|
||||
or data.actions.finish.glow_frame_type == nil
|
||||
or data.actions.finish.glow_type ~= "Proc"
|
||||
end,
|
||||
},
|
||||
finish_glow_lines = {
|
||||
type = "range",
|
||||
control = "WeakAurasSpinBox",
|
||||
@@ -868,6 +938,7 @@ function OptionsPrivate.GetActionOptions(data)
|
||||
or data.actions.finish.glow_action ~= "show"
|
||||
or not data.actions.finish.glow_type
|
||||
or data.actions.finish.glow_type == "buttonOverlay"
|
||||
or data.actions.start.glow_type == "Proc"
|
||||
or data.actions.finish.glow_frame_type == nil
|
||||
end,
|
||||
},
|
||||
@@ -888,6 +959,7 @@ function OptionsPrivate.GetActionOptions(data)
|
||||
or data.actions.finish.glow_action ~= "show"
|
||||
or not data.actions.finish.glow_type
|
||||
or data.actions.finish.glow_type == "buttonOverlay"
|
||||
or data.actions.start.glow_type == "Proc"
|
||||
or data.actions.finish.glow_frame_type == nil
|
||||
end,
|
||||
},
|
||||
|
||||
@@ -1276,6 +1276,9 @@ local function addControlsForChange(args, order, data, conditionVariable, totalA
|
||||
|
||||
local glowTypesExcepButtonOverlay = CopyTable(OptionsPrivate.Private.glow_types)
|
||||
glowTypesExcepButtonOverlay["buttonOverlay"] = nil
|
||||
local glowTypesExcepButtonOverlayAndProc = CopyTable(OptionsPrivate.Private.glow_types)
|
||||
glowTypesExcepButtonOverlayAndProc["buttonOverlay"] = nil
|
||||
glowTypesExcepButtonOverlayAndProc["Proc"] = nil
|
||||
|
||||
args["condition" .. i .. "value" .. j .. "glow_action"] = {
|
||||
type = "select",
|
||||
@@ -1386,6 +1389,40 @@ local function addControlsForChange(args, order, data, conditionVariable, totalA
|
||||
disabled = function() return not anyGlowExternal("use_glow_color", true) end
|
||||
}
|
||||
order = order + 1
|
||||
args["condition" .. i .. "value" .. j .. "glow_startAnim"] = {
|
||||
type = "toggle",
|
||||
width = WeakAuras.normalWidth,
|
||||
name = blueIfNoValue2(data, conditions[i].changes[j], "value", "glow_startAnim", L["Start Animation"], L["Start Animation"]),
|
||||
desc = descIfNoValue2(data, conditions[i].changes[j], "value", "glow_startAnim", propertyType),
|
||||
order = order,
|
||||
get = function()
|
||||
return type(conditions[i].changes[j].value) == "table" and conditions[i].changes[j].value.glow_startAnim;
|
||||
end,
|
||||
set = setValueComplex("glow_startAnim"),
|
||||
hidden = function()
|
||||
return not (anyGlowExternal("glow_action", "show") and anyGlowExternal("glow_type", "Proc"))
|
||||
end
|
||||
}
|
||||
order = order + 1
|
||||
args["condition" .. i .. "value" .. j .. "glow_duration"] = {
|
||||
type = "range",
|
||||
control = "WeakAurasSpinBox",
|
||||
width = WeakAuras.normalWidth,
|
||||
name = blueIfNoValue2(data, conditions[i].changes[j], "value", "glow_duration", L["Duration"], L["Duration"]),
|
||||
desc = descIfNoValue2(data, conditions[i].changes[j], "value", "glow_duration", propertyType),
|
||||
order = order,
|
||||
softMin = 0.01,
|
||||
softMax = 3,
|
||||
step = 0.05,
|
||||
get = function()
|
||||
return type(conditions[i].changes[j].value) == "table" and conditions[i].changes[j].value.glow_duration or 1;
|
||||
end,
|
||||
set = setValueComplex("glow_duration"),
|
||||
hidden = function()
|
||||
return not (anyGlowExternal("glow_action", "show") and anyGlowExternal("glow_type", "Proc"))
|
||||
end,
|
||||
}
|
||||
order = order + 1
|
||||
args["condition" .. i .. "value" .. j .. "glow_lines"] = {
|
||||
type = "range",
|
||||
control = "WeakAurasSpinBox",
|
||||
@@ -1401,7 +1438,7 @@ local function addControlsForChange(args, order, data, conditionVariable, totalA
|
||||
end,
|
||||
set = setValueComplex("glow_lines"),
|
||||
hidden = function()
|
||||
return not (anyGlowExternal("glow_action", "show") and anyGlowExternal("glow_type", glowTypesExcepButtonOverlay))
|
||||
return not (anyGlowExternal("glow_action", "show") and anyGlowExternal("glow_type", glowTypesExcepButtonOverlayAndProc))
|
||||
end,
|
||||
}
|
||||
order = order + 1
|
||||
@@ -1420,7 +1457,7 @@ local function addControlsForChange(args, order, data, conditionVariable, totalA
|
||||
end,
|
||||
set = setValueComplex("glow_frequency"),
|
||||
hidden = function()
|
||||
return not (anyGlowExternal("glow_action", "show") and anyGlowExternal("glow_type", glowTypesExcepButtonOverlay))
|
||||
return not (anyGlowExternal("glow_action", "show") and anyGlowExternal("glow_type", glowTypesExcepButtonOverlayAndProc))
|
||||
end,
|
||||
}
|
||||
order = order + 1
|
||||
@@ -1496,7 +1533,7 @@ local function addControlsForChange(args, order, data, conditionVariable, totalA
|
||||
end,
|
||||
set = setValueComplex("glow_YOffset"),
|
||||
hidden = function()
|
||||
return not (anyGlowExternal("glow_action", "show") and anyGlowExternal("glow_type", "Pixel"))
|
||||
return not (anyGlowExternal("glow_action", "show") and anyGlowExternal("glow_type", glowTypesExcepButtonOverlay))
|
||||
end,
|
||||
}
|
||||
order = order + 1
|
||||
@@ -2830,7 +2867,7 @@ local function SubPropertiesForChange(change)
|
||||
"glow_action", "glow_frame_type", "glow_type",
|
||||
"glow_frame", "choose_glow_frame",
|
||||
"use_glow_color", "glow_color",
|
||||
"glow_lines", "glow_frequency", "glow_length", "glow_thickness", "glow_XOffset", "glow_YOffset",
|
||||
"glow_startAnim", "glow_duration", "glow_lines", "glow_frequency", "glow_length", "glow_thickness", "glow_XOffset", "glow_YOffset",
|
||||
"glow_scale", "glow_border"
|
||||
}
|
||||
elseif change.property == "chat" then
|
||||
|
||||
@@ -3,7 +3,6 @@ local AddonName = ...
|
||||
local OptionsPrivate = select(2, ...)
|
||||
|
||||
local L = WeakAuras.L;
|
||||
|
||||
local indentWidth = 0.15
|
||||
|
||||
local function createOptions(parentData, data, index, subIndex)
|
||||
@@ -35,6 +34,7 @@ local function createOptions(parentData, data, index, subIndex)
|
||||
anchor_area = {
|
||||
type = "select",
|
||||
width = WeakAuras.normalWidth,
|
||||
control = "WeakAurasTwoColumnDropdown",
|
||||
name = L["Glow Anchor"],
|
||||
order = 3,
|
||||
values = areaAnchors,
|
||||
@@ -82,6 +82,14 @@ local function createOptions(parentData, data, index, subIndex)
|
||||
if data.glowBorder then
|
||||
line = L["%s, Border"]:format(line)
|
||||
end
|
||||
elseif data.glowType == "Proc" then
|
||||
line = ("%s %s, Duration: %d"):format(line, color, data.glowDuration)
|
||||
if data.glowStartAnim then
|
||||
line = L["%s, Start Animation"]:format(line)
|
||||
end
|
||||
if data.glowXOffset ~= 0 or data.glowYOffset ~= 0 then
|
||||
line = L["%s, offset: %0.2f;%0.2f"]:format(line, data.glowXOffset, data.glowYOffset)
|
||||
end
|
||||
end
|
||||
return line
|
||||
end,
|
||||
@@ -132,6 +140,13 @@ local function createOptions(parentData, data, index, subIndex)
|
||||
order = 8,
|
||||
hidden = hiddenGlowExtra,
|
||||
},
|
||||
glowStartAnim = {
|
||||
type = "toggle",
|
||||
width = WeakAuras.normalWidth - indentWidth,
|
||||
name = L["Start Animation"],
|
||||
order = 8.5,
|
||||
hidden = function() return hiddenGlowExtra() or data.glowType ~= "Proc" end
|
||||
},
|
||||
glowLines = {
|
||||
type = "range",
|
||||
control = "WeakAurasSpinBox",
|
||||
@@ -141,7 +156,7 @@ local function createOptions(parentData, data, index, subIndex)
|
||||
min = 1,
|
||||
softMax = 30,
|
||||
step = 1,
|
||||
hidden = function() return hiddenGlowExtra() or data.glowType == "buttonOverlay" end,
|
||||
hidden = function() return hiddenGlowExtra() or data.glowType == "buttonOverlay" or data.glowType == "Proc" end,
|
||||
},
|
||||
glowFrequency = {
|
||||
type = "range",
|
||||
@@ -152,7 +167,18 @@ local function createOptions(parentData, data, index, subIndex)
|
||||
softMin = -2,
|
||||
softMax = 2,
|
||||
step = 0.05,
|
||||
hidden = function() return hiddenGlowExtra() or data.glowType == "buttonOverlay" end,
|
||||
hidden = function() return hiddenGlowExtra() or data.glowType == "buttonOverlay" or data.glowType == "Proc" end,
|
||||
},
|
||||
glowDuration = {
|
||||
type = "range",
|
||||
control = "WeakAurasSpinBox",
|
||||
width = WeakAuras.normalWidth,
|
||||
name = L["Duration"],
|
||||
order = 10,
|
||||
softMin = 0.01,
|
||||
softMax = 3,
|
||||
step = 0.05,
|
||||
hidden = function() return hiddenGlowExtra() or data.glowType ~= "Proc" end,
|
||||
},
|
||||
glow_space3 = {
|
||||
type = "description",
|
||||
|
||||
Reference in New Issue
Block a user