Wikia

WoWWiki

Dongle/Core API

Talk0
100,551pages on
this wiki

< Dongle

To develop an addon using the Dongle framework you must first ensure Dongle is loaded as part of your addon, or as a dependency, see Dongle/Embedding. You should also know what version of Dongle you are using within your own addon.

Obtain a local reference to DongleEdit

The following code queries DongleStub for the most recent library named "Dongle-Major-Version". You will need to change this name to whichever major version of the framework you are using. This step can be skipped, but I'm including it for clarity.

local Dongle = DongleStub("Dongle-Major-Version")

Dongle:New(name[, obj])Edit

Creates a new dongle object.

ArgumentsEdit

  • name (string) - The name of your dongle. This name must be unique in the global dongle registry.
  • obj (table) - An optional table to use as the basis for the dongle object. If not provided, a new blank table is created and returned.

ReturnsEdit

  • obj (table) - The created (or passed) dongle object with all injected functions
  • name (string) - The name of the dongle

BehaviorEdit

  • Initialize - When the first ADDON_LOADED event fires following your creation of the dongle object, your object's :Initialize() method is called if it exists.
    It is possible to fire off an early ADDON_LOADED by loading another mod. To prevent this, you should only call LoadAddOn in (or after) your Initialize method.
  • Enable - At PLAYER_LOGIN, the :Enable() method of your object is called if it exists.
  • Disable - At PLAYER_LOGOUT, the :Disable() method of your object is called if it exists.

Injected functionsEdit

The following sets of functions are injected into any Dongle object:

Advertisement | Your ad here

Around Wikia's network

Random Wiki