Thread: Get addons list
View Single Post
02-07-16, 10:12 AM   #3
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Those return values are incorrect. GetAddOnInfo's return values changed with the release of WoD, and the enabled return was moved to a different function:

Code:
local CHARACTER = UnitName("player")
for i = 1, GetNumAddOns() do
    local name, title, notes, loadable, reason, security, newVersion = GetAddOnInfo(i)
    local enabled = GetAddOnEnableState(CHARACTER, id)
    -- do stuff here
end
You can alternatively pass nil instead of a character name to GetAddOnEnableState to query whether the addon is enabled/disabled for all characters, instead of just for the specified one.

EnableAddOn(i) and DisableAddOn(i) can be called with true as a second argument to enable/disable the addon for all characters, instead of just for the current one.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote