From 21e3d0491b446c02036736d6a99316c0a2f24870 Mon Sep 17 00:00:00 2001 From: Sheldium Date: Sun, 31 Dec 2023 14:05:16 +0100 Subject: [PATCH] Core/StaticPopups: Check for wildcard dice/forced primary stat --- ElvUI/Core/StaticPopups.lua | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/ElvUI/Core/StaticPopups.lua b/ElvUI/Core/StaticPopups.lua index 94cbf3e..fdb6004 100644 --- a/ElvUI/Core/StaticPopups.lua +++ b/ElvUI/Core/StaticPopups.lua @@ -539,9 +539,26 @@ function E:StaticPopup_CollapseTable() end end +function E:StaticPopup_GetLastVisible() + local lastFrame = E.StaticPopup_DisplayedFrames[#E.StaticPopup_DisplayedFrames] + + -- wildcard and primary stat frame take same space as 1st popup window + if not(lastFrame) then + lastFrame = WildCardUtil.GetVisibleDice() + end + + if not(lastFrame) then + if ForcedPrimaryStatFrame and ForcedPrimaryStatFrame:IsVisible() then + lastFrame = ForcedPrimaryStatFrame + end + end + + return lastFrame +end + function E:StaticPopup_SetUpPosition(dialog) if not tContains(E.StaticPopup_DisplayedFrames, dialog) then - local lastFrame = E.StaticPopup_DisplayedFrames[#E.StaticPopup_DisplayedFrames] + local lastFrame = E:StaticPopup_GetLastVisible() if lastFrame then dialog:Point("TOP", lastFrame, "BOTTOM", 0, -4) else