Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compatibility with addons like NoAutoClose #96

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading