WoW:API GetAddOnInfo: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
mNo edit summary
m (Move page script moved page API GetAddOnInfo to API GetAddOnInfo without leaving a redirect)
 
(2 intermediate revisions by 2 users not shown)
Line 14: Line 14:
:name, title, notes, enabled, loadable, reason, security
:name, title, notes, enabled, loadable, reason, security


:;name : String - The name of the AddOn.
:;name : String - The name of the AddOn (the folder name).
:;title : String - The title of the AddOn from its .toc file (presumably this is the appropriate localized one).
:;title : String - The title of the AddOn as listed in the .toc file (presumably this is the appropriate localized one).
:;notes : String - The notes about the AddOn from its .toc file (presumably this is the appropriate localized one).
:;notes : String - The notes about the AddOn from its .toc file (presumably this is the appropriate localized one).
:;enabled : Flag - Indicates if the AddOn is currently enabled, 1 if it is, nil if it is not.
:;enabled : Flag - Indicates if the AddOn is currently enabled, 1 if it is, nil if it is not.
:;loadable : Flag - Indicates if the AddOn is eligible to be loaded, 1 if it is, nil if it is not.
:;loadable : Flag - Indicates if the AddOn is eligible to be loaded, 1 if it is, nil if it is not. Currently returns 1 if the addon is LoadOnDemand in the .toc file or if the addon is already loaded.
:;reason : String - The reason why the AddOn cannot be loaded. This is nil if the addon is loadable, otherwise it contains a code indicating the reason. (Observed reason codes: "DISABLED" and "MISSING")
:;reason : String - The reason why the AddOn cannot be loaded. This is nil if the addon is loadable or already loaded, otherwise it contains a code indicating the reason. (Observed reason codes: "DISABLED", "MISSING", "INTERFACE_VERSION")
:;security : String - Indicates the security status of the AddOn. This is currently "INSECURE" for all user provided addons and "SECURE" for Blizzard_* AddOns.
:;security : String - Indicates the security status of the AddOn. This is currently "INSECURE" for all user provided addons and "SECURE" for Blizzard_* AddOns.


----
== Notes ==
* If the function is passed a string, ''name'' will always be the value passed, so check if ''reason'' equals "MISSING" to find out if an addon exists.
* ''index or "name"'' is not case sensitive, at least not on Windows.
* If the function is passed a number that is out of range, you will get an error message, specifically <code>[<file name>]:<line number> AddOn index must be in the range of 1 to <GetNumAddOns()></code>
 
__NOTOC__
__NOTOC__

Latest revision as of 04:45, 15 August 2023

WoW API < GetAddOnInfo

Get information about an AddOn.

name, title, notes, enabled, loadable, reason, security = GetAddOnInfo(index or "name")

Parameters[edit]

Arguments[edit]

(index or "name")
index
Integer - The index of the AddOn in the user's AddOn list. Note that you cannot access Blizzard-provided AddOns through this mechanism.
name
String - The name of the AddOn to be queried. You can access Blizzard-provided AddOns through this mechanism.

Returns[edit]

name, title, notes, enabled, loadable, reason, security
name
String - The name of the AddOn (the folder name).
title
String - The title of the AddOn as listed in the .toc file (presumably this is the appropriate localized one).
notes
String - The notes about the AddOn from its .toc file (presumably this is the appropriate localized one).
enabled
Flag - Indicates if the AddOn is currently enabled, 1 if it is, nil if it is not.
loadable
Flag - Indicates if the AddOn is eligible to be loaded, 1 if it is, nil if it is not. Currently returns 1 if the addon is LoadOnDemand in the .toc file or if the addon is already loaded.
reason
String - The reason why the AddOn cannot be loaded. This is nil if the addon is loadable or already loaded, otherwise it contains a code indicating the reason. (Observed reason codes: "DISABLED", "MISSING", "INTERFACE_VERSION")
security
String - Indicates the security status of the AddOn. This is currently "INSECURE" for all user provided addons and "SECURE" for Blizzard_* AddOns.

Notes[edit]

  • If the function is passed a string, name will always be the value passed, so check if reason equals "MISSING" to find out if an addon exists.
  • index or "name" is not case sensitive, at least not on Windows.
  • If the function is passed a number that is out of range, you will get an error message, specifically [<file name>]:<line number> AddOn index must be in the range of 1 to <GetNumAddOns()>