local addonName, DX = ...
DX.Modules = {}

function DX:AddModule(name, func)
    DX.Modules[name] = {
        Init = func,
        Enabled = true
    }
end

local coreFrame = CreateFrame("Frame")
coreFrame:RegisterEvent("PLAYER_LOGIN")

coreFrame:SetScript("OnEvent", function(self, event)
    if event == "PLAYER_LOGIN" then
        print("|cffFF4500DX Tweaks:|r Loading modules")
        for name, module in pairs(DX.Modules) do
            if module.Enabled then
                module.Init()
                print("|cffFF4500DX Tweaks:|r " .. name .. " loaded")
            end
        end
        self:UnregisterEvent("PLAYER_LOGIN")
    end
end)