Skip to content
Kyle Buller edited this page Jul 27, 2018 · 1 revision

LibDualSpec-1.0

Adds dual spec support to individual AceDB-3.0 databases

Embedded methods
mixin:IsDualSpecEnabled () Get dual spec feature status.
mixin:SetDualSpecEnabled (enabled) Enable/disabled dual spec feature.
mixin:GetDualSpecProfile (spec) Get the profile assigned to a specialization.
mixin:SetDualSpecProfile (profileName, spec) Set the profile assigned to a specialization.
mixin:CheckDualSpecState () Check if a profile swap should occur.
Library methods
lib:EnhanceDatabase (target, name) Embed dual spec feature into an existing AceDB-3.0 database.
lib:EnhanceOptions (optionTable, target) Embed dual spec options into an existing AceDBOptions-3.0 option table.
lib:IterateDatabases () Iterate through enhanced AceDB3.0 instances.

Embedded methods

mixin:IsDualSpecEnabled ()

Get dual spec feature status.

Returns:

  • (boolean) true is dual spec feature enabled.

mixin:SetDualSpecEnabled (enabled)

Enable/disabled dual spec feature.

Parameters:

  • enabled: (boolean) true to enable dual spec feature, false to disable it.

mixin:GetDualSpecProfile (spec)

Get the profile assigned to a specialization. Defaults to the current profile.

Parameters:

  • spec: (number) the specialization index.

Returns:

  • (string) the profile name.

mixin:SetDualSpecProfile (profileName, spec)

Set the profile assigned to a specialization. No validation is done to ensure the profile is valid.

Parameters:

  • profileName: (string) the profile name to use.
  • spec: (number) the specialization index.

mixin:CheckDualSpecState ()

Check if a profile swap should occur. There is normally no reason to call this method directly as LibDualSpec takes care of calling it at the appropriate time.


Library methods

lib:EnhanceDatabase (target, name)

Embed dual spec feature into an existing AceDB-3.0 database. LibDualSpec specific methods are added to the instance.

Parameters:

  • target: (table) the AceDB-3.0 instance.
  • name: (string) a user-friendly name of the database (best bet is the addon name).

lib:EnhanceOptions (optionTable, target)

Embed dual spec options into an existing AceDBOptions-3.0 option table.

Parameters:

  • optionTable: (table) The option table returned by AceDBOptions-3.0.
  • target: (table) The AceDB-3.0 the options operate on.

lib:IterateDatabases ()

Iterate through enhanced AceDB3.0 instances. The iterator returns (instance, name) pairs where instance and name are the arguments that were provided to lib:EnhanceDatabase.

Returns:

  • Values to be used in a for .. in .. do statement.