From c1c58d46d0f55ce471f9ce6d096e935a80f2e014 Mon Sep 17 00:00:00 2001 From: NoM0Re Date: Sat, 15 Feb 2025 14:40:24 +0100 Subject: [PATCH] from retail --- WeakAuras/BuffTrigger2.lua | 10 +++++----- WeakAuras/GenericTrigger.lua | 2 +- WeakAuras/RegionTypes/DynamicGroup.lua | 2 +- WeakAuras/RegionTypes/RegionPrototype.lua | 2 +- WeakAuras/SubRegionTypes/Glow.lua | 3 --- 5 files changed, 8 insertions(+), 11 deletions(-) diff --git a/WeakAuras/BuffTrigger2.lua b/WeakAuras/BuffTrigger2.lua index 85cf761..93de37e 100644 --- a/WeakAuras/BuffTrigger2.lua +++ b/WeakAuras/BuffTrigger2.lua @@ -112,7 +112,7 @@ local function UnitExistsFixed(unit) if #unit > 9 and unit:sub(1, 9) == "nameplate" then return nameplateExists[unit] or false end - return UnitExists(unit) and UnitGUID(unit) or false + return UnitExists(unit) or UnitGUID(unit) or false end local function UnitIsVisibleFixed(unit) @@ -1266,7 +1266,7 @@ local function UpdateTriggerState(time, id, triggernum) local cloneId = "" local useMatch = true - if triggerInfo.unitExists ~= nil and not UnitExistsFixed(triggerInfo.unit) then + if triggerInfo.unitExists ~= nil and not existingUnits[triggerInfo.unit] then useMatch = triggerInfo.unitExists else useMatch = SatisfiesGroupMatchCount(triggerInfo, unitCount, maxUnitCount, matchCount) @@ -1322,7 +1322,7 @@ local function UpdateTriggerState(time, id, triggernum) end local useMatches = true - if triggerInfo.unitExists ~= nil and not UnitExistsFixed(triggerInfo.unit) then + if triggerInfo.unitExists ~= nil and not existingUnits[triggerInfo.unit] then useMatches = triggerInfo.unitExists else useMatches = SatisfiesGroupMatchCount(triggerInfo, unitCount, maxUnitCount, matchCount) @@ -1661,7 +1661,7 @@ local function ScanRaidMarkScanFunc(matchDataChanged) end local function ScanGroupUnit(time, matchDataChanged, unitType, unit) - local unitExists = UnitExistsFixed(unit) + local unitExists = UnitExistsFixed(unit) == 1 and true or false if existingUnits[unit] ~= unitExists then existingUnits[unit] = unitExists @@ -1787,7 +1787,7 @@ end local function RecheckActive(triggerInfo, unit, unitsToRemoveScan) local isSelf, role, inParty, class - local unitExists = UnitExistsFixed(unit) + local unitExists = UnitExistsFixed(unit) == 1 and true or false if unitExists and TriggerInfoApplies(triggerInfo, unit) then if (not activeGroupScanFuncs[unit] or not activeGroupScanFuncs[unit][triggerInfo]) then triggerInfo.maxUnitCount = triggerInfo.maxUnitCount + 1 diff --git a/WeakAuras/GenericTrigger.lua b/WeakAuras/GenericTrigger.lua index 7be3521..2965fed 100644 --- a/WeakAuras/GenericTrigger.lua +++ b/WeakAuras/GenericTrigger.lua @@ -420,7 +420,7 @@ function ConstructFunction(prototype, trigger) table.insert(ret, #tests > 0 and tconcat(tests, " and ") or "true") table.insert(ret, ") then\n") if(#debug > 0) then - table.insert("print('ret: true');\n") + table.insert(ret, "print('ret: true');\n") end if (prototype.statesParameter == "all") then diff --git a/WeakAuras/RegionTypes/DynamicGroup.lua b/WeakAuras/RegionTypes/DynamicGroup.lua index 350bb89..93380f3 100644 --- a/WeakAuras/RegionTypes/DynamicGroup.lua +++ b/WeakAuras/RegionTypes/DynamicGroup.lua @@ -97,7 +97,7 @@ end local function releaseControlPoint(self, controlPoint) controlPoint:Hide() - controlPoint:SetAnchorPoint(self.parent.selfPoint) + controlPoint:ClearAnchorPoint() local regionData = controlPoint.regionData if regionData then if self.parent.anchorPerUnit == "UNITFRAME" then diff --git a/WeakAuras/RegionTypes/RegionPrototype.lua b/WeakAuras/RegionTypes/RegionPrototype.lua index ca9a4b3..49afc83 100644 --- a/WeakAuras/RegionTypes/RegionPrototype.lua +++ b/WeakAuras/RegionTypes/RegionPrototype.lua @@ -703,7 +703,7 @@ function Private.regionPrototype.create(region) region.RunCode = RunCode; region.GlowExternal = GlowExternal; - region.ReAnchor = UpdatePosition; + --region.ReAnchor = UpdatePosition; https://github.com/WeakAuras/WeakAuras2/commit/7859d5e region.SetAnchor = SetAnchor; region.SetOffset = SetOffset; region.SetXOffset = SetXOffset; diff --git a/WeakAuras/SubRegionTypes/Glow.lua b/WeakAuras/SubRegionTypes/Glow.lua index 01989c7..6ff8307 100644 --- a/WeakAuras/SubRegionTypes/Glow.lua +++ b/WeakAuras/SubRegionTypes/Glow.lua @@ -307,9 +307,6 @@ end local function onRelease(subRegion) subRegion.glowType = nil - if subRegion.glow then - subRegion:SetVisible(false) - end subRegion:Hide() subRegion:ClearAllPoints() subRegion:SetParent(UIParent)