37
37
38
38
-- Picks the first non-nil value and returns it
39
39
local function pickfirstset (...)
40
- for i = 1 , select (" #" , ... ) do
41
- if select (i ,... ) ~= nil then
42
- return select (i , ... )
43
- end
44
- end
40
+ for i = 1 , select (" #" , ... ) do
41
+ if select (i ,... ) ~= nil then
42
+ return select (i , ... )
43
+ end
44
+ end
45
45
end
46
46
47
47
-- Gets an option from a given group, checking plugins
@@ -332,9 +332,9 @@ local function FeedOptions(appName, options, path, group, category, layout, isRo
332
332
local defaultValue = GetOptionsMemberValue (" defaultValue" , v , options , path , appName )
333
333
334
334
local setting = Settings .RegisterAddOnSetting (category , name , k , type (defaultValue ), defaultValue )
335
- Settings .CreateCheckBox (category , setting , desc )
336
- Settings .SetOnValueChangedCallback (k , OnSettingChanged )
337
- setting :SetValue (value )
335
+ Settings .CreateCheckBox (category , setting , desc )
336
+ Settings .SetOnValueChangedCallback (k , OnSettingChanged )
337
+ setting :SetValue (value )
338
338
339
339
elseif v .type == " range" then
340
340
-- TODO
@@ -346,17 +346,17 @@ local function FeedOptions(appName, options, path, group, category, layout, isRo
346
346
local values = GetOptionsMemberValue (" values" , v , options , path , appName )
347
347
348
348
local function GetOptions ()
349
- local container = Settings .CreateControlTextContainer ()
350
- for optionsKey , optionsValue in pairs (values ) do
351
- container :Add (optionsKey , optionsValue )
352
- end
353
- return container :GetData ()
354
- end
355
-
356
- local setting = Settings .RegisterAddOnSetting (category , name , k , type (defaultValue ), defaultValue )
357
- Settings .CreateDropDown (category , setting , GetOptions , desc )
358
- Settings .SetOnValueChangedCallback (k , OnSettingChanged )
359
- setting :SetValue (value )
349
+ local container = Settings .CreateControlTextContainer ()
350
+ for optionsKey , optionsValue in pairs (values ) do
351
+ container :Add (optionsKey , optionsValue )
352
+ end
353
+ return container :GetData ()
354
+ end
355
+
356
+ local setting = Settings .RegisterAddOnSetting (category , name , k , type (defaultValue ), defaultValue )
357
+ Settings .CreateDropDown (category , setting , GetOptions , desc )
358
+ Settings .SetOnValueChangedCallback (k , OnSettingChanged )
359
+ setting :SetValue (value )
360
360
361
361
elseif v .type == " multiselect" then
362
362
-- TODO
388
388
-- @param category The reference to the root category registered into the Interface Options.
389
389
-- @param layout The reference to the root category's layout
390
390
local function FeedToBlizPanel (appName , category , layout )
391
- local app = reg :GetOptionsTable (appName )
391
+ local app = reg :GetOptionsTable (appName )
392
392
if not app then
393
393
error ((" %s isn't registed with AceConfigRegistry, unable to open config" ):format (appName ), 2 )
394
394
end
0 commit comments