Libra

Addon object.

local MyAddon = Libra:NewAddon("MyAddon")

When an addon loads, .OnInitialize will be executed if found on the addon object, followed by the module objects.


Addon:NewModule(name, table)
name
Identifier within the addon object for the module.
table
An existing table to use as the module object. If not provided, will create a new table.

Creating a module will call Addon:OnModuleCreated(moduleName, moduleTable) if it exists.

local module = MyAddon:NewModule("ModuleName")


Addon:GetModule(name)
name
Name of the module.


Addon:IterateModules()
for moduleName, moduleObject in Addon:IterateModules() do
	print(moduleObject.name)
end


Object:RegisterEvent(event, handler)
event
The event to register.
table
The handler for the event. Method name or function. If not provided, will use the method with the name of the event.


Object:UnregisterEvent(event)
event
The event to register.


Object:SetOnUpdate(handler)

Sets an OnUpdate script to the object.

handler
The function to run OnUpdate.


Object:RemoveOnUpdate()

Removes the object's OnUpdate script.


You must login to post a comment. Don't have an account? Register to get one!

Facts

Date created
Jul 25, 2014
Last updated
Jul 25, 2014

Author