View Single Post
09-01-18, 07:54 AM   #1
Lyak
A Cyclonian
Join Date: Jul 2018
Posts: 46
[AceConfig] Grey out options when disabled

Hi all,

I am to learn AceConfig and got a question regarding greying options out when disabled.

So, I currently have the following:
Lua Code:
  1. local enable = true
  2. local size = 15
  3.  
  4. local options = {
  5.     type = "group",
  6.     childGroups = "tab",
  7.     name = "Test " .. A.version,
  8.     arg = "Test",
  9.     args = {
  10.         enable = {
  11.             order = 1,
  12.             type = "toggle",
  13.             name = "Enable",
  14.             get = function()
  15.                 return enable;
  16.             end,
  17.             set = function(_, value)
  18.                 enable = value;
  19.             end,
  20.             disabled = function()
  21.  
  22.             end,
  23.         },
  24.         size = {
  25.             order = 2,
  26.             type = "range",
  27.             name = "Size",
  28.             min = 5,
  29.             max = 30,
  30.             step = 1,
  31.             get = function()
  32.                 return size;
  33.             end,
  34.             set = function(_, value)
  35.                 size = value;
  36.             end,
  37.         },
  38.     },
  39. }

It seems like I could grey out the size option with enable's disabled function, but I ain't not too sure

Could I please get a help?

Thank you in advance!
  Reply With Quote