From 3f4dc33c36fe4d8120bff4434b4410d11a72e031 Mon Sep 17 00:00:00 2001 From: Buds Date: Mon, 24 Jan 2022 23:13:42 +0100 Subject: [PATCH] workaround Plexus delayed layout --- LibGetFrame-1.0.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/LibGetFrame-1.0.lua b/LibGetFrame-1.0.lua index 055f74e..2e7addd 100644 --- a/LibGetFrame-1.0.lua +++ b/LibGetFrame-1.0.lua @@ -1,5 +1,5 @@ local MAJOR_VERSION = "LibGetFrame-1.0" -local MINOR_VERSION = 30 +local MINOR_VERSION = 31 if not LibStub then error(MAJOR_VERSION .. " requires LibStub.") end local lib = LibStub:NewLibrary(MAJOR_VERSION, MINOR_VERSION) if not lib then return end @@ -157,11 +157,11 @@ local function doScanForUnitFrames() end end end -local function ScanForUnitFrames(noDelay) - if noDelay then - doScanForUnitFrames() - elseif not wait then +local function ScanForUnitFrames() + doScanForUnitFrames() + if not wait then wait = true + -- do another delayed scan due to Plexus and Vuhdo sometime delayed layout C_Timer.After(1, function() doScanForUnitFrames() end) @@ -244,8 +244,8 @@ local function Init(noDelay) GetFramesCacheListener:RegisterEvent("PLAYER_ENTERING_WORLD") GetFramesCacheListener:RegisterEvent("GROUP_ROSTER_UPDATE") GetFramesCacheListener:RegisterEvent("INSTANCE_ENCOUNTER_ENGAGE_UNIT") - GetFramesCacheListener:SetScript("OnEvent", function() ScanForUnitFrames(false) end) - ScanForUnitFrames(noDelay) + GetFramesCacheListener:SetScript("OnEvent", function() ScanForUnitFrames() end) + ScanForUnitFrames() end function lib.GetUnitFrame(target, opt)