[AceConfig-3.0] Unit specific option tab
Hi all,
I am trying to tweak my options table and create a tab only for a specific unit and here's what I've got so far. Lua Code:
On red colored section, as shown on the image above, I would like to create a "ClassPower" tab only when the selected unit is player. (Which will obviously be hidden when the other units are selected :p) What would be the best way to achieve such thing? Thank you in advance and I wish you all the best!! |
Before I think about your requested issue, your functions need to be local functions. Having names like CreateOption and CreateUnitOption in the global namespace is a very bad idea.
Also, you do not need to specify that childGroups = "tab" twice. You only need that in the parent group. |
To disable if the unit is not the player, add this where appropriate:
Code:
disabled = function() return unit ~= "player" end, |
Quote:
I did not upload the upper part of the lua file, but it actually has those functions declared in local variable first :rolleyes: Lua Code:
Quote:
But, instead of disabling the tab, would there be any possible way to register (show)/unregister (hide) from the options tab which is actually being recycled depending on a selected unit? Here's what I am currently thinking as my solution (which actually works, but I don't think this is optimized) Code:
function CreateUnitOption() |
Use the disabled key for that tab's group.
https://www.wowace.com/projects/ace3...options-tables |
Quote:
Yeah, I thought of using disabled key which will disable that particular tab when the other unit is selected. However, the tab will still be "visible", only grey it out :/ What I want is the tab being fully hidden if the selected unit is not a player ;) |
As far as I know, AceConfig is not capable of removing the tab.
|
You want "hidden" not "disabled"
|
Quote:
|
Quote:
Quote:
I am the dumbest creature of the entire universe. God...................................... How could I have not seen that.............................? |
All times are GMT -6. The time now is 03:30 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI