diff --git a/WeakAuras/Libs/LibCustomGlow-1.0/LibCustomGlow-1.0.lua b/WeakAuras/Libs/LibCustomGlow-1.0/LibCustomGlow-1.0.lua index f7b30ce..81a6f07 100644 --- a/WeakAuras/Libs/LibCustomGlow-1.0/LibCustomGlow-1.0.lua +++ b/WeakAuras/Libs/LibCustomGlow-1.0/LibCustomGlow-1.0.lua @@ -4,7 +4,7 @@ if not LibStub then error(MAJOR_VERSION .. " requires LibStub.") end local lib, oldversion = LibStub:NewLibrary(MAJOR_VERSION, MINOR_VERSION) if not lib then return end -local pairs = pairs +local pairs, ipairs = pairs, ipairs local ceil, floor, min, mod = math.ceil, math.floor, math.min, mod local tinsert, tremove = table.insert, table.remove @@ -41,7 +41,7 @@ local FramePoolResetter = function(framePool, frame) end if frame.textures then - for _, texture in pairs(frame.textures) do + for _, texture in ipairs(frame.textures) do GlowTexPool:Release(texture) end end @@ -69,8 +69,8 @@ local function addFrameAndTex(r, color, name, key, N, xOffset, yOffset, texture, local f = r[name..key] f:SetFrameLevel(r:GetFrameLevel() + frameLevel) - f:SetPoint("TOPLEFT", r, "TOPLEFT", -xOffset + 0.05, yOffset + 0.05) - f:SetPoint("BOTTOMRIGHT", r, "BOTTOMRIGHT", xOffset, -yOffset + 0.05) + f:SetPoint("TOPLEFT", r, "TOPLEFT", -xOffset, yOffset) + f:SetPoint("BOTTOMRIGHT", r, "BOTTOMRIGHT", xOffset, -yOffset) f:Show() if not f.textures then diff --git a/WeakAuras/Prototypes.lua b/WeakAuras/Prototypes.lua index 78a4dcc..e1afd62 100644 --- a/WeakAuras/Prototypes.lua +++ b/WeakAuras/Prototypes.lua @@ -1060,7 +1060,7 @@ WeakAuras.event_prototypes = { }, { name = "ignoreDead", - display = WeakAuras.newFeatureString .. L["Ignore Dead"], + display = L["Ignore Dead"], type = "toggle", width = WeakAuras.doubleWidth, enable = function(trigger) @@ -1070,7 +1070,7 @@ WeakAuras.event_prototypes = { }, { name = "ignoreDisconnected", - display = WeakAuras.newFeatureString .. L["Ignore Disconnected"], + display = L["Ignore Disconnected"], type = "toggle", width = WeakAuras.doubleWidth, enable = function(trigger) @@ -1260,7 +1260,7 @@ WeakAuras.event_prototypes = { }, { name = "ignoreDead", - display = WeakAuras.newFeatureString .. L["Ignore Dead"], + display = L["Ignore Dead"], type = "toggle", width = WeakAuras.doubleWidth, enable = function(trigger) @@ -1270,7 +1270,7 @@ WeakAuras.event_prototypes = { }, { name = "ignoreDisconnected", - display = WeakAuras.newFeatureString .. L["Ignore Disconnected"], + display = L["Ignore Disconnected"], type = "toggle", width = WeakAuras.doubleWidth, enable = function(trigger) @@ -1468,7 +1468,7 @@ WeakAuras.event_prototypes = { }, { name = "ignoreDead", - display = WeakAuras.newFeatureString .. L["Ignore Dead"], + display = L["Ignore Dead"], type = "toggle", width = WeakAuras.doubleWidth, enable = function(trigger) @@ -1478,7 +1478,7 @@ WeakAuras.event_prototypes = { }, { name = "ignoreDisconnected", - display = WeakAuras.newFeatureString .. L["Ignore Disconnected"], + display = L["Ignore Disconnected"], type = "toggle", width = WeakAuras.doubleWidth, enable = function(trigger) diff --git a/WeakAuras/RegionTypes/Icon.lua b/WeakAuras/RegionTypes/Icon.lua index bb4d0b7..ebca4c8 100644 --- a/WeakAuras/RegionTypes/Icon.lua +++ b/WeakAuras/RegionTypes/Icon.lua @@ -31,7 +31,7 @@ local default = { zoom = 0, keepAspectRatio = false, frameStrata = 1, - + cooldown = false, cooldownEdge = false, subRegions = {} }; diff --git a/WeakAuras/SubRegionTypes/Glow.lua b/WeakAuras/SubRegionTypes/Glow.lua index b34c3de..9d917ab 100644 --- a/WeakAuras/SubRegionTypes/Glow.lua +++ b/WeakAuras/SubRegionTypes/Glow.lua @@ -26,6 +26,7 @@ local default = function(parentType) glowYOffset = 0, } if parentType == "aurabar" then + options["glowType"] = "Pixel" options["glow_anchor"] = "bar" end return options @@ -345,6 +346,7 @@ local function modify(parent, region, parentData, data, first) region:SetScript("OnSizeChanged", region.UpdateSize) end +-- This is used by the templates to add glow function WeakAuras.getDefaultGlow(regionType) if regionType == "aurabar" then return { @@ -387,4 +389,24 @@ local function supports(regionType) or regionType == "aurabar" end -WeakAuras.RegisterSubRegionType("subglow", L["Glow"], supports, create, modify, onAcquire, onRelease, default, nil, properties); +local function addDefaultsForNewAura(data) + if data.regionType == "icon" then + tinsert(data.subRegions, { + ["type"] = "subglow", + glow = false, + useGlowColor = false, + glowColor = {1, 1, 1, 1}, + glowType = "buttonOverlay", + glowLines = 8, + glowFrequency = 0.25, + glowLength = 10, + glowThickness = 1, + glowScale = 1, + glowBorder = false, + glowXOffset = 0, + glowYOffset = 0, + }) + end +end + +WeakAuras.RegisterSubRegionType("subglow", L["Glow"], supports, create, modify, onAcquire, onRelease, default, addDefaultsForNewAura, properties); diff --git a/WeakAuras/Types.lua b/WeakAuras/Types.lua index 8c1620e..ae6b35d 100644 --- a/WeakAuras/Types.lua +++ b/WeakAuras/Types.lua @@ -806,15 +806,15 @@ WeakAuras.anchor_frame_types = { SCREEN = L["Screen/Parent Group"], MOUSE = L["Mouse Cursor"], SELECTFRAME = L["Select Frame"], - UNITFRAME = WeakAuras.newFeatureString..L["Unit Frames"], - CUSTOM = WeakAuras.newFeatureString..L["Custom"] + UNITFRAME = L["Unit Frames"], + CUSTOM = L["Custom"] } WeakAuras.anchor_frame_types_group = { SCREEN = L["Screen/Parent Group"], MOUSE = L["Mouse Cursor"], SELECTFRAME = L["Select Frame"], - CUSTOM = WeakAuras.newFeatureString..L["Custom"] + CUSTOM = L["Custom"] } WeakAuras.spark_rotation_types = { @@ -2310,7 +2310,7 @@ WeakAuras.author_option_types = { space = L["Space"], multiselect = L["Toggle List"], header = L["Separator"], - group = WeakAuras.newFeatureString .. L["Option Group"], + group = L["Option Group"], } WeakAuras.author_option_fields = { diff --git a/WeakAurasOptions/BuffTrigger2.lua b/WeakAurasOptions/BuffTrigger2.lua index 56cba5c..83fb797 100644 --- a/WeakAurasOptions/BuffTrigger2.lua +++ b/WeakAurasOptions/BuffTrigger2.lua @@ -659,7 +659,7 @@ local function GetBuffTriggerOptions(data, triggernum) ignoreDead = { type = "toggle", - name = WeakAuras.newFeatureString .. L["Ignore Dead"], + name = L["Ignore Dead"], order = 68.7, width = WeakAuras.doubleWidth, hidden = function() return not (trigger.type == "aura2" and (trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party")) end @@ -667,14 +667,14 @@ local function GetBuffTriggerOptions(data, triggernum) ignoreDisconnected = { type = "toggle", - name = WeakAuras.newFeatureString .. L["Ignore Disconnected"], + name = L["Ignore Disconnected"], order = 68.8, width = WeakAuras.doubleWidth, hidden = function() return not (trigger.type == "aura2" and (trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party")) end }, ignoreInvisible = { type = "toggle", - name = WeakAuras.newFeatureString .. L["Ignore out of checking range"], + name = L["Ignore out of checking range"], desc = L["Uses UnitIsVisible() to check if in range. This is polled every second."], order = 68.9, width = WeakAuras.doubleWidth, diff --git a/WeakAurasOptions/CommonOptions.lua b/WeakAurasOptions/CommonOptions.lua index 204b657..4931452 100644 --- a/WeakAurasOptions/CommonOptions.lua +++ b/WeakAurasOptions/CommonOptions.lua @@ -1188,7 +1188,7 @@ local function BorderOptions(id, data, showBackDropOptions, hiddenFunc, order) width = WeakAuras.normalWidth, name = L["Border Size"], order = order + 0.4, - softMin = 1, + min = 1, softMax = 64, bigStep = 1, hidden = function() return hiddenFunc and hiddenFunc() or not data.border end, diff --git a/WeakAurasOptions/RegionOptions/DynamicGroup.lua b/WeakAurasOptions/RegionOptions/DynamicGroup.lua index e4a4291..8e2dd5d 100644 --- a/WeakAurasOptions/RegionOptions/DynamicGroup.lua +++ b/WeakAurasOptions/RegionOptions/DynamicGroup.lua @@ -80,7 +80,7 @@ local function createOptions(id, data) groupIcon = { type = "input", width = WeakAuras.normalWidth, - name = WeakAuras.newFeatureString..L["Group Icon"], + name = L["Group Icon"], desc = L["Set Thumbnail Icon"], order = 0.5, get = function() @@ -122,7 +122,7 @@ local function createOptions(id, data) type = "toggle", order = 1.5, width = WeakAuras.normalWidth, - name = WeakAuras.newFeatureString..L["Group by Frame"], + name = L["Group by Frame"], desc = L[ [[Group and anchor each auras by frame. @@ -134,7 +134,7 @@ local function createOptions(id, data) anchorPerUnit = { type = "select", width = WeakAuras.normalWidth, - name = WeakAuras.newFeatureString..L["Group by Frame"], + name = L["Group by Frame"], order = 1.6, values = { ["UNITFRAME"] = L["Unit Frames"], diff --git a/WeakAurasOptions/RegionOptions/Group.lua b/WeakAurasOptions/RegionOptions/Group.lua index 52e3f22..a38b78d 100644 --- a/WeakAurasOptions/RegionOptions/Group.lua +++ b/WeakAurasOptions/RegionOptions/Group.lua @@ -62,7 +62,7 @@ local function createOptions(id, data) groupIcon = { type = "input", width = WeakAuras.normalWidth, - name = WeakAuras.newFeatureString..L["Group Icon"], + name = L["Group Icon"], desc = L["Set Thumbnail Icon"], order = 0.50, get = function() diff --git a/WeakAurasOptions/SubRegionOptions/Border.lua b/WeakAurasOptions/SubRegionOptions/Border.lua index 1a5e6f8..f6e4384 100644 --- a/WeakAurasOptions/SubRegionOptions/Border.lua +++ b/WeakAurasOptions/SubRegionOptions/Border.lua @@ -64,7 +64,7 @@ local function createOptions(parentData, data, index, subIndex) width = WeakAuras.normalWidth, name = L["Border Size"], order = 6, - softMin = 1, + min = 1, softMax = 64, bigStep = 1, },