Skip to content

Commit

Permalink
Fix compatibility with addons like NoAutoClose
Browse files Browse the repository at this point in the history
  • Loading branch information
Numynum authored Sep 11, 2024
1 parent 8ac6582 commit 0e07ca4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions layout.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,25 +103,29 @@ Storyline_API.layout.unregisterFromUILayoutEngine = unregisterFromUILayoutEngine
local framesUILayoutEngineSettings = {};

local removeFrameFromUILayoutEngine = function(frameName)
local frame = _G[frameName];
frame:SetParent(hiddenFrames);
local info = UIPanelWindows[frameName];
if not info then return end

framesUILayoutEngineSettings[frameName] = info;

local frame = _G[frameName];
frame:SetAttribute("UIPanelLayout-defined", false);
UIPanelWindows[frameName] = nil;
frame:SetParent(hiddenFrames);
end

local addToLayoutEngine = function(frameName)
local frame = _G[frameName];
UIPanelWindows[frameName] = framesUILayoutEngineSettings[frameName];
frame:SetParent(UIParent);
local info = framesUILayoutEngineSettings[frameName];
if not info then return end

UIPanelWindows[frameName] = info;

frame:SetAttribute("UIPanelLayout-defined", true);
for name, value in pairs(UIPanelWindows[frameName]) do
frame:SetAttribute("UIPanelLayout-" .. name, value);
end
frame:SetParent(UIParent);
end

---
Expand Down

0 comments on commit 0e07ca4

Please sign in to comment.