LibAvionOption-2.0
From WowAce Wiki
| Betas | Ace SVN Zip |
|---|---|
| Changelog | FishEye |
Contents
|
LibAvionOption-2.0 - API Documentation
Example addon
UNDER CONSTRUCTION
:BuildAnimationOptions(tableSytle, animationID, animationTable, textureList, soundList, functionList)
Arguments
- tableSytle
- string - Wether to use ACE3 or Rock
- animationID
- string - The unique identifier for this animation.
- animationTable
- table - The table that defines this animation, see EOF for more.
- textureList
- table - List of available textures (key=set-value, value=display)
- soundList
- table - List of available sounds (key=set-value, value=display)
- functionList
- table - List of available fuctions (key=set-value, value=display)
Returns
- options
- table - Table that can be used for with ACE3 or Rock
Notes
- Builds an AceConfig3/Rock-Config-1.0 compatible options table for given animation.
Example
LibAvionOpt:BuildAnimationOptions("ACE3", "Animation1337", {...}, {[path]=display}, {[path]=display}, {[pointer]=display})
:ShowGuideFrame(animationID, animationTable)
Arguments
- animationID
- string - The unique identifier for this animation.
- animationTable
- table - The table that defines this animation, see EOF for more.
Notes
- Shows a setup-overlay for easier animation configuration.
Example
LibAvionOpt:ShowGuideFrame("MyAnimation1337", {...})
:HideGuideFrame(animationID)
Arguments
- animationID
- string - The unique identifier for this animation.
Notes
- Hide setup-overlay again.
Example
LibAvionOpt:HideGuideFrame("MyAnimation1337")
:UpdateGuideFrame(animationID)
Arguments
- animationID
- string - The unique identifier for this animation.
Notes
- Will (force) the amimation to be updated according to updated animationTable.
Example
LibAvionOpt:UpdateGuideFrame("MyAnimation1337")
:IsGuideFrameShown(animationID)
Arguments
- animationID
- string - The unique identifier for this animation.
Notes
- Check if there is allready an setup-overlay assiciated with this identifier.
Example
LibAvionOpt:IsGuideFrameShown("MyAnimation1337")
:Embed(target)
Arguments
- target
- table - Library or addon to embed LibAvion-2.0 in.
Notes
- Embeds methods from LibAvion-2.0 into target table.
Example
LibStub:GetLibrary("LibCooldown-Item-2.0"):Embed(MyAddon)
CallbackHandler-1.0 - API
:RegisterEvent()
myAddon:RegisterEvent("eventName"[, method[, arg]])
library.RegisterEvent(myTable, "eventName"[, method[, arg]])
library.RegisterEvent("myAddonId", "eventName"[, method[, arg]])
- "eventName"
- (string) - the name of the event you want to listen to
- method
- (string or function) - which method to call. If string, self["method"] will be called. If left out (nil), self["eventName"] will be called.
- arg
- (optional) - If present (even nil), this value will be passed to the receiving function.
Registrations are always associated with the supplied self. This means that you'll want to embed the library, or do the call like .RegisterEvent(myTable, ...). Note the use of " . " (period) rather than " : " (colon).
If you do not have a sane self table to associate your registrations with, you can substitute it for a string. Note the use of "." rather than ":".
-
library.RegisterEvent("myAddonId", "eventName", ...)
This string variant of a self will not be passed to the receiving function.
Callback arguments
If the method is a plain function, it will be called as:
-
method("eventName", (arguments to the event)) - or, with an arg specified when registering:
-
method(arg, "eventName", (arguments to the event))
If the method is a string (method name), it will be called as:
-
self["method"](self, "eventName", (arguments to the event)) - or, with an arg specified when registering:
-
self["method"](self, arg, "eventName", (arguments to the event))
:UnregisterEvent()
myAddon:UnregisterEvent("eventName")
library.UnregisterEvent(myTable, "eventName")
library.UnregisterEvent("myAddonId", "eventName")
- "eventName"
- the name of the event that you no longer wish to receive.
Note that the supplied self must match the self supplied to :RegisterEvent(), or nothing will be unregistered.
:UnregisterAllEvents()
:UnregisterAllEvents()
library.UnregisterAllEvents("myAddonId", myTable, ...)
UnregisterAllEvents will unregister all events associated with the given self, as well as with additional arguments given.

