Thread Tools Display Modes
03-06-14, 02:02 PM   #1
CrazyCactuaR
A Deviate Faerie Dragon
Join Date: Oct 2011
Posts: 13
Confusion over using AceConfig/Collapse button

Hi everyone, Does anyone know if it is possible at all, Using Ace3 to design a multi-tiered menu
on interface? So far i've managed to just create a simple list under the addon name, but cannot
seem to find information on creating more.

eg.
Code:
MyAddon
-- Ususal
---- Cats
------ Tabby
------ Torta Shell
---- Dogs
------ Terrier
------ Pug
-- Rare
---- Flying Squirrel
Thank you to anyone who can help out.

Last edited by CrazyCactuaR : 03-06-14 at 04:41 PM.
  Reply With Quote
03-06-14, 04:57 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
If you're talking about the Blizzard Interface Options window, it only supports 2 levels. If you want more levels, you need to embed a tree-type group in your panel, resulting in a three-column UI. You can see this type of layout used in Grid, for the Status module.

Code:
------------------------------[ Interface ]------------------------------
| [ Game ] [ AddOns ]                                                   |
| Addon A             |  Your Addon Panel Title                         |
| Addon B             |  ---------------------------------------------  |
| Addon C             |  | Usual              | Sub-panel title         |
| Another Addon       |  | -- Cats            |                         |
| Some Other Addon    |  | ---- Tabby         | ... some options here   |
| Your Addon          |  | ---- Tortoiseshell |                         |
| ...                 |  | -- Dogs            |                         |
However, this kind of many-tiered tree UI is really annoying to navigate, so you are probably better off figuring out how to reorganize your UI. For example, if you're doing something with battle pets, you could use Cats, Dogs, and Squirrels as second-tier categories in the normal category list, and then use tree groups for your third-level categories, so that the Cats panel had a scrollable panel listing all the cat-type pets next to the panel of actual options.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
03-06-14, 05:38 PM   #3
CrazyCactuaR
A Deviate Faerie Dragon
Join Date: Oct 2011
Posts: 13
Originally Posted by Phanx View Post
If you're talking about the Blizzard Interface Options window, it only supports 2 levels. If you want more levels, you need to embed a tree-type group in your panel, resulting in a three-column UI. You can see this type of layout used in Grid, for the Status module.

Code:
------------------------------[ Interface ]------------------------------
| [ Game ] [ AddOns ]                                                   |
| Addon A             |  Your Addon Panel Title                         |
| Addon B             |  ---------------------------------------------  |
| Addon C             |  | Usual              | Sub-panel title         |
| Another Addon       |  | -- Cats            |                         |
| Some Other Addon    |  | ---- Tabby         | ... some options here   |
| Your Addon          |  | ---- Tortoiseshell |                         |
| ...                 |  | -- Dogs            |                         |
However, this kind of many-tiered tree UI is really annoying to navigate, so you are probably better off figuring out how to reorganize your UI. For example, if you're doing something with battle pets, you could use Cats, Dogs, and Squirrels as second-tier categories in the normal category list, and then use tree groups for your third-level categories, so that the Cats panel had a scrollable panel listing all the cat-type pets next to the panel of actual options.
Thank you Phanx that is much appreciated.

I'll have to somehow figure out how to add a tree list to an options table.
  Reply With Quote
03-06-14, 10:37 PM   #4
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Well, using the structure from your first post, let's say you want Usual and Rare to be the sub-categories in the Interface Options list, and Cats/Dogs to be tabs, and Tabby/Tortoiseshell and Terrier/Pug to be selected from a list, while Rare just has a list (no tabs):

Code:
local options = {
	name = "MyAddon",
	type = "group",
	get = function() return random(2) == 2 end,
	set = function(info, value) print(info.name, value and "ENABLED" or "DISABLED") end,
	args = {
		usual = {
			name = "Usual",
			type = "group",
			childGroups = "tabs",
			args = {
				cats = {
					name = "Cats",
					type = "group",
					childGroups = "tree",
					args = {
						tabby = {
							name = "Tabby",
							type = "toggle",
						},
						torty = {
							name = "Tortoiseshell",
							type = "toggle",
						}
					}
				},
				dogs = {
					name = "Dogs",
					type = "group",
					childGroups = "tree",
					args = {
						terrier = {
							name = "Terrier",
							type = "toggle",
						},
						pug = {
							name = "Pug",
							type = "toggle",
						}
					}
				}
			}
		},
		rare = {
			name = "Rare",
			type = "group",
			args = {
				squirfly = {
					name = "Flying Squirrel",
					type = "toggle",
				}
			}
		}
	}
}
"tree" is the default, so you don't need to specify it on the Rare group, but it's also inheritable, so since you specified it on the Usual group, you do need to specify it on the Cats and Dogs group. Then, you can register the whole table with AceConfigRegistry at once, but you have to add the Usual and Rare groups to the Blizz options separately. To avoid the awkwardness of having a blank main panel, for this example we'll use an About panel for the top level "MyAddon" panel.

Code:
LibStub("AceConfig-Registry-3.0"):RegisterOptionsTable("MyAddon", options)

-- Top level "MyAddon" in the Interface Options list:
LibStub("LibAboutPanel").new(nil, "MyAddon")
-- Second level "Usual" in the Interface Options list:
LibStub("AceConfig-Dialog-3.0"):AddToBlizOptions("MyAddon", options.args.usual.name, "MyAddon", "usual")
-- Second level "Rare" in the Interface Options list:
LibStub("AceConfig-Dialog-3.0"):AddToBlizOptions("MyAddon", options.args.rare.name, "MyAddon", "rare")
(There are also some links in that second block that may be of interest.)
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
03-07-14, 07:53 AM   #5
CrazyCactuaR
A Deviate Faerie Dragon
Join Date: Oct 2011
Posts: 13
Again, I cannot thank you enough. I'll have a good play around with the example you gave and see what i can make.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Confusion over using AceConfig/Collapse button


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