diff --git a/WeakAuras/SubRegionTypes/Glow.lua b/WeakAuras/SubRegionTypes/Glow.lua index bd14437d9f..49c2f4e6b4 100644 --- a/WeakAuras/SubRegionTypes/Glow.lua +++ b/WeakAuras/SubRegionTypes/Glow.lua @@ -15,6 +15,7 @@ local default = function(parentType) glowType = "buttonOverlay", glowLines = 8, glowFrequency = 0.25, + glowDuration = 1, glowLength = 10, glowThickness = 1, glowScale = 1, @@ -70,6 +71,15 @@ local properties = { bigStep = 0.1, default = 0.25 }, + glowDuration = { + display = L["Duration"], + setter = "SetGlowDuration", + type = "number", + softMin = 0.01, + softMax = 3, + bigStep = 0.1, + default = 1 + }, glowLength = { display = L["Length"], setter = "SetGlowLength", @@ -121,6 +131,11 @@ local properties = { bigStep = 1, default = 0 }, + glowStartAnim = { + display = L["Start Animation"], + setter = "SetGlowStartAnim", + type = "bool", + }, } local function glowStart(self, frame, color) @@ -158,6 +173,15 @@ local function glowStart(self, frame, color) nil, 0 ) + elseif self.glowType == "Proc" then + self.glowStart(frame, { + color = color, + startAnim = self.glowStartAnim and true or false, + duration = self.glowDuration, + xOffset = self.glowXOffset, + yOffset = self.glowYOffset, + frameLevel = 0 + }) end end @@ -223,6 +247,15 @@ local funcs = { if self.parentRegionType ~= "aurabar" then self.parent:AnchorSubRegion(self, "area") end + elseif newType == "Proc" then + self.glowStart = LCG.ProcGlow_Start + self.glowStop = LCG.ProcGlow_Stop + if self.parentRegionType ~= "aurabar" then + self.parent:AnchorSubRegion(self, "area", "region") + end + else -- noop function in case of unsuported glow + self.glowStart = function() end + self.glowStop = function() end end self.glowType = newType if isGlowing then @@ -256,6 +289,12 @@ local funcs = { self:SetVisible(true) end end, + SetGlowDuration = function(self, duration) + self.glowDuration = duration + if self.glow then + self:SetVisible(true) + end + end, SetGlowLength = function(self, length) self.glowLength = length if self.glow then @@ -280,6 +319,12 @@ local funcs = { self:SetVisible(true) end end, + SetGlowStartAnim = function(self, enable) + self.glowStartAnim = enable + if self.glow then + self:SetVisible(true) + end + end, SetGlowXOffset = function(self, xoffset) self.glowXOffset = xoffset if self.glow then @@ -329,7 +374,7 @@ local function modify(parent, region, parentData, data, first) if parentData.regionType == "aurabar" then parent:AnchorSubRegion(region, "area", data.glow_anchor) else - parent:AnchorSubRegion(region, "area", data.glowType == "buttonOverlay" and "region") + parent:AnchorSubRegion(region, "area", (data.glowType == "buttonOverlay" or data.glowType == "Proc") and "region") end region.parent = parent @@ -345,6 +390,8 @@ local function modify(parent, region, parentData, data, first) region.glowBorder = data.glowBorder region.glowXOffset = data.glowXOffset region.glowYOffset = data.glowYOffset + region.glowStartAnim = data.glowStartAnim + region.glowDuration = data.glowDuration region:SetGlowType(data.glowType) region:SetVisible(data.glow) @@ -363,6 +410,7 @@ function Private.getDefaultGlow(regionType) glowType = "Pixel", glowLines = 8, glowFrequency = 0.25, + glowDuration = 1, glowLength = 10, glowThickness = 1, glowScale = 1, @@ -380,6 +428,7 @@ function Private.getDefaultGlow(regionType) glowType = "buttonOverlay", glowLines = 8, glowFrequency = 0.25, + glowDuration = 1, glowLength = 10, glowThickness = 1, glowScale = 1, diff --git a/WeakAuras/Types.lua b/WeakAuras/Types.lua index 0f2488f10d..2c168c8a57 100644 --- a/WeakAuras/Types.lua +++ b/WeakAuras/Types.lua @@ -3330,6 +3330,13 @@ Private.glow_types = { buttonOverlay = L["Action Button Glow"], } +if WeakAuras.IsRetail() then + local build = select(4, GetBuildInfo()) + if build >= 100105 then + Private.glow_types.Proc = L["Proc Glow"] + end +end + Private.font_sizes = { small = L["Small"], medium = L["Medium"], diff --git a/WeakAuras/WeakAuras.lua b/WeakAuras/WeakAuras.lua index c45f4f4a1c..c4a25dca5b 100644 --- a/WeakAuras/WeakAuras.lua +++ b/WeakAuras/WeakAuras.lua @@ -3371,6 +3371,8 @@ local function actionGlowStop(actions, frame, id) LCG.PixelGlow_Stop(frame.__WAGlowFrame, id) elseif actions.glow_type == "ACShine" then LCG.AutoCastGlow_Stop(frame.__WAGlowFrame, id) + elseif actions.glow_type == "Proc" then + LCG.ProcGlow_Stop(frame.__WAGlowFrame, id) end end @@ -3412,6 +3414,8 @@ local function actionGlowStart(actions, frame, id) actions.glow_YOffset, id ) + elseif actions.glow_type == "Proc" then + LCG.ProcGlow_Start(glow_frame, actions.startAnim) end end diff --git a/WeakAurasOptions/ActionOptions.lua b/WeakAurasOptions/ActionOptions.lua index 6809957765..55c930326d 100644 --- a/WeakAurasOptions/ActionOptions.lua +++ b/WeakAurasOptions/ActionOptions.lua @@ -384,6 +384,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, }, @@ -404,6 +405,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, }, @@ -459,6 +461,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, }, @@ -476,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, }, @@ -785,6 +789,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, }, @@ -805,6 +810,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, }, @@ -860,6 +866,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, }, @@ -877,6 +884,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, }, diff --git a/WeakAurasOptions/ConditionOptions.lua b/WeakAurasOptions/ConditionOptions.lua index e7592cd65a..b0f99d5e20 100644 --- a/WeakAurasOptions/ConditionOptions.lua +++ b/WeakAurasOptions/ConditionOptions.lua @@ -1065,6 +1065,7 @@ local function addControlsForChange(args, order, data, conditionVariable, totalA local glowTypesExcepButtonOverlay = CopyTable(OptionsPrivate.Private.glow_types) glowTypesExcepButtonOverlay["buttonOverlay"] = nil + glowTypesExcepButtonOverlay["Proc"] = nil args["condition" .. i .. "value" .. j .. "glow_action"] = { type = "select", diff --git a/WeakAurasOptions/SubRegionOptions/Glow.lua b/WeakAurasOptions/SubRegionOptions/Glow.lua index 6c825f6760..00ef15d827 100644 --- a/WeakAurasOptions/SubRegionOptions/Glow.lua +++ b/WeakAurasOptions/SubRegionOptions/Glow.lua @@ -76,6 +76,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, @@ -126,6 +134,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", @@ -135,7 +150,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", @@ -146,7 +161,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",