Fandom

WoWWiki

Dongle/Core API

< Dongle

104,634pages on
this wiki
Add New Page
Talk0 Share

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

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:

Also on Fandom

Random Wiki