WoW:USERAPI SetAddOnDetail

From AddOn Studio
Jump to navigation Jump to search
This page documents a <i>user-defined API</i> that is provided by third-party addons.

AddOn defined functions < SetAddOnDetail

The intent of this page is to provide a simple, consistent API for modular AddOn inclusions to register their details. Currently in WoW, there are functions to query details of loaded AddOns. However for embedded AddOns, they don't appear anywhere. Any addons that are interested in registering their details are asked to call the following function, and any addons that are interested in what addons are loaded are asked to hook the following function:

SetAddOnDetail(name, detail)



String - The name of the AddOn being defined (should be the same as the name would be if running standalone)
Table - Contains the detail for the various pieces of detail about the addon.

The detail table structure[edit]

The detail table contains optional pieces of information in the same meaning and sense that they are used in the TOC File (except in lowercase), including but not limited to:

The version of the AddOn.
This text is what is displayed in the AddOns list located during user selection.
The message that appears under the AddOn name when you mouseover the name of the AddOn in the WoW AddOns list.

Hooking Procedure[edit]

For addons that want to monitor the submitted details, the following code is the recommended procedure to create the function:

-- Define a blank stub if the function doesn't exist.
if not _G['SetAddOnDetail'] then
	_G['SetAddOnDetail'] = function(name, detail) end

-- Define my functions to process the information.
local myRegistry = {}
local function myAddOnDetail(name, detail)
	myRegisty[name] = detail

-- Post hook the global SetAddOnDetail function.
hooksecurefunc("SetAddOnDetail", myAddOnDetail)

Example Code[edit]

The following code snippets illustrate how to register your AddOn's details via the SetAddOnDetail function.

if SetAddOnDetail then
	SetAddOnDetail("myAddOn", {
		version = "1.0",
		title = "My AddOn",
		notes = "An addon to demonstrate the use of the SetAddOnDetail() function",


This function is implemented by the following addons:

AddOns using this function: