Ah ha. Here's my entire code. I'll load into game shortly to test. After line adjustments, I am trying to populate line 186 with the values contained in AddOnList. I don't need a table inside a table. I'm not sure if the do/end loop is necessary; I just put it there in case.
Lua Code:
local Aardvark = LibStub("AceAddon-3.0"):GetAddon("Aardvark")
local L = LibStub("AceLocale-3.0"):GetLocale("Aardvark", false)
local ldbIcon = LibStub("LibDBIcon-1.0")
local options = nil
local db
local exempt = {
-- always allow these addons to print to chat
["!Aardvark"] = true,
["!Swatter"] = true,
["Ace3"] = true,
["BugSack"] = true,
["Bugger"] = true
}
local OptionsHandler = {} -- local function to this file
do
local AddOnList = {}
for i = 1, GetNumAddOns() do
local folderName, title = GetAddOnInfo(i)
if not exempt[folderName] then
table.insert(AddOnList, {name = title})
end
end
table.sort(AddOnList, function(a, b) -- sort alphabetically
return a.name > b.name
end)
end
function Aardvark:GetOptions()
db = db or self.db.global
options = options or {
type = "group",
childGroups = "tab",
name = Aardvark.Name,
desc = Aardvark.Notes,
arg = "!Aardvark",
args = {
general = {
order = 10,
name = COMPACT_UNIT_FRAME_PROFILE_SUBTYPE_ALL,
type = "group",
args = {
enable = {
order = 10,
name = ENABLE,
desc = L["Toggle Aardvark on or off."],
type = "toggle",
get = function() return db.enabled end,
set = function(info, value)
db.enabled = value
if value then
self:OnEnable()
else
self:OnDisable()
end
end
}, -- end enabled
instance = {
order = 20,
name = L["Instance Chat"],
desc = L["Leave General chat channel when you enter an instance, rejoin when you leave."],
type = "toggle",
get = function() return db.instance end,
set = function(info, value)
db.instance = value
self:PLAYER_ENTERING_WORLD()
end
}, -- end instance General join/leave
cleanChat = {
order = 30,
name = L["Clear Chat"],
desc = L["Clear the chat windows when first logging in."],
type = "toggle",
get = function() return db.cleanChat end,
set = function(info, value)
db.cleanChat = value
end
}, -- end login clean chat
saveGMOTD = {
order = 40,
name = GUILD_MOTD_LABEL2,
desc = L["Restores guild message of the day after clearing chat when first logging in."],
type = "toggle",
disabled = function() return not db.cleanChat end,
get = function() return db.saveGMOTD end,
set = function(info, value)
db.saveGMOTD = value
end
}, -- end GMOTD save
cleanNow = {
order = 50,
name = L["Clean Chat Now"],
type = "execute",
width = "full",
func = function() self:ClearChat() end,
disabled = function() return not self.db.global.enabled end
}, -- end clean now button
hideLDBIcon = {
order = 60,
name = L["Hide Minimap Button"],
desc = L["Toggle hiding the button"],
type = "toggle",
get = function() return db.minimap.hide end,
set = function(info, value)
db.minimap.hide = value
if value then
ldbIcon:Hide("Aardvark")
else
ldbIcon:Show("Aardvark")
end
end
}, -- end toggle Broker button
lockLDBIcon = {
order = 70,
name = L["Lock Button"],
desc = L["Lock the button so it cannot be moved."],
type = "toggle",
get = function() return db.minimap.lock end,
set = function(info, value)
db.minimap.lock = value
if value then
ldbIcon:Lock("Aardvark")
else
ldbIcon:Unlock("Aardvark")
end
end
}, -- end button lock
minimapPos = {
order = 80,
name = L["Rotation"],
desc = L["Rotate the button around the minimap."],
type = "range",
get = function() return db.minimap.minimapPos end,
set = function(info, value)
db.minimap.minimapPos = value
end,
disabled = function() return db.minimap.lock end,
min = 1,
max = 355,
step = 1,
bigStep = 5
}, -- end of minimapPos
radius = {
order = 90,
name = L["Range From Center"],
desc = L["Move the button closer or further from the center of the minimap."],
type = "range",
get = function() return db.minimap.radius end,
set = function(info, value)
db.minimap.radius = value
end,
disabled = function() return db.minimap.lock end,
min = 0,
max = 160,
step = 1,
bigStep = 5
} -- end of radius
}
}, -- end of general options
addons = {
order = 20,
name = ADDONS,
desc = L["Toggle AddOns' ability to send messages to the chat frame."],
type = "group",
handler = OptionsHandler,
args = {
selectAll = {
order = 1, -- want it first
name = ENABLE_ALL_ADDONS,
desc = L["Enable all AddOns to print to chat."],
type = "execute",
func = "SelectAll",
}, -- end of select all
selectNone = {
order = 2, -- want it second
name = DISABLE_ALL_ADDONS,
desc = L["Disable all AddOns from printing to chat."],
type = "execute",
func = "SelectNone"
}, -- end of selecting no addons
installedAddOns = {
order = 3, -- want this third
name = L["Selected AddOns"],
desc = L["Toggle these off to prevent individual AddOns from printing to chat."],
type = "multiselect",
values = AddOnList,
get = GetState,
set = SetState
} -- end of installed addons
}
} -- end of addons section
}
}
return options
end
function OptionsHandler:SelectAll(info)
end
function OptionsHandler:selectNone(info)
end
function OptionsHandler:SetState(info, index, state)
end
function OptionsHandler:GetState(info, index)
end