RegisterAddon

From WildStar NASA Reference Wiki
Jump to: navigation, search

This article is a stub. Feel free to expand it.

Description

Main Entry point for Addons, registers the addon with Apollo so that OnLoad, OnSave, OnRestore events are all sent to the addon.

Arguments

  • tAddonTable (Table)
  • bHasConfig (Boolean)
  • strConfigName (String)
  • tDependencies (Table)

Returns

nil

Example Usage

function MyAddon:Init()
  local bHasConfig = true
  local strConfigName = "My Config"
  local tDependencies = {
    "Nameplates",
    "FooLib",
  }

  Apollo.RegisterAddon(self, bHasConfig, strConfigName, tDependencies)
end

The above code would register an addon that has a config option (Accessible via the options screen) called "My Config". This addon would also try to make sure that Nameplates and FooLib were loaded before calling its OnLoad. If they were not present it would call the OnDependencyError function with the name of the dependency that did not load and an error relating to that failure.