I've been trying everything since 2 days to get what I want, but failed. :(
I have an options panel made with Ace3, and currently, it looks like the attachments.
I would like to have one option per line.
I tried to change the order values, making subgroups, but nothing seems to work.
Can anyone help me with this ?
Here is my code for the options :
local options = {
type = 'group',
childGroups = 'tab',
args = {
general = {
type = 'group',
name = L['General'],
desc = L['General Options'],
args = {
ShowPortraits = {
type = 'toggle',
name = L['Show Portraits'],
desc = L['Indicates whether to show or hide portraits'],
get = function (info) return oUF_Tabi.db.profile.ShowPortraits end,
set = function (info, value) oUF_Tabi.db.profile.ShowPortraits = value end,
order = 1,
},
rolespecific = {
type = 'description',
name = L['Role Specific:'],
order = 2,
},
ShowVengeance = {
type = 'toggle',
name = L['Show Vengeance'],
desc = L['Indicates whether to show or hide the Vengeance AP buff'],
get = function (info) return oUF_Tabi.db.profile.ShowVengeance end,
set = function (info, value) oUF_Tabi.db.profile.ShowVengeance = value end,
order = 3,
},
HealerMode = {
type = 'toggle',
name = L['Healer Mode'],
desc = L['Changes the layout for party and raid frames to account for healing duty'],
get = function (info) return oUF_Tabi.db.profile.HealerMode end,
set = function (info, value) oUF_Tabi.db.profile.HealerMode = value end,
order = 4,
},
classspecific = {
type = 'description',
name = L['Class Specific:'],
order = 5,
},
ShowComboPoints = {
type = 'toggle',
name = L['Show Rogues/Druids Combo Points'],
desc = L['Indicates whether to show or hide Combo Points as a Rogue or a Druid'],
get = function (info) return oUF_Tabi.db.profile.ShowComboPoints end,
set = function (info, value) oUF_Tabi.db.profile.ShowComboPoints = value end,
order = 6,
},
ShowTotems = {
type = 'toggle',
name = L['Show Shamans Totems'],
desc = L['Indicates whether to show or hide Totems as a Shaman'],
get = function (info) return oUF_Tabi.db.profile.ShowTotems end,
set = function (info, value) oUF_Tabi.db.profile.ShowTotems = value end,
order = 7,
},
ShowHolyPower = {
type = 'toggle',
name = L['Show Paladins Holy Power'],
desc = L['Indicates whether to show or hide Holy Power as a Paladin'],
get = function (info) return oUF_Tabi.db.profile.ShowHolyPower end,
set = function (info, value) oUF_Tabi.db.profile.ShowHolyPower = value end,
order = 8,
},
ShowSoulShards = {
type = 'toggle',
name = L['Show Warlocks Soul Shards'],
desc = L['Indicates whether to show or hide Soul Shards as a Warlock'],
get = function (info) return oUF_Tabi.db.profile.ShowSoulShards end,
set = function (info, value) oUF_Tabi.db.profile.ShowSoulShards = value end,
order = 9,
},
ShowRunes = {
type = 'toggle',
name = L['Show Death Knights Runes'],
desc = L['Indicates whether to show or hide Runes as a Death Knight'],
get = function (info) return oUF_Tabi.db.profile.ShowRunes end,
set = function (info, value) oUF_Tabi.db.profile.ShowRunes = value end,
order = 10,
},
ShowEclipseBar = {
type = 'toggle',
name = L['Show Druids Eclipse bar'],
desc = L['Indicates whether to show or hide Eclipse bar as a Druid'],
get = function (info) return oUF_Tabi.db.profile.ShowEclipseBar end,
set = function (info, value) oUF_Tabi.db.profile.ShowEclipseBar = value end,
order = 11,
}
},
order = 1,
},
player = {
type = 'group',
name = L['Player'],
desc = L['Player Options'],
args = {},
order = 2,
},
target = {
type = 'group',
name = L['Target'],
desc = L['Target Options'],
args = {},
order = 3,
},
pet = {
type = 'group',
name = L['Pet'],
desc = L['Pet Options'],
args = {},
order = 4,
},
tot = {
type = 'group',
name = L['ToT'],
desc = L['ToT Options'],
args = {},
order = 5,
},
focus = {
type = 'group',
name = L['Focus'],
desc = L['Focus Options'],
args = {},
order = 6,
},
party = {
type = 'group',
name = L['Party'],
desc = L['Party Options'],
args = {},
order = 7,
},
raid = {
type = 'group',
name = L['Raid'],
desc = L['Raid Options'],
args = {},
order = 8,
},
boss = {
type = 'group',
name = L['Boss'],
desc = L['Boss Options'],
args = {},
order = 9,
},
},
}
You need spacers. You put them in just like any other option.
spacer1 = {
type = "description",
name = "",
order = 30
},
Remember to name them accordingly, and set their order # accordingly.
**EDIT: clarification, by name, I do not mean the name field. Leave that as ""; I mean spacer1, spacer2, etc. You can reset the names per option section, or you can keep a running total if that is easier on you.
As a side tip, regarding your localization: some of your phrases are already translated by the game, like Raid, Player, and others. Use the global strings for those. See what you can find.
Now, to go a little further, I thought strings were cutted (with ...) because there were multiple options on the same line but it appears I was wrong (again). Is there a way to get the full string ?
Now, to go a little further, I thought strings were cutted (with ...) because there were multiple options on the same line but it appears I was wrong (again). Is there a way to get the full string ?
I am unclear what you mean, sorry. Could you elaborate please?
Unless you mean concatination. The following result in the same thing.
"This".." is ".. 1 .. " long string"
"This is ".. 1 .. " long".. " string"
"This".. " ".. "is" .. " ".. 1 .. " long".. " string"
As an alternate to using a spacer (empty description) to create a line break, you can also make your options span the whole width of the frame. To do this, you need to use the width parameter set to "full". This will show your entire string instead of truncating it.
function dbGetValue(info)
return oUF_Tabi.db.profile[info.option.name]
end
function dbSetValue(info, value)
oUF_Tabi.db.profile[info.option.name] = value
end
local options = {
type = 'group',
childGroups = 'tab',
args = {
general = {
type = 'group',
name = L['General'],
desc = L['General Options'],
order = 1,
args = {
ShowPortraits = {
type = 'toggle',
name = L['Show Portraits'],
desc = L['Indicates whether to show or hide portraits'],
get = dbGetValue, set = dbSetValue, order = 1,
},
rolespecific = {
type = 'group',
name = L['Role Specific:'],
order = 2,
args = {
ShowVengeance = {
type = 'toggle',
name = L['Show Vengeance'],
desc = L['Indicates whether to show or hide the Vengeance AP buff'],
get = dbGetValue, set = dbSetValue, order = 1, width = "full",
},
HealerMode = {
type = 'toggle',
name = L['Healer Mode'],
desc = L['Changes the layout for party and raid frames to account for healing duty'],
get = dbGetValue, set = dbSetValue, order = 2, width = "full",
},
},
},
classspecific = {
type = 'group',
name = L['Class Specific:'],
order = 3,
args = {
ShowComboPoints = {
type = 'toggle',
name = L['Show Rogues/Druids Combo Points'],
desc = L['Indicates whether to show or hide Combo Points as a Rogue or a Druid'],
get = dbGetValue, set = dbSetValue, order = 1, width = "full",
},
ShowTotems = {
type = 'toggle',
name = L['Show Shamans Totems'],
desc = L['Indicates whether to show or hide Totems as a Shaman'],
get = dbGetValue, set = dbSetValue, order = 2, width = "full",
},
ShowHolyPower = {
type = 'toggle',
name = L['Show Paladins Holy Power'],
desc = L['Indicates whether to show or hide Holy Power as a Paladin'],
get = dbGetValue, set = dbSetValue, order = 3, width = "full",
},
ShowSoulShards = {
type = 'toggle',
name = L['Show Warlocks Soul Shards'],
desc = L['Indicates whether to show or hide Soul Shards as a Warlock'],
get = dbGetValue, set = dbSetValue, order = 4, width = "full",
},
ShowRunes = {
type = 'toggle',
name = L['Show Death Knights Runes'],
desc = L['Indicates whether to show or hide Runes as a Death Knight'],
get = dbGetValue, set = dbSetValue, order = 5, width = "full",
},
ShowEclipseBar = {
type = 'toggle',
name = L['Show Druids Eclipse bar'],
desc = L['Indicates whether to show or hide Eclipse bar as a Druid'],
get = dbGetValue, set = dbSetValue, order = 6, width = "full",
},
},
},
},
},
},
}
the option your looking for is [[ width = "full" ]] that will make them look like your wanting it to ; & Seerah beats me to it :)
I'll try the width param as soon as I can, as it will make the code much more clean than using lots of spacers.
OrionShock, I took a closer look at what you wrote, I like the idea of having only one get and set function to access my options. However, that leads to another question:
When you write info.option.name in the two functions, what do you mean by "name":
- name = L['Role Specific:'] or
- rolespecific = {
The second one is OK, I can get it to match with my options DB. But if it's the first, I don't think that will work.
oopse... yeah, info.option.name is the localized display name used in the options window. It would be info[#info] instead for the key name that the specific option table is sitting on.
info = {
[1] = "AppName?"
[2] = "FirstGroupNodeName"
[N] = "NGroupKey"
[B][U][#-1] = "general" --ParentLeafName[/U][/B]
[B][U][#] = "rolespecific" --LeafNodeName[/U][/B]
option = {} -- the table that the info table is being called for
options = {} --parent options table, the WHOLE thing
arg = -- what ever the arg option was set to in the option table
uiType = "" --AceConfigRegistry var
uiName = "" --AceConfigRegistry var
handler = {} -- the addon table iirc
type = "" -- kind of option ie: description, toggle, input
}
You could technically use the same Get/Set Functions for everything in a given option table.. but that would be bad form as it could be quite ugly...
I usually find that setting the width to "double" is sufficient, and that "full" width wastes a lot of space and forces a lot of unnecessary scrolling.
It's been so long since I played without BetterBlizzOptions that I have no idea what the default size of the options window is. The AceConfig window fits two double-width options.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I've been trying everything since 2 days to get what I want, but failed. :(
I have an options panel made with Ace3, and currently, it looks like the attachments.
I would like to have one option per line.
I tried to change the order values, making subgroups, but nothing seems to work.
Can anyone help me with this ?
Here is my code for the options :
Thanks in advance.
Remember to name them accordingly, and set their order # accordingly.
**EDIT: clarification, by name, I do not mean the name field. Leave that as ""; I mean spacer1, spacer2, etc. You can reset the names per option section, or you can keep a running total if that is easier on you.
As a side tip, regarding your localization: some of your phrases are already translated by the game, like Raid, Player, and others. Use the global strings for those. See what you can find.
I'm gonna look for things already translated too.
Now, to go a little further, I thought strings were cutted (with ...) because there were multiple options on the same line but it appears I was wrong (again). Is there a way to get the full string ?
Unless you mean concatination. The following result in the same thing.
the option your looking for is [[ width = "full" ]] that will make them look like your wanting it to ; & Seerah beats me to it :)
I'll try the width param as soon as I can, as it will make the code much more clean than using lots of spacers.
OrionShock, I took a closer look at what you wrote, I like the idea of having only one get and set function to access my options. However, that leads to another question:
When you write info.option.name in the two functions, what do you mean by "name":
- name = L['Role Specific:'] or
- rolespecific = {
The second one is OK, I can get it to match with my options DB. But if it's the first, I don't think that will work.
info[#info] = "rolespecific"
info.option.name = L["Role Specific"]
RE :: http://www.wowace.com/addons/ace3/pages/ace-config-3-0-options-tables/#w-callback-arguments
the info table kinda looks like this :
You could technically use the same Get/Set Functions for everything in a given option table.. but that would be bad form as it could be quite ugly...
/edit: and it always depends on the config and how much there is to it.