Also, remember that the order of your Lua files in your Toc matters. For example, in one of my AddOns, I have a core or main file, and the options you'd see in the Interface .. AddOns list comes from a second file. You don't need to do this, but it was my way of making things easier to debug with a large AddOn.
Lua Code:
-- ToC
## all other stuff as expected
main.lua
options.lua
-- main.lua
-- register events, done ADDON_LOADED, etc
local addon_name, pt = ...
function pt:ADDON_LOADED(...)
if ... ~= addon_name then
return -- not my AddOn
end
pt.options = self:MyOptions() -- see options.lua
end
-- options.lua
local addon_name, pt = ...
function pt:MyOptions()
local options = {
-- checkboxes, sliders, inputs, etc
}
return options -- populate pt.options
end