Thread Tools Display Modes
02-02-12, 05:23 PM   #1
Animor
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Mar 2011
Posts: 136
Ace3 Profile management display

Hello,

I'm handling the DB and profiles of my addon via Ace3 libs, and there is something I'm not sure how to do (if possible at all). This is the relevant code:

Code:
-- DB
self.db = LibStub("AceDB-3.0"):New("MyAddonDB", defaults, true)

-- Profile management
self.profileOptions = LibStub("AceDBOptions-3.0"):GetOptionsTable(self.db)

-- Register configuration options to Ace3
LibStub("AceConfig-3.0"):RegisterOptionsTable("MyAddon", self.options)
LibStub("AceConfig-3.0"):RegisterOptionsTable("MyAddonProfiles", self.profileOptions)

-- Add Configuration options to blizzard UI
self.configPanel = AceConfigDialog:AddToBlizOptions("MyAddon", "MyAddon")
self.configPanel.profilePanel = AceConfigDialog:AddToBlizOptions("MyAddonProfiles", "Profiles", "MyAddon")
This puts the profiles as a sub-menu of my addon in "interface->addons" menu, openned with "+".

I open the config window by:
LibStub("AceConfigDialog-3.0"):Open() which opens it as a separate, movable window.

However, when I open it this way, I don't have the "profiles" management window. I want to have it as a level one tab (similiar to what I see in interface->addons->MyAddon). I've tried to register it to "self.options.args.profiles", but then it is shown as an internal tab. And when I go through interface->addons I see it twice: first one is the addon sub-menu (openned with +), and second in the addons pane, as an internal tab.

How do I make it right?

Thanks
  Reply With Quote
02-03-12, 03:26 AM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Don't use:

LibStub("AceConfigDialog-3.0"):Open()

Instead, use:

InterfaceOptionsFrame_OpenToCategory("MyAddon")
  Reply With Quote
02-03-12, 04:20 AM   #3
suicidalkatt
A Rage Talon Dragon Guard
 
suicidalkatt's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 331
I'm assuming 'AceConfigDialog' is a local defined as LibStub("AceConfigDialog-3.0")?
  Reply With Quote
02-03-12, 05:46 AM   #4
Animor
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Mar 2011
Posts: 136
Hi,

AceConfigDialog is indeed a local, sorry for not making it clear.

InterfaceOptionsFrame_OpenToCategory("MyAddon") is what I had first. Problem is the Window is the default one for addons config, and it is not movable, it's static in the middle of the screen.
I wanted to have the config panel movable and resizable, so I used LibStub("AceConfigDialog-3.0"):Open

Is there another solution?
  Reply With Quote
02-03-12, 06:37 AM   #5
suicidalkatt
A Rage Talon Dragon Guard
 
suicidalkatt's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 331
Originally Posted by Animor View Post
Hi,

AceConfigDialog is indeed a local, sorry for not making it clear.

InterfaceOptionsFrame_OpenToCategory("MyAddon") is what I had first. Problem is the Window is the default one for addons config, and it is not movable, it's static in the middle of the screen.
I wanted to have the config panel movable and resizable, so I used LibStub("AceConfigDialog-3.0"):Open

Is there another solution?
Check out my !SimplePowerBar options implementation. I believe it's what you're going for. In the blizzard addons menu I simply have a button you can click to open the config or use the slash command '/spb'.

It uses the same method as nibSpellAlertConfig with a few tweaks of my own.
  Reply With Quote
02-03-12, 08:24 AM   #6
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Animor View Post
Problem is the Window is the default one for addons config, and it is not movable, it's static in the middle of the screen.
I wanted to have the config panel movable and resizable, so I used LibStub("AceConfigDialog-3.0"):Open

Is there another solution?
Install BetterBlizzOptions.
  Reply With Quote
02-03-12, 09:39 AM   #7
Animor
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Mar 2011
Posts: 136
Thanks m8s

I want to open the config panel with one click on the minimap icon. So going through blizzard addons menu and then clicking another button for the real config panel, is not what I'm looking for.

Anyway, I've decided to use that:
Code:
if ( InterfaceOptionsFrame:IsShown() ) then
        InterfaceOptionsFrame:Hide()
else
    InterfaceOptionsFrame_OpenToCategory(self.configPanel.profilePanel)
    InterfaceOptionsFrame_OpenToCategory(self.configPanel)
end
I'm calling it twice since I want the profiles sub menu to be expanded. And another click on the minimap icon closes the window.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Ace3 Profile management display


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off