Mr. Mistoffolees@legacy41559324 (talk | contribs) (reload ui to take effect) |
Meorawr31439 (talk | contribs) m (→Details) Tags: WoW API docs Manual revert |
||
(25 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
− | {{wowapi}} |
+ | {{wowapi}} |
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
+ | :;addon |
||
+ | ::{{apitype|number}} - <code>addonIndex</code> from 1 to {{api|t=a|GetNumAddOns}}() |
||
+ | ::''or'' {{apitype|string}} - <code>addonName</code> (as in toc/folder filename) of the addon, case insensitive. |
||
+ | :;character |
||
+ | ::{{apitype|string?}} - <code>playerName</code> of the character (without realm) |
||
+ | ::''or'' {{apitype|boolean?}} - <code>enableAll</code> True if the addon should be enabled/disabled for all characters on the realm. |
||
+ | ::: Defaults to the current character. This param is currently bugged when attempting to use it ([https://github.com/Stanzilla/WoWUIBugs/issues/156 Issue #156]). |
||
+ | ==Details== |
||
⚫ | |||
⚫ | |||
− | == Parameters == |
||
+ | * Attempting to disable secure addons with the GuardedAddOn [[TOC format#Restricted|TOC metadata field]] will result in an "Cannot disable a guarded AddOn" error. |
||
⚫ | |||
− | :(index or "name") |
||
+ | ==Example== |
||
− | :;index : Integer - The index of the AddOn to disable in the user's AddOn list. |
||
+ | {{:API_EnableAddOn}} |
||
− | :;name : String - The name of the AddOn to be disabled. |
||
− | === Returns === |
||
− | :''nil'' |
||
− | == |
+ | ==Patch changes== |
+ | * {{Patch 10.1.0|note=Secure addons with the GuardedAddOn TOC metadata field can no longer be disabled.}} |
||
− | * Sometimes this function will disable the addon globally and sometimes only for the current character. There doesn't appear to be any pattern to this or any reason behind this. Perhaps the functionality was changed in patch 2.4. |
||
+ | |||
⚫ | |||
+ | {{apinavbox|AddOn}} |
||
+ | <!-- emmylua |
||
+ | ---@param index number |
||
+ | ---@param character? string|boolean |
||
+ | ---@overload fun(name: string, character?: string|boolean) |
||
+ | function DisableAddOn(index, character) end |
||
+ | --> |
Latest revision as of 23:45, 20 April 2023
Automated updating of API pages at this location, to reflect patch changes, has ceased from 10.1.7 onwards. |
Disables an addon for subsequent sessions.
DisableAddOn(addon [, character])
Arguments
- addon
- number -
addonIndex
from 1 to GetNumAddOns() - or string -
addonName
(as in toc/folder filename) of the addon, case insensitive. - character
- string? -
playerName
of the character (without realm) - or boolean? -
enableAll
True if the addon should be enabled/disabled for all characters on the realm.- Defaults to the current character. This param is currently bugged when attempting to use it (Issue #156).
Details
- Takes effect only after reloading the UI.
- Attempting to disable secure addons with the GuardedAddOn TOC metadata field will result in an "Cannot disable a guarded AddOn" error.
Example
- Enables the addon at index 1 for the current character.
function PrintAddonInfo(idx)
local name = GetAddOnInfo(idx)
local enabledState = GetAddOnEnableState(nil, idx)
print(name, enabledState)
end
PrintAddonInfo(1) -- "HelloWorld", 0
EnableAddOn(1)
PrintAddonInfo(1) -- "HelloWorld", 2
- This should enable an addon for all characters, provided it isn't bugged.
EnableAddOn("HelloWorld", true)
- Blizzard addons can be only accessed by name instead of index.
DisableAddOn("Blizzard_CombatLog")
Patch changes
- Patch 10.1.0 (2023-05-02): Secure addons with the GuardedAddOn TOC metadata field can no longer be disabled.
|