function LAddMin_createSettingsMenu(sv) local LAM = LibStub("LibAddonMenu-2.0") local menuData = {} LAM:RegisterAddonPanel("LAddMin_UI", { type = "panel", name = "L'AddonMinder", displayName = "|cFFFFB0L'AddonMinder|r", author = "Garkin and Sasky", version = "0.2", registerForRefresh = true, registerForDefaults = true, }) LAM:RegisterOptionControls("LAddMin_UI", menuData) table.insert(menuData,{ { type = "description", title = "|cFF0000WARNING|r: Using this on addons can break them.", text = "If you have an error after enabling an addon, please disable it.\n" .. "If an addon you check here has an issue, disable the conversion here before filing a bug report." }, { type = "header", name = "LAM 1.0 Panels" }, { type = "description", text = "ON to enable LAM2 conversion" } }) --Sort into known working (good), known broken (bad), and unknown (ugly) --(Couldn't resist... ~Sasky) local good, ugly, bad = {}, {}, {} for name in pairs(sv.enabled) do local checkbox = { type = "checkbox", name = name, getFunc = function() return sv.enabled[name] end, setFunc = function(val) sv.enabled[name] = val end, default = false } if LAddMinCompatability[name] == nil then table.insert(ugly, checkbox) else if LAddMinCompatability[name] then checkbox.default = true table.insert(good, checkbox) else checkbox.disabled = true --Could set this to override value table.insert(bad, checkbox) end end end local function checkboxSort(l,r) return l.name < r.name end table.sort(good, checkboxSort) table.sort(bad, checkboxSort) table.sort(ugly, checkboxSort) if #good > 0 then table.insert(menuData,{ type = "submenu", name = "|c00FF00Working addons", tooltip = "These menus convert with no issues.", controls = good }) end if #ugly > 0 then table.insert(menuData,{ type = "submenu", name = "|cFFFF00Unknown addons", tooltip = "We haven't tested if these menus work.", controls = ugly }) end if #bad > 0 then table.insert(menuData,{ type = "submenu", name = "|cFF0000Not convertible addons", tooltip = "These menus have known issues up to the addon not working.", controls = bad }) end table.insert(menuData, { type = "button", name = GetString(SI_ADDON_MANAGER_RELOAD), func = function() ReloadUI("ingame") end }) end