From a8c2a1f1ba5e755d0ed036e557e782b38833f5c4 Mon Sep 17 00:00:00 2001 From: Dusk-92 Date: Sun, 30 Aug 2026 21:17:48 +0200 Subject: [PATCH] Keep DragonflightUI bridge dormant when unused --- compat-dragonflightui.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/compat-dragonflightui.lua b/compat-dragonflightui.lua index bf751f6..a0db5dd 100644 --- a/compat-dragonflightui.lua +++ b/compat-dragonflightui.lua @@ -6,6 +6,26 @@ -- ShaguTweaks / Extras ClassicAPI modules to DragonflightUI's ShaguTweaks tab -- without modifying DragonflightUI itself. + +-- Keep this file completely dormant when DragonflightUI-Reforged is not +-- installed/enabled. This avoids creating compatibility tables, metatables or +-- a polling frame for normal ShaguTweaks users. +local function DragonflightUIEnabled() + if DFRL then return true end + if not GetNumAddOns or not GetAddOnInfo then return false end + + for i = 1, GetNumAddOns() do + local name, _, _, enabled = GetAddOnInfo(i) + if name == "DragonflightUI-Reforged" then + return enabled and true or false + end + end + + return false +end + +if not DragonflightUIEnabled() then return end + local T = ShaguTweaks.T local mods = ShaguTweaks.mods