WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Ace3 RegisterOptionsTable Help (https://www.wowinterface.com/forums/showthread.php?t=54379)

bsmorgan 09-03-16 04:40 PM

Ace3 RegisterOptionsTable Help
 
1 Attachment(s)
I am one of the authors of Skillet. Skillet has a plugin interface where each plugin is independent and contains the code below. This results in the options table having one line for each addon as shown in the attached image.

Since the actual options / details of each plugin line are small (one or two items), I would prefer that there be one main line on the left titled "Plugins" and then all of the plugin's options appear on the single page.

Is there a way I can code each individual plugin so that this happens?

Code:

plugin.options =
{
        type = 'group',
        name = "TheUndermineJournal",
        order = 1,
        args = {
                enabled = {
                        type = "toggle",
                        name = L["Enabled"],
                        get = function()
                                return Skillet.db.profile.plugins.TUJ.enabled
                        end,
                        set = function(self,value)
                                Skillet.db.profile.plugins.TUJ.enabled = value
                                Skillet:UpdateTradeSkillWindow()
                        end,
                        width = "double",
                        order = 1
                },
        },
}
        local acecfg = LibStub("AceConfig-3.0")
        acecfg:RegisterOptionsTable("Skillet TheUndermineJournal", plugin.options)
        local acedia = LibStub("AceConfigDialog-3.0")
        acedia:AddToBlizOptions("Skillet TheUndermineJournal", "TheUndermineJournal", "Skillet")

Attachment 8802

Torhal 09-03-16 06:37 PM

I do this in Toaster since it controls settings for the various AddOns it detects which are using LibToast-1.0 - each AddOn is inserted into the options table upon being found/loaded from storage.

bsmorgan 09-04-16 12:55 AM

1 Attachment(s)
Quote:

Originally Posted by Torhal (Post 318669)
I do this in Toaster

Thanks! With your hint, I was able to figure out how to do what I wanted!

Torhal 09-04-16 01:42 AM

Glad to hear it! :)


All times are GMT -6. The time now is 08:18 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI