Thread: Get addons list
View Single Post
02-08-16, 03:45 AM   #4
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
Originally Posted by Phanx View Post
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.
I guess id should be i here?
  Reply With Quote