Quantcast
WoWInterface - View Single Post - [AceConfig-3.0] Unit specific option tab
View Single Post
10-27-18, 03:08 PM   #1
Lyak
A Cyclonian
Join Date: Jul 2018
Posts: 46
[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:
  1. function CreateOption()
  2.     if not option then
  3.         option = {
  4.             order = A:GetModuleOrder(),
  5.             type = "group",
  6.             childGroups = "tab",
  7.             name = "Unitframe",
  8.             args = {
  9.                 unit = {
  10.                     order = 1,
  11.                     type = "group",
  12.                     childGroups = "tab",
  13.                     name = "Unit",
  14.                     args = CreateUnitOption(),
  15.                 },
  16.             },
  17.         };
  18.     end
  19.  
  20.     return option;
  21. end
  22.  
  23. function CreateUnitOption()
  24.     local option = {
  25.         selected = {
  26.             order = 1,
  27.             type = "select",
  28.             name = "Selected Unit",
  29.             values = unitList,
  30.             get = function(info)
  31.                 return selectedUnit;
  32.             end,
  33.             set = function(info, ...)
  34.                 selectedUnit = ...;
  35.             end,
  36.         },
  37.         general = CreateGeneralOption(),
  38.     };
  39.  
  40.     for _, bar in pairs({"Health", "Power"}) do
  41.         option[string.lower(bar)] = CreateBarOption(bar);
  42.     end
  43.  
  44.     return option;
  45. end



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 )

What would be the best way to achieve such thing?

Thank you in advance and I wish you all the best!!

Last edited by Lyak : 10-27-18 at 05:53 PM.
  Reply With Quote