View Single Post
11-03-18, 11:44 AM   #9
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
I think I solved it with your hints, tips, and extra eyes. I'll trim out the extra code, so the line numbers won't line up, but it gets the point. I will know for sure next time I log in. The adjusted line 195 now reads
Code:
values = function() return SortedAddOns(AddOnList) end,
Which calls the following chunk at the top of the file.
Lua Code:
  1. -- create a list of installed AddOns that are returned to the options table
  2. local AddOnList = {}
  3. local function SortedAddOns(AddOnList)
  4.     table.wipe(AddOnList) -- clean slate
  5.     for i = 1, GetNumAddOns() do
  6.         local folderName, title = GetAddOnInfo(i)
  7.         if not exempt[folderName] then -- ignore exempt addons
  8.             -- Lua tables start with an index of 1, and if AddOnList is empty, bump it to 1 instead of 0  for its first entry
  9.             local index = #AddOnList + 1
  10.             AddOnList[index] = title
  11.         end
  12.     end
  13.  
  14.     -- now sort AddOnList alphabetically
  15.     table.sort(AddOnList, function(a, b)
  16.         return a.name > b.name
  17.     end)
  18.  
  19.     -- return AddOnList to options
  20.     return AddOnList
  21. end

Last edited by myrroddin : 11-03-18 at 11:56 AM. Reason: syntax update for values =
  Reply With Quote