From f970df8eab22042afbe480663476d38ad8b33bf4 Mon Sep 17 00:00:00 2001 From: NoM0Re Date: Fri, 17 Jan 2025 17:10:25 +0100 Subject: [PATCH] from retail --- WeakAuras/Prototypes.lua | 4 ++-- WeakAuras/RegionTypes/DynamicGroup.lua | 9 ++++++--- WeakAurasOptions/CommonOptions.lua | 10 +++++----- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/WeakAuras/Prototypes.lua b/WeakAuras/Prototypes.lua index 31b335f..f31fca5 100644 --- a/WeakAuras/Prototypes.lua +++ b/WeakAuras/Prototypes.lua @@ -985,7 +985,7 @@ Private.load_prototype = { name = "spellknown", display = L["Spell Known"], type = "spell", - test = "WeakAuras.IsSpellKnownForLoad(%q, %s)", + test = "WeakAuras.IsSpellKnownForLoad(%s, %s)", events = {"SPELLS_CHANGED", "UNIT_PET"}, showExactOption = true }, @@ -993,7 +993,7 @@ Private.load_prototype = { name = "not_spellknown", display = WeakAuras.newFeatureString .. L["|cFFFF0000Not|r Spell Known"], type = "spell", - test = "not WeakAuras.IsSpellKnownForLoad(%q, %s)", + test = "not WeakAuras.IsSpellKnownForLoad(%s, %s)", events = {"SPELLS_CHANGED", "UNIT_PET"}, showExactOption = true }, diff --git a/WeakAuras/RegionTypes/DynamicGroup.lua b/WeakAuras/RegionTypes/DynamicGroup.lua index 7451252..0f0242b 100644 --- a/WeakAuras/RegionTypes/DynamicGroup.lua +++ b/WeakAuras/RegionTypes/DynamicGroup.lua @@ -1365,12 +1365,15 @@ local function modify(parent, region, data) end controlPoint:SetWidth(regionData.dimensions.width) controlPoint:SetHeight(regionData.dimensions.height) - if (data.anchorFrameParent - or data.anchorFrameParent == nil) + if (data.anchorFrameParent or data.anchorFrameParent == nil) + and (data.useAnchorPerUnit + or ( + not data.useAnchorPerUnit and not (data.anchorFrameType == "SCREEN" or data.anchorFrameType == "UIPARENT" or data.anchorFrameType == "MOUSE") - and not data.useAnchorPerUnit then + )) + then controlPoint:SetParent(frame == "" and self.relativeTo or frame) else controlPoint:SetParent(self) diff --git a/WeakAurasOptions/CommonOptions.lua b/WeakAurasOptions/CommonOptions.lua index cf00eb3..4b2af34 100644 --- a/WeakAurasOptions/CommonOptions.lua +++ b/WeakAurasOptions/CommonOptions.lua @@ -1115,7 +1115,7 @@ local function PositionOptions(id, data, _, hideWidthHeight, disableSelfPoint, g order = 72, image = function() return "", 0, 0 end, hidden = function() - return IsParentDynamicGroup() or not (data.anchorFrameType == "SCREEN" or data.anchorFrameType == "UIPARENT" or data.anchorFrameType == "MOUSE") + return IsParentDynamicGroup() or not (data.anchorFrameType == "SCREEN" or data.anchorFrameType == "UIPARENT" or data.anchorFrameType == "MOUSE" or IsGroupByFrame()) end, }, -- Input field to select frame to anchor on @@ -1123,9 +1123,9 @@ local function PositionOptions(id, data, _, hideWidthHeight, disableSelfPoint, g type = "input", width = WeakAuras.normalWidth, name = L["Frame"], - order = 72.2, + order = 73, hidden = function() - if (IsParentDynamicGroup()) then + if (IsParentDynamicGroup() or IsGroupByFrame()) then return true; end return not (data.anchorFrameType == "SELECTFRAME") @@ -1138,7 +1138,7 @@ local function PositionOptions(id, data, _, hideWidthHeight, disableSelfPoint, g name = L["Choose"], order = 74, hidden = function() - if (IsParentDynamicGroup()) then + if (IsParentDynamicGroup() or IsGroupByFrame()) then return true; end return not (data.anchorFrameType == "SELECTFRAME") @@ -1278,7 +1278,7 @@ local function PositionOptions(id, data, _, hideWidthHeight, disableSelfPoint, g OptionsPrivate.commonOptions.AddCodeOption(positionOptions, data, L["Custom Anchor"], "custom_anchor", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#custom-anchor-function", - 71.5, function() return not(data.anchorFrameType == "CUSTOM" and not IsParentDynamicGroup()) end, + 71.5, function() return not(data.anchorFrameType == "CUSTOM" and not IsParentDynamicGroup() and not IsGroupByFrame()) end, {"customAnchor"}, false, { setOnParent = group }) return positionOptions; end